#raimund_api

1 messages ¡ Page 1 of 1 (latest)

digital marshBOT
#

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

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 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/1291858249317875845

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

lost zodiac
#

Hi, can you speak more to your business use case so I can provide a thorough answer?

deft drift
#

You guys call us a platform. Our customers pay in funds which we distribute to recipients. So far, the customers have to keep track of their funds and top them up themselves when their balances run low. We want to implement an autotopup feature which will bill them every week. The amount to top up varies based on the projected expenses over the next 7 days. Everything is running via custom connected accounts.

#

We handle the existing "manual" topups via the PaymentIntent API.

#

But since that always requires an explicit confirmation (please correct me if I'm wrong), I'm wondering which API object to use for this automatic billing feature. From what I read, the Invoice object seems the right approach. Or am I wrong?

lost zodiac
#

'So far, the customers have to keep track of their funds and top them up themselves when their balances run low.' Is the customer here the end customer who are paying you, and you're sending funds to your Connected Accounts? When you say top-up, your end customer are paying you so you can then transfer those funds to the connected accounts who are providing this service?

deft drift
#

Yup, that's how it works. We keep separate balances for each customer, but as far as you are concerned, it's all in our single account.

lost zodiac
#

In this case, I think using SetupIntent, https://docs.stripe.com/payments/save-and-reuse to save payment methods for future payments is the better approach. You can collect their card details for instance, and then create the PaymentIntent on the server side each month: https://docs.stripe.com/payments/finalize-payments-on-the-server?platform=web&type=setup#charge-saved-payment-method and confirm server side.

Subscirptions is a bit different, https://docs.stripe.com/billing/subscriptions/overview. It works for business use cases where the amount if the same each moth. This automates monthly billing for you.

#

You could also use invoicing, https://docs.stripe.com/invoicing but the above use case seems more fitting to our server side confirmation payment intent after you collect the payment method details first.

deft drift
#

OK, SetupIntent it is then. Thank you. I already came across that thing in another context, but didn't quite get the idea.

lost zodiac
#

Happy to help!

#

const paymentIntent = await stripe.paymentIntents.create({ amount: 1099, currency: 'usd', customer: '{{CUSTOMER_ID}}', payment_method: '{{PAYMENT_METHOD_ID}}', return_url: 'https://example.com/order/123/complete', off_session: true, confirm: true, });

#

This way, you can pass the payment method collected and then confirm the payment intent on the server side.

deft drift
#

Since our customers have already got payment methods, how do we register SetupIntents for these?

lost zodiac
#

If you've used setup_future_usage: 'off_session', parameter when you created the payment intent, you should be good to go: https://docs.stripe.com/payments/save-during-payment. You can just pass the pm_ id and the customer if when you create the payment intent.

#

If not, you would need to recollect the payment method details.

#

@deft drift let me know if you have any follow up questions here.

deft drift
#

Recollecting the payment methods is funny, but I guess we could do that.

lost zodiac
#

As a consumer, if my card was used without my consent for future payments, I would dispute it right away.

deft drift
#

Of course.

lost zodiac
#

The above flag ensures that we get their permission to charge later

deft drift
#

Makes sense.

#

Thanks.

#

I think that's it for now.