peng 1 год назад
Родитель
Сommit
9474491622
2 измененных файлов с 5 добавлено и 4 удалено
  1. 0 2
      Controller/CloudStorage.py
  2. 5 2
      Controller/Cron/CronTaskController.py

+ 0 - 2
Controller/CloudStorage.py

@@ -1648,8 +1648,6 @@ class CloudStorageView(View):
                 "payer": {"payment_method": "paypal"},
                 "redirect_urls": {"return_url": call_sub_url, "cancel_url": call_clc_url},
                 "transactions": [{
-                    "payment_options": {
-                        "allowed_payment_method": "IMMEDIATE_PAY"},
                     "item_list": {"items": [
                         {"name": "Cloud video", "sku": "1", "price": price, "currency": "USD", "quantity": 1}]},
                     "amount": {"total": price, "currency": currency},

+ 5 - 2
Controller/Cron/CronTaskController.py

@@ -1454,12 +1454,13 @@ class CronComparedDataView(View):
             if item['transaction_info']['transaction_event_code'] == 'T1107':
                 trade_no = item['transaction_info']['paypal_reference_id']
                 more_order_list.append(trade_no)
+            pay_time = int(datetime.datetime.strptime(item['transaction_info']['transaction_updated_date'],
+                                                      "%Y-%m-%dT%H:%M:%S%z").timestamp())
             order_qs = Order_Model.objects.filter(trade_no=trade_no, payType=1)
             if not order_qs.exists():
                 transaction_subject = item['transaction_info'].get('transaction_subject', '')
                 agreement_id = item['transaction_info'].get('paypal_reference_id', '')
-                pay_time = int(datetime.datetime.strptime(item['transaction_info']['transaction_updated_date'],
-                                                          "%Y-%m-%dT%H:%M:%S%z").timestamp())
+
                 order_dict = {
                     'trade_no': trade_no,
                     'agreement_id': agreement_id,
@@ -1485,6 +1486,8 @@ class CronComparedDataView(View):
                 if result['result_code'] != 0 or not result['result']['is_exist']:
                     # 如果响应结果为空,记录在数据库
                     AbnormalOrder.objects.create(**order_dict)
+            else:
+                order_qs.update(payTime=pay_time)
         total = round(total, 2)
         daily_reconciliation = DailyReconciliation.objects.filter(time=timestamp)
         if daily_reconciliation.exists():