Last active
July 7, 2021 01:09
-
-
Save alecbw/087a9449ff71d7e058f8cded3c1c1a5f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import os | |
def get_stripe_checkout_session(checkout_session_id): | |
api_url = "https://api.stripe.com/v1/checkout/sessions/" | |
api_url += checkout_session_id | |
api_url += "?expand[]=line_items" | |
api_url += "&expand[]=customer" | |
api_url += "&expand[]=total_details.breakdown.discounts.discount" | |
resp = requests.get( | |
api_url, | |
headers={"Authorization": "Bearer " + os.environ['STRIPE_KEY']} | |
) | |
return resp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment