#RGRTHAT

1 messages ยท Page 1 of 1 (latest)

granite zincBOT
ornate holly
#

๐Ÿ‘‹ happy to help

dawn dune
#

What payment flow do u need to have when you want user to order something, not charge them straight away cuz the order can be canceled by a certain date after order date, but still have the charge pending so that the user will be charged if he doesnt cancel

#

I use connect

#

@ornate holly i use connect, so users can become providers and sell stuff

#

I need user to not be charged, but still be commited if he doesnt cancel by a certain date after order date

ornate holly
#

that might be one way of doing it

#

you can always do refunds

dawn dune
#

it says in the link u sent that "For card payments, the amount is on hold for up to 7 days,"

dawn dune
#

but a customer at my application right now can order delivery 1 month from now

#

maybe i should restrict that u cant order more then 7 days in advance?

#

idk

ornate holly
#

you can collect their payment method ahead of time and place the payment when the delivery is out

dawn dune
#

when user press "order now", i will have to make a payment intent to hold the payment

#

and this only holds 7 days

ornate holly
#

what I'm saying is that once the delivery is sent you can create the PaymentIntent then and collect the money directly

#

in order to do that, you can use SetupIntents to collect the Payment details first

#

and set usage to off_session

#

and once the delivery is ready and shipped you create the PaymentIntent and confirm it on the server-side

#

how am I going to check if delivery is ready?
that's really up to you. maybe your delivery service provider might have a push notification system, or you need to do a cron job

#

Would be nice to have a parameter on paymentIntent where u could specify the date to charge
yes I agree, but unfortunately that's not the case today

dawn dune
#

@ornate holly when user cancel the delivery, i just cancel the payment method right?

#

that way the payment intent is not charged

#
const paymentIntent = await stripe.paymentIntents.cancel('pi_32AkjQ5H4Bas2eAolX13');
ornate holly
#

but if the PaymentIntent was already successful then you have to do a refund in that case

dawn dune
#

When i create the payment intent for future capture at delivery date of product, the user have 7 days to pay. What happens after the 7 days? is the card automatically charged? or is it canceled?

quick yew
#

you're talking about capture_method then, not confirmation_method, they are different things

dawn dune
#

the capture method is manual

quick yew
#

if using capture_method:manual and you do nothing, after 7 days the funds are refunded to the customer

#

during those 7 days the money is 'blocked' on their card, might show as a pending transaction on their bank statement, after that it's cleared and the money is back in their account normally

dawn dune
#

i need to make sure to charge the user right before 7 days then if they dont manually pay

#

@quick yew does this logic seem ok?

quick yew
#

seems ok I think

dawn dune
#

this works for connected accounts right? cuz i use connect

quick yew
#

yes

dawn dune
#

the problem is. It might be many paymentintents with say certain delivery date.

#

then i have to loop through all the paymentintents and capture them

#

@quick yew how can i fetch all the paymentintents that have capture_method manual, and loop through them and capture? add a metadata in the paymentintents with say delivery date? and then fetch all where todays date is that delivery date, loop through paymentintents and capture them?

quick yew
#

that could work yes.

#

we have no way to notify you or send you a webhook or something, so it's something you have to build, you have to know that "I confirmed PaymentIntent pi_123 6 days ago, I need to capture it today", so for example cron jobs could work there. You shouldn't use our API and loop anything, you should be saving the details like the PaymentIntent IDs that you need in your database