瀏覽代碼

修复取消订阅bug

lang 3 年之前
父節點
當前提交
7126e27cbf
共有 1 個文件被更改,包括 1 次插入0 次删除
  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):