Quellcode durchsuchen

Merge pull request #7621 from saurabh6790/ignore_if_profile_already_cancelled

fix(paypal): Ignore if profile is already cancelled
pull/2/head
Saurabh vor 6 Jahren
committed by GitHub
Ursprung
Commit
34298bbadb
1 geänderte Dateien mit 5 neuen und 1 gelöschten Zeilen
  1. +5
    -1
      payments/payment_gateways/doctype/paypal_settings/paypal_settings.py

+ 5
- 1
payments/payment_gateways/doctype/paypal_settings/paypal_settings.py Datei anzeigen

@@ -367,7 +367,11 @@ def manage_recurring_payment_profile_status(profile_id, action, args, url):


response = make_post_request(url, data=args) response = make_post_request(url, data=args)


if response.get("ACK")[0] != "Success":
# error code 11556 indicates profile is not in active state(or already cancelled)
# thus could not cancel the subscription.
# thus raise exception only if error code not quals to 11556

if response.get("ACK")[0] != "Success" and response.get("L_ERRORCODE0", [])[0] != '11556':
frappe.throw(_("Failed while amending subscription")) frappe.throw(_("Failed while amending subscription"))


@frappe.whitelist(allow_guest=True) @frappe.whitelist(allow_guest=True)


Laden…
Abbrechen
Speichern