forked from 3wordchant/capsul-flask
fixing a bug which occurs when for some reason stripe doesn't put the
display_items on the invoice
This commit is contained in:
@ -232,7 +232,7 @@ def validate_stripe_checkout_session(stripe_checkout_session_id):
|
||||
checkout_session = event['data']['object']
|
||||
|
||||
if checkout_session and 'id' in checkout_session and checkout_session['id'] == stripe_checkout_session_id:
|
||||
cents = checkout_session['display_items'][0]['amount']
|
||||
cents = checkout_session['amount_total']
|
||||
dollars = decimal.Decimal(cents)/100
|
||||
|
||||
#consume_payment_session deletes the checkout session row and inserts a payment row
|
||||
@ -274,7 +274,7 @@ def success():
|
||||
# secret=current_app.config['STRIPE_WEBHOOK_SECRET']
|
||||
# )
|
||||
# if event['type'] == 'checkout.session.completed':
|
||||
# dollars = event['data']['object']['display_items'][0]['amount']
|
||||
# dollars = event['data']['object']['amount_total']
|
||||
# stripe_checkout_session_id = event['data']['object']['id']
|
||||
|
||||
# #consume_payment_session deletes the checkout session row and inserts a payment row
|
||||
|
Reference in New Issue
Block a user