#Chris-Checkout
1 messages ยท Page 1 of 1 (latest)
So this would require Stripe Custom Elements?
Yes, I'd suggest using Payment Element: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements
Both Payment Element and Checkout are recommended to support subscription, but Checkout requires direction whereas Payment Element embedded in your website
The subscription guide for both are here: https://stripe.com/docs/billing/subscriptions/build-subscriptions
"Low code" tab: Checkout
"Custom code" tab: Payment Element
Can't I also just redirect to Stripe Checkout outside of the iframe?
Nope, it's not supported
Even if I use window.open?
Ooops sorry! I misread your question. You can redirect Stripe Checkout outside of iframe with window.open or window.location.href
Perfect, thank you!
No problem! Happy to help ๐
Is it bad practice to create Checkout Sessions with price_data instead of price?
Either way is fine. There's no bad practice here
Gotcha. I guess a good follow up question would be: are there any best practices for instantiating a price via price_data that facilitates long-term maintainability; especially when you are expecting thousands or tens of thousands of users?
If price_data is used, a new price object will be generated inline with different price ID even though it may refer to the same price plan. You will need to find a way to keep records of these price ID.
If price is used, then the price ID will be the same for all subscriptions using the same price plan.
For tracking purpose, it might be easier with price instead of price_data. For example, if you wish to update the price of a plan, you can just look for pre-generated price ID and update subscription to new price ID.