downgrade notifications
This commit is contained in:
@@ -107,7 +107,7 @@ def make_payment(rower,data):
|
||||
else:
|
||||
return 0,''
|
||||
|
||||
def update_subscription(rower,data):
|
||||
def update_subscription(rower,data,method='up'):
|
||||
planid = data['plan']
|
||||
plan = PaidPlan.objects.get(id=planid)
|
||||
nonce_from_the_client = data['payment_method_nonce']
|
||||
@@ -148,11 +148,13 @@ def update_subscription(rower,data):
|
||||
l = rower.user.last_name,
|
||||
)
|
||||
|
||||
if method == 'up':
|
||||
transactions = result.subscription.transactions
|
||||
|
||||
transactions = result.subscription.transactions
|
||||
|
||||
if transactions:
|
||||
amount = transactions[0].amount
|
||||
if transactions:
|
||||
amount = transactions[0].amount
|
||||
else:
|
||||
amount = 0
|
||||
else:
|
||||
amount = 0
|
||||
|
||||
@@ -164,7 +166,8 @@ def update_subscription(rower,data):
|
||||
plan.paymenttype == 'recurring',
|
||||
plan.price,
|
||||
amount,
|
||||
result.subscription.billing_period_end_date.strftime('%Y-%m-%d'))
|
||||
result.subscription.billing_period_end_date.strftime('%Y-%m-%d'),
|
||||
method)
|
||||
|
||||
return True
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user