lang 3 жил өмнө
parent
commit
7126e27cbf

+ 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):