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