Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Publishable Keys #39

Closed
Paskalouis opened this issue Jul 26, 2018 · 5 comments
Closed

Multiple Publishable Keys #39

Paskalouis opened this issue Jul 26, 2018 · 5 comments

Comments

@Paskalouis
Copy link

Hi,

I am currently having the condition where the publishable key can be different because there are conditions that may change the Stripe Account, which means setting different publishable key.
I see that we can only set one publishable key on environment.js , and if I don't set anything there, my application went error.
image

I am thinking that will there will be support for setting up publishable key 'later', not in environment.js, but when I want / need to.

Thank you

@ghedamat
Copy link

@Paskalouis just ran into this myself today

didn't have time to think about a PR yet but my current solution is to implement my own stripe service and override the publishableKey property

not super elegand but does the trick until this is addressed

@danwenzel
Copy link

@Paskalouis - We had a similar need, and got around this by manually setting the stripe service's config.publishableKey right before loading. As long as you lazy load and don't need to change the key afterwards, it should work:

this.stripev3.set('config.publishableKey', key);
return this.stripev3.load();

@lindyhopchris
Copy link
Contributor

#59 has added the ability to provide the publishable key when calling stripev3.load().

Do people have a requirement though to toggle the publishable key... i.e. to change it after it has already been set? If so, do you know if this works with Stripe?

@Paskalouis
Copy link
Author

@danwenzel @lindyhopchris
Hi, nice solution you got there.

Yes, in some cases, people may need to toggle the publishable key.
I have the condition from this issue, where in my business problem needs to have 2 or more stripe accounts to handle, based on specific set of conditions, so I need to change it based on those conditions.
However it is already solved, so I will close this issue.

Thank you !

@st-h
Copy link
Contributor

st-h commented Aug 12, 2019

just noticed I forgot to add another way to work around this here: I am building the ember app with a unique placeholder as the stripe key. When deploying the app, this placeholder gets replaced (via a sed command) with the actual stripe key. That way we can deploy the same artifact using different configs e.g. for test and prod

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants