#eapollo-subs-manualconfirm
1 messages ยท Page 1 of 1 (latest)
๐ Let me just check one thing really quick, but I'm pretty sure you should be able to do this with Subscriptions - what specific wasn't working for you?
Hey @left kelp !
Thanks for getting back to me so quickly.
The issue with this flow is that Subscription creates a payment intent with a confirmation_method of automatic and for me to perform stripe.handleCardAction on the client the confirmation_method has to be manual
We want to continue to charge the card on the server, so we don't want to use stripe.confirmPayment
So the docs for one-time charges was perfect for our needs but doesn't seem to work for subscriptions
Dang - I thought we supported this but looks like we don't and I don't think there's any way around it for Subscriptions
The closest you could get is using this flow: https://stripe.com/docs/payments/finalize-payments-on-the-server?type=subscription
But in the event that next actions are needed (like for 3ds) you'd still be completing payment clientside
eapollo-subs-manualconfirm
Thanks for looking into this!
I wonder if maybe we can do a one-time charge first and use that payment_method of that charge to start a subscription? Haven't tried it yet but wondering what your thoughts are?
Is there also maybe a way to perform some business logic after payment was confirmed without using webhooks?
The reason we perform charges on the server is because we need a way to perform business logic on the server before a charge happens and after a charge happens successfully and if something was to fail at any point, our endpoint would return the correct error which I dont think can be done with webhooks
So the charge kind of needs to get sandwiched in between somehow
Or at the minimum perform business logic on the server the moment confirmPayment is successful without using webhooks. Seems like Stripe does not recommend waiting for the promise to finish and calling an endpoint because user can close client and such so its recommended to use a webhook
You technically could do a one-time charge first and after success you could create the Subscription on a trial period until it's next renewal time
But really the best thing to do would be to switch over to using webhooks - can you elaborate on this a bit more:
our endpoint would return the correct error which I dont think can be done with webhooks
Since right now we make the charge on the backend, lets say our frontend calls the /chargeCard endpoint, and maybe something fails like updating the database, so then we are able to get the error that is returned by that endpoint and display it on the frontend
Not sure if the error handling is possible like this with webhooks?
You wouldn't want to display that kind of error on the frontend though - that's a purely internal error that you wouln't want to display to your customer, right?
That's a good point ๐ฌ Thanks Karbi!