You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The lazy option to load Stripe is amazing. Thanks for having that already.
We have a use case where we need to set up the stripe publishable key in runtime instead of having it hardcoded in config/environment.js. (We fetch this information from our API.)
Today I can do that using a hack, but it would be nice to have an official way set stripe configuration at runtime.
Here is the approach I have.
// in beforeModel this.stripe.config.publishableKey='pk_my-new-key';returnthis.stripe.load();
This relies on the fact that the initializer injects the config in the service, so we just override the value.
We also need to set some value in config/environment.js for publishableKey, otherwise, we get an error.
A possible alternative is to have configure method from the service take arguments to be used in the initialization of stripe.
The error from the initializer should be moved to the configure method instead. Currently defined here.
The text was updated successfully, but these errors were encountered:
The lazy option to load Stripe is amazing. Thanks for having that already.
We have a use case where we need to set up the stripe publishable key in runtime instead of having it hardcoded in
config/environment.js
. (We fetch this information from our API.)Today I can do that using a hack, but it would be nice to have an official way set stripe configuration at runtime.
Here is the approach I have.
This relies on the fact that the initializer injects the config in the service, so we just override the value.
We also need to set some value in
config/environment.js
forpublishableKey
, otherwise, we get an error.A possible alternative is to have
configure
method from the service take arguments to be used in the initialization of stripe.The error from the initializer should be moved to the configure method instead. Currently defined here.
The text was updated successfully, but these errors were encountered: