Stripe Integration
# support
b
In our flow when user register - we ask him to provide a credit card credentials - which then will be saved in stripe. The problem is to do that we have to create customer & setup intent. As I understood, making that on front-end only is bad solution. I seen a stripe bot example: https://github.com/medplum/medplum/tree/main/examples/medplum-demo-bots/src/stripe-bots But that's just handling of webhooks. What is usually done in such case: 1. FE - make request to BE to get SetupIntent 2. BE - creates a customer in Stripe and SetupIntent for that customer, and returns to FE SetupIntent keys. 3. FE - ask customer for credit card - and send that data to Stripe. So my question is how to properly implement part 1 & 2? In my understanding I see 2 ways: a) FE makes calls to bots directly via URL b) We implement some custom BE for this, but then the question is how to properly authenticate those users?
r
hi @bohdansarvadi ! We have a feature to "Run a Bot as user", that would scope the Bot'ss permissions only to user who executed to Bot, wich would enable solution A that you describe
However, I'm not sure the Bot itself knows which user / profile invoked it. This should be a pretty easy change to make - I'll file a ticket
166 Views