Skip to content

Instantly share code, notes, and snippets.

@alecbw
Last active July 7, 2021 01:09
Show Gist options
  • Save alecbw/087a9449ff71d7e058f8cded3c1c1a5f to your computer and use it in GitHub Desktop.
Save alecbw/087a9449ff71d7e058f8cded3c1c1a5f to your computer and use it in GitHub Desktop.
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