|
@@ -1331,15 +1331,17 @@ class CronComparedDataView(View):
|
|
|
for item in order_list:
|
|
|
total += float(item['transaction_info']['transaction_amount']['value'])
|
|
|
trade_no = item['transaction_info']['transaction_id']
|
|
|
- if item['transaction_info']['transaction_event_code'] in ['T1106', 'T1107']: # 付款退款
|
|
|
+ if item['transaction_info']['transaction_event_code'] in ['T1106', 'T1107', 'T1202']: # 付款退款
|
|
|
trade_no = item['transaction_info']['paypal_reference_id']
|
|
|
transaction_subject = item['transaction_info'].get('transaction_subject', '')
|
|
|
agreement_id = item['transaction_info'].get('paypal_reference_id', '')
|
|
|
refund_order = False
|
|
|
- if item['transaction_info']['transaction_event_code'] in ['T1106', 'T1107', 'T1201', 'T0114']:
|
|
|
+ if item['transaction_info']['transaction_event_code'] in ['T1106', 'T1107', 'T1201', 'T0114', 'T1108']:
|
|
|
agreement_id = ''
|
|
|
if item['transaction_info']['transaction_event_code'] in ['T0114']:
|
|
|
transaction_subject = '争议费'
|
|
|
+ elif item['transaction_info']['transaction_event_code'] in ['T1108']:
|
|
|
+ transaction_subject = 'Fee reversal'
|
|
|
else:
|
|
|
refund_order = True
|
|
|
transaction_subject = '退款费'
|
|
@@ -1387,16 +1389,16 @@ class CronComparedDataView(View):
|
|
|
if daily_reconciliation.first().order_ids:
|
|
|
old_order_list = daily_reconciliation.first().order_ids.split(',')
|
|
|
more_order_list = list(set(old_order_list) | set(more_order_list))
|
|
|
- order_ids = ','.join(more_order_list)
|
|
|
- daily_reconciliation.update(paypal_num=count, paypal_total=total, upd_time=now_time, order_ids=order_ids)
|
|
|
+ order_ids = ','.join(set(more_order_list))
|
|
|
+ daily_reconciliation.update(paypal_num=count, paypal_total=total, upd_time=now_time,
|
|
|
+ order_ids=order_ids)
|
|
|
else:
|
|
|
- order_ids = ','.join(more_order_list)
|
|
|
+ order_ids = ','.join(set(more_order_list))
|
|
|
DailyReconciliation.objects.create(paypal_num=count, paypal_total=total, time=timestamp,
|
|
|
order_ids=order_ids, creat_time=now_time, upd_time=now_time)
|
|
|
except Exception as e:
|
|
|
LOGGER.info('paypal每日对账异常:errLine:{}, errMsg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
|
|
|
|
|
|
-
|
|
|
@staticmethod
|
|
|
def compared_wechat_order(response):
|
|
|
today = datetime.datetime.today()
|
|
@@ -1561,12 +1563,12 @@ class CronComparedDataView(View):
|
|
|
if daily_reconciliation.first().order_ids:
|
|
|
old_order_list = daily_reconciliation.first().order_ids.split(',')
|
|
|
more_order_list = list(set(old_order_list) | set(more_order_list))
|
|
|
- order_ids = ','.join(more_order_list)
|
|
|
- daily_reconciliation.update(ansjer_total=total, ansjer_num=count, order_ids=order_ids, upd_time=now_time)
|
|
|
+ order_ids = ','.join(set(more_order_list))
|
|
|
+ daily_reconciliation.update(ansjer_total=total, ansjer_num=count, order_ids=order_ids,
|
|
|
+ upd_time=now_time)
|
|
|
else:
|
|
|
order_ids = ','.join(more_order_list)
|
|
|
DailyReconciliation.objects.create(order_ids=order_ids, ansjer_total=total, ansjer_num=count,
|
|
|
time=start_timestamp, creat_time=now_time, upd_time=now_time)
|
|
|
except Exception as e:
|
|
|
LOGGER.info('后台每日对账异常:errLine:{}, errMsg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
|
|
|
-
|