fix: cancel existing subscription while creating new subscription
This commit is contained in:
parent
6e2c6269f7
commit
7c6370a2d1
1 changed files with 4 additions and 3 deletions
|
|
@ -293,8 +293,9 @@ def create_recurring_profile(token, payerid):
|
|||
addons = data.get("addons")
|
||||
subscription_details = data.get("subscription_details")
|
||||
|
||||
if data.get('subscription_id') and addons:
|
||||
updating = True
|
||||
if data.get('subscription_id'):
|
||||
if addons:
|
||||
updating = True
|
||||
manage_recurring_payment_profile_status(data['subscription_id'], 'Cancel', params, url)
|
||||
|
||||
params.update({
|
||||
|
|
@ -351,7 +352,7 @@ def update_integration_request_status(token, data, status, error=False, doc=None
|
|||
|
||||
def get_redirect_uri(doc, token, payerid):
|
||||
data = json.loads(doc.data)
|
||||
|
||||
|
||||
if data.get("subscription_details") or data.get("subscription_id"):
|
||||
return get_url("{0}.create_recurring_profile?token={1}&payerid={2}".format(api_path, token, payerid))
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue