#sergioprimes_best-practices
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.
âąď¸ 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/1396923862670639259
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
So if I understand your question correctly, you want to hold off charging a renter until there has been an exchange? But once the exchange happens you charge the card?
That's exactly it. But only for the first subscription payment.
And in case I don't receive confirmation from both in X time (p.e: 2 days) or one of them cancels, I want to be able to refund the money to the payer.
this would be managed in my backend
I know I can receive the payment as a platform instead of using default stripe connect comission system, and this way I can decide what to do at any moment with the money... but I would prefer to NOT manage myself the comissions.
Hello
Taking over here as my colleague needs to step away
One option I can think of is by utilizing webhook events,
1/ You create a webhook endpoint listening to various events, but mainly for this usecase, you listen to invoice.created events
2/ Then you create a Subscription
3/ You'd receive a invoice.created event when this Subscription generates the first invoice
4/ You'd call the Update Invoice API and set auto_advance to false - https://docs.stripe.com/api/invoices/update?api-version=2025-06-30.preview&rds=1#update_invoice-auto_advance
This prevents Stripe from automatically finalizing the invoice and charging the customer. Then you can wait for the key exchange to happen. Once that's done, you can call the API and finalize the invoice - https://docs.stripe.com/api/invoices/finalize?api-version=2025-06-30.preview&rds=1
Which should then charge the customer (~after 1 hour of finalization)
Interesting... and with this flow the requester will have already put all the credit card details & pressed "pay", but in reality the charge will still be waiting for my approval, right?
Does this case also work for, imagine, if the payer does not have money in his account? I don't want to proceed with the physical exchange if in reality the payer didn't had any money
Interesting... and with this flow the requester will have already put all the credit card details & pressed "pay", but in reality the charge will still be waiting for my approval, right?
Correct
Does this case also work for, imagine, if the payer does not have money in his account? I don't want to proceed with the physical exchange if in reality the payer didn't had any money
Unfortunately, We can't tell if the payer has the funds necessarily unless we authorize/charge the payment method..
If latter is what you want then you could try a different flow where the first payment occurs "outside" the Subscription flow. For example:
1/ You save customer's payment method
2/ You then place a hold for the first payment amount - https://docs.stripe.com/payments/place-a-hold-on-a-payment-method
3/ Wait for key exchange
4/ Once the key exchange occurs, you capture that "hold" as described in the doc above
5/ Then you "credit" the customer the amount for the first payment - https://docs.stripe.com/invoicing/customer/balance
6/ After that, you create a Subscription.
7/ The first invoice of the Subscription will be automatically paid using the amount in customer's credit balance
8/ When the subscription cycles, we'll charge the saved payment method for subsequent payments
Okay, I think that's what I'll have to do... thanks for the help!