Merge branch 'develop' of https://github.com/frappe/erpnext into loan_closure_fixes

This commit is contained in:
Deepesh Garg 2020-05-01 09:24:10 +05:30
commit 1a497b3442

View File

@ -86,13 +86,6 @@ def trigger_razorpay_subscription(data):
if data.event == "subscription.activated":
member.customer_id = payment.customer_id
# Update these values anyway
member.subscription_start = datetime.fromtimestamp(subscription.start_at)
member.subscription_end = datetime.fromtimestamp(subscription.end_at)
member.subscription_activated = 1
member.save(ignore_permissions=True)
elif data.event == "subscription.charged":
membership = frappe.new_doc("Membership")
membership.update({
@ -109,6 +102,12 @@ def trigger_razorpay_subscription(data):
})
membership.insert(ignore_permissions=True)
# Update these values anyway
member.subscription_start = datetime.fromtimestamp(subscription.start_at)
member.subscription_end = datetime.fromtimestamp(subscription.end_at)
member.subscription_activated = 1
member.save(ignore_permissions=True)
return True