tRPC with stripe
Does anyone have a setup with t3-stack using tRPC and can link a repo? I would like to see call to stripe and also how you connected the webhook for listening.
2 Replies
Stripe is just an API, call it as you normally would in any other app
If you want to make it pretty, put your stripe connection in your trpc context
You can initiate a Stripe payment from a tRPC procedure, or call a Stripe API, and you can do that from any part of your backend code.
The webhook on the other hand, is a specific format over a REST API. You won't be able to listen to Stripe events/callbacks with a simple tRPC procedure. It's just not meant for that. Even with middleware, etc, I would not recomend to try to setup a tRPC procedure for that...