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" api_url += "&expand[]=payment_intent.charges" resp = requests.get( api_url, headers={"Authorization": "Bearer " + os.environ['STRIPE_RK']} ) return resp.json()