solidusio / solidus_stripe

💳 Integrate Solidus with Stripe
https://stripe.com
BSD 3-Clause "New" or "Revised" License
36 stars 62 forks source link

Consider alternatives to avoid loading Stripe JS on the thank you page #257

Open kennyadsl opened 1 year ago

kennyadsl commented 1 year ago

Desired Behavior

At the moment of writing, we are considering to load the Stripe JS code in the confirm step to be sure that when requested, we can load the 3DSecure page to confirm the order.

We are doing that by using the new payment info partial introduced in https://github.com/solidusio/solidus_starter_frontend/pull/334. But this will render the same partial in the thank you page. We are safe because we are loading the JS conditionally only on the confirm page within that partial, but that's not a practice to encourage: developers could think that the partial is only loaded on the confirm step, and forget about that check, which might have unexpected implications.