|
@@ -380,7 +380,7 @@ class PaypalCycleNotify(View):
|
|
|
agreement_id = paypal_body.get('billing_agreement_id')
|
|
|
paypal_transaction_id = paypal_body.get('id')
|
|
|
amount = paypal_body.get('amount')
|
|
|
-
|
|
|
+ fee = paypal_body['transaction_fee']['value']
|
|
|
PaypalWebHookEventInsert = {
|
|
|
'webhook_event_id': json_obj.get('id'),
|
|
|
'resource_type': json_obj.get('resource_type'),
|
|
@@ -435,7 +435,7 @@ class PaypalCycleNotify(View):
|
|
|
return HttpResponse('Fail', status=500)
|
|
|
|
|
|
if order_qs[0]['create_vod']:
|
|
|
- order_qs.update(status=1, trade_no=paypal_transaction_id, updTime=nowTime)
|
|
|
+ order_qs.update(status=1, trade_no=paypal_transaction_id, updTime=nowTime, fee=fee)
|
|
|
else:
|
|
|
# 是否有促销
|
|
|
expire = order_qs[0]['rank__expire']
|
|
@@ -459,7 +459,7 @@ class PaypalCycleNotify(View):
|
|
|
uid_bucket_id = self.create_vod(uid, expire, is_ai, nowTime, channel, bucketId, order_id,
|
|
|
userid, username)
|
|
|
order_qs.update(status=1, trade_no=paypal_transaction_id, updTime=nowTime,
|
|
|
- uid_bucket_id=uid_bucket_id, create_vod=1,
|
|
|
+ uid_bucket_id=uid_bucket_id, create_vod=1, fee=fee,
|
|
|
promotion_rule_id=promotion_rule_id, agreement_id=agreement_id)
|
|
|
# 核销coupon
|
|
|
if coupon_id:
|
|
@@ -518,7 +518,7 @@ class PaypalCycleNotify(View):
|
|
|
# PayPal周期扣款首次扣款
|
|
|
if billing_agreement.agreement_details.cycles_completed == '0':
|
|
|
if order_qs[0]['create_vod']:
|
|
|
- order_qs.update(status=1, trade_no=paypal_transaction_id, updTime=nowTime)
|
|
|
+ order_qs.update(status=1, trade_no=paypal_transaction_id, updTime=nowTime, fee=fee)
|
|
|
else:
|
|
|
# 是否有促销
|
|
|
promotion = PromotionRuleModel.objects.filter(status=1, startTime__lte=nowTime,
|
|
@@ -533,7 +533,7 @@ class PaypalCycleNotify(View):
|
|
|
uid_bucket_id = self.create_vod(UID, expire, is_ai, nowTime, channel, bucketId, order_id,
|
|
|
userid, username)
|
|
|
order_qs.update(status=1, trade_no=paypal_transaction_id, updTime=nowTime,
|
|
|
- uid_bucket_id=uid_bucket_id, create_vod=1,
|
|
|
+ uid_bucket_id=uid_bucket_id, create_vod=1, fee=fee,
|
|
|
promotion_rule_id=promotion_rule_id, agreement_id=agreement_id)
|
|
|
# 核销coupon
|
|
|
if coupon_id:
|
|
@@ -600,7 +600,7 @@ class PaypalCycleNotify(View):
|
|
|
price=amount.get('total'),
|
|
|
currency=order_qs[0]['currency'], addTime=nowTime,
|
|
|
updTime=nowTime, order_type=order_type,
|
|
|
- pay_url='', isSelectDiscounts=0,
|
|
|
+ pay_url='', isSelectDiscounts=0, fee=fee,
|
|
|
commodity_code=commodity_code, create_vod=1,
|
|
|
commodity_type=commodity_type, rank_id=rank, paymentID='',
|
|
|
coupon_id='', uid_bucket_id=uid_bucket_id, status=1,
|