Fixed email templates failing to load and updated README.md

This commit is contained in:
Keannu Christian Bernasol 2024-05-10 23:46:48 +08:00
parent 8d40a33882
commit fe59d3883a
4 changed files with 21 additions and 12 deletions

View file

@ -135,10 +135,9 @@ def stripe_webhook_view(request):
if event['type'] == 'customer.subscription.created':
subscription = event['data']['object']
# Get the Invoice object from the Subscription object
invoice = stripe.Invoice.retrieve(subscription['latest_invoice'])[
'data']['object']
invoice = stripe.Invoice.retrieve(subscription['latest_invoice'])
# Get the Charge object from the Invoice object
charge = stripe.Charge.retrieve(invoice['charge'])['data']['object']
charge = stripe.Charge.retrieve(invoice['charge'])
# Get paying user
customer = stripe.Customer.retrieve(subscription["customer"])