golevelup / nestjs

A collection of badass modules and utilities to help you level up your NestJS applications 🚀

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Multiple Stripe instances

kohort-jerome opened this issue · comments

Hello and thank you for the amazing work!

Maybe I'm missing something here but in order to use the Stripe test mode I would need to run 2 stripe clients - one with test secret key, one with live secret key - at the same time in my app. Is it possible with this module ?

My use case is: I'm using Stripe connected accounts and my clients need a test mode, so I have a test mode in my prod environment that needs to connect to Stripe test mode. And when clients switch to live mode in my prod environment, I need to connect to Stripe live mode.

I believe you could just have two modules, both providing Stripe Clients with different injection tokens. Import both modules inside of where you need to use Stripe and then inject the Stripe Clients with their respective keys.

For anyone wondering I ended up creating another module called stripe-test with another Stripe Client. I use the stripe-test service as a proxy to my stripe-service and pass it the test client when I need it. Thanks @128keaton for pointing in the right direction.

Hi, I'm trying to do this. When I create two Stripe modules with different controllerPrefix, only the first one is registered, the other controllerPrefix is ignored. Is it possible to have two Stripe implementations with different webhook endpoints?