#Chris-Checkout

1 messages ยท Page 1 of 1 (latest)

mossy minnow
#

๐Ÿ‘‹ Happy to help

#

Checkout doesn't support within iframe

robust junco
#

So this would require Stripe Custom Elements?

mossy minnow
robust junco
#

What would you recommend for setting up subscriptions?

#

Same thing?

mossy minnow
#

Both Payment Element and Checkout are recommended to support subscription, but Checkout requires direction whereas Payment Element embedded in your website

robust junco
#

Can't I also just redirect to Stripe Checkout outside of the iframe?

mossy minnow
#

Nope, it's not supported

robust junco
#

Even if I use window.open?

mossy minnow
#

Ooops sorry! I misread your question. You can redirect Stripe Checkout outside of iframe with window.open or window.location.href

robust junco
#

Perfect, thank you!

mossy minnow
#

No problem! Happy to help ๐Ÿ™‚

robust junco
#

Is it bad practice to create Checkout Sessions with price_data instead of price?

mossy minnow
#

Either way is fine. There's no bad practice here

robust junco
#

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?

mossy minnow
#

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.