Skip to content

Commit

Permalink
Merge pull request stripe-samples#63 from anatolzak/patch-1
Browse files Browse the repository at this point in the history
changed multiple if checks to elif
  • Loading branch information
cjavilla-stripe authored Nov 2, 2020
2 parents ff6cefe + ee11820 commit 36f62ba
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions fixed-price-subscriptions/server/python/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,24 +215,24 @@ def webhook_received():
# limits.
print(data)

if event_type == 'invoice.payment_failed':
elif event_type == 'invoice.payment_failed':
# If the payment fails or the customer does not have a valid payment method,
# an invoice.payment_failed event is sent, the subscription becomes past_due.
# Use this webhook to notify your user that their payment has
# failed and to retrieve new card details.
print(data)

if event_type == 'invoice.finalized':
elif event_type == 'invoice.finalized':
# If you want to manually send out invoices to your customers
# or store them locally to reference to avoid hitting Stripe rate limits.
print(data)

if event_type == 'customer.subscription.deleted':
elif event_type == 'customer.subscription.deleted':
# handle subscription cancelled automatically based
# upon your subscription settings. Or if the user cancels it.
print(data)

if event_type == 'customer.subscription.trial_will_end':
elif event_type == 'customer.subscription.trial_will_end':
# Send notification to your user that the trial will end
print(data)

Expand Down

0 comments on commit 36f62ba

Please sign in to comment.