#roger_paymentelement-multiple

1 messages ¡ Page 1 of 1 (latest)

cyan pawnBOT
#

👋 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.

compact flumeBOT
sage mango
#

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

compact flumeBOT
pastel raptor
#

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?

sage mango
#

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

pastel raptor
#

Do you have any sample code or which API to call for grouping?

gritty condor
#

Hello! I'm taking over and catching up...

#

Are you using Stripe Subscriptions or are you creating Payment Intents directly?

pastel raptor
#

We are using C# SubscriptionService to create subscriptions

#

After calling Create() we get subscription.LatestInvoice.PaymentIntent and return to frontend

gritty condor
#

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

pastel raptor
#

Would those newly created subscriptions in "Incomplete" states? How to confirm them?

gritty condor
#

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.

pastel raptor
#

To add the payment to balance, is it a paymentIntent creation parameter or I need to call another service?

gritty condor
#

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.

pastel raptor
#

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

gritty condor
#

You can listen for the payment_intent.succeeded Event with a Webhook Endpoint.

pastel raptor
#

Let me play with it. Thanks a lot