diff --git a/README.md b/README.md index 99cdca6..0d37446 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,16 @@ Run the app in gunicorn: pipenv run gunicorn --bind 127.0.0.1:5000 app:app ``` +## how to view the logs on the deployed system + +application logs: + +`journalctl -u capsul-flask --since -1w` + +scheduled task logs: + +`tail -n100 /var/log/capsul-flask.log` + ----- ## cli diff --git a/capsulflask/payment.py b/capsulflask/payment.py index 1ec147f..2f65015 100644 --- a/capsulflask/payment.py +++ b/capsulflask/payment.py @@ -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