habulaj commited on
Commit
5f6ca89
·
verified ·
1 Parent(s): 656df66

Update routes/subscription.py

Browse files
Files changed (1) hide show
  1. routes/subscription.py +13 -0
routes/subscription.py CHANGED
@@ -915,6 +915,19 @@ def create_checkout_session(
915
  "price_id": price_id
916
  }
917
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
918
 
919
  return {
920
  "message": "Subscription session created successfully!",
 
915
  "price_id": price_id
916
  }
917
  )
918
+
919
+ # Also add metadata to the payment intent
920
+ payment_intent = subscription.latest_invoice.payment_intent
921
+ stripe.PaymentIntent.modify(
922
+ payment_intent.id,
923
+ metadata={
924
+ "stylist_id": stylist_id,
925
+ "stylist_stripe_id": stylist_stripe_id,
926
+ "user_id": user_id,
927
+ "user_stripe_id": user_stripe_id,
928
+ "price_id": price_id
929
+ }
930
+ )
931
 
932
  return {
933
  "message": "Subscription session created successfully!",