Parcourir la source

修复取消订阅bug

lang il y a 3 ans
Parent
commit
7126e27cbf
1 fichiers modifiés avec 1 ajouts et 0 suppressions
  1. 1 0
      Controller/PaymentCycle.py

+ 1 - 0
Controller/PaymentCycle.py

@@ -628,6 +628,7 @@ class payCycle(View):
         try:
             billing_agreement = paypalrestsdk.BillingAgreement.find(BILLING_AGREEMENT_ID)
             if billing_agreement.state != 'Active':
+                Order_Model.objects.filter(agreement_id=BILLING_AGREEMENT_ID).update(agreement_id='')
                 return response.json(0)
             cancel_note = {"note": "Canceling the agreement"}
             if billing_agreement.cancel(cancel_note):