richnologies / ngx-stripe

Angular 6+ wrapper for StripeJS
MIT License
219 stars 77 forks source link

Feature Request - Able to change the key #8

Closed einewton closed 6 years ago

einewton commented 7 years ago

Hi @richnologies

In my application there are many key's I use for my customers, but wanted to see if it exists or plans to add a way to change the Publishable key ?

Thanks again for all of your work on this!

richnologies commented 7 years ago

This feature was not on my use case, but I think it could be a nice one to have.

Any suggestions on how would you like to use it? I mean, you will need to have more than one instance of the stripe object with different keys at the same time?

Would you be willing to help me test this feature?

einewton commented 7 years ago

I'll help test out the feature for sure!

Not more than one instance, but maybe a changeKey() method would be good..

That way if people want to toggle between the sandbox Publishable key and production they could easily call changeKey()

In my instance, I have a list of stripe keys in my database. One key for each customer, and depending on who they are logged in as, I will need to load that company key.

Thanks so much!

daco commented 6 years ago

Thanks for this module! Apart from the above, it would be nice if you could change the stripeAccount as well.

Thanks

crebuh commented 6 years ago

Would be awesome to be able to change the key on the fly. For example in our system we have 3 environments. So it would be very helpful to just inject the key depending on the environment

nukec commented 6 years ago

so this was implemented here i see: https://github.com/richnologies/ngx-stripe/commit/c4a024c22273eda692b1625d66ed0363f8196885#diff-c2fcf5ff167f1c7f3a0ce2cf388a6d27R55

@richnologies did you push this to npm?

robermorales commented 6 years ago

I also saw the changeKey method, but after getting an error I searched and found this issue.

Definitely I think @richnologies miss to push the package into npm.

Any plan to do it?

richnologies commented 6 years ago

Hi everyone, sorry for the delay, take a look at the StripeFactory in the readme, and tell me if it solves your case

robermorales commented 6 years ago

thanks!