#roger_paymentelement-multiple
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question. Thank you for your patience!
âąď¸ We automatically close idle threads, which makes them read-only. Make sure you stick around to chat in realtime! If this thread is closed and you have another question you'll need to start a new thread.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1214635318003900446
đ Have more to share? You can add more detail below, including code, screenshots, videos, etc.
roger_paymentelement-multiple
@pastel raptor there isn't really a good way to handle something like this. We usually highly discourage having multiple separate and sequential PaymentIntents since banks tend to block quick payments in succession.
We usually recommend accepting one payment for the whole amount
Thanks for the quick response. We want the flexibility to allow a customer to modify/cancel one product. The payment interval of each product maybe different. What is your suggested solution?
Still the first payment you could group them all together and/or have a unified Invoice. That is my suggestion and the best way to do this
Do you have any sample code or which API to call for grouping?
Hello! I'm taking over and catching up...
Are you using Stripe Subscriptions or are you creating Payment Intents directly?
We are using C# SubscriptionService to create subscriptions
After calling Create() we get subscription.LatestInvoice.PaymentIntent and return to frontend
Ah, okay, if you're using Stripe Subscriptions this isn't really possible with multiple Products that have different intervals, since a Stripe Subscription has to have Products that all have the same interval.
The only workaround I can think of is to create a single Payment Intent up front for the entire total, then when that's paid add it to the Customer's balance, then create the Subscriptions. That might not be the best approach, but it might be worth exploring in test mode: https://docs.stripe.com/invoicing/customer/balance
Would those newly created subscriptions in "Incomplete" states? How to confirm them?
No, with the credit balance you should be able to create them and have them automatically paid immediately by that balance, so they would be active.
To add the payment to balance, is it a paymentIntent creation parameter or I need to call another service?
The balance is separate, you increment it by updating the Customer: https://docs.stripe.com/api/customers/update#update_customer-balance
You can add whatever arbitrary balance you want, but for this use case you should take a payment with a Payment Intent first, then update the balance based on the amount paid. It's two separate operations.
After the paymentIntent created, the frontend will not call the backend. I will not be able to know when the payment is confirmed and ready to update the balance
You can listen for the payment_intent.succeeded Event with a Webhook Endpoint.
Let me play with it. Thanks a lot