ember-stripe-elements icon indicating copy to clipboard operation
ember-stripe-elements copied to clipboard

Use official Stripe loader

Open lindyhopchris opened this issue 4 years ago • 4 comments

Stripe now provide an official Stripe loader module: https://github.com/stripe/stripe-js

We should use that to load Stripe.

lindyhopchris avatar Jan 29 '21 18:01 lindyhopchris

@st-h just wanted to check your opinion on this before I implement...

Basically I think we should switch to using the official Stripe loader; always better to use something official imho!

The Stripe loader is an async function... therefore I think when we switch to it, we should change this package so that you always have to explicitly call the Stripe service's load method. That's so the developer is explicilty handling the async nature of loading Stripe, and where they want to do this within their application code.

Personally I think that's better than calling the async Stripe loader behind the scenes.

Do you think that's an acceptable change?

lindyhopchris avatar Feb 15 '21 13:02 lindyhopchris

@lindyhopchris Personally, I think it would be fine to make the consuming app to explicitly load stripe when needed. We are already using it like that in our app through the config param. I think it's common for payment to be only a subset of the features of an ember app and usually there is no need to load stripe unless someone visits a page/route that needs stripe.

If I understand it correctly, the stripe loading wrapper will just replace the custom code to load stripe within this addon? That would be perfectly fine and less code to maintain 👍

st-h avatar Feb 15 '21 13:02 st-h

Great - thanks for the response, we're on exactly the same page! I'll sort it out this week.

Fyi I tagged a 1.0.0 this morning from the master branch. The develop branch has the next major release so once I've taken care of this issue I might tag a 2.0.0-rc.1.

lindyhopchris avatar Feb 15 '21 18:02 lindyhopchris

@lindyhopchris awesome. thanks a bunch 👍

st-h avatar Feb 15 '21 18:02 st-h