#gaurav_best-practices

1 messages ¡ Page 1 of 1 (latest)

slate mortarBOT
#

👋 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/1307996058437160992

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

astral cedar
#

hi there!

#

we are using the Create a Card API,
what do you mean by this exactly?

magic slate
astral cedar
#

so you mean "create Payment Method" API.

#

how are you accepting payments? Checkout Session, Payment Element, something else?

magic slate
#

no, we are not using Checkout Session, Payment Element

astral cedar
#

so how are you collecting the card information from the user?

magic slate
#

yes

astral cedar
#

you send the raw card numbers directly to Stripe?

magic slate
#

we are PCI compliant

#

yes

astral cedar
#

oh, I see.

#

creating a Payment Method doesn't trigger a card validation, so no 3DS will be trigger at that time. but then if you try to attach the payment method to a customer, or try to charge the customer, then 3DS may happen. it's completely up to the bank. so your intregration should handle 3DS.

magic slate
#

yes currently we are using this, but for non 3ds and payment intent flow for 3ds

#

so now wanted to use payment intent for both 3ds & non 3ds

#

bascially we have a prefence at our end if mercant select non 3ds then we use creating a Payment Method otherwise intent flow

astral cedar
#

I'm not sure I follow. when using PaymentIntent, you may or may not get 3DS, it's completely up to the bank to decide.

#

you should use the same flow for all cards, and then it's up to the bank to ask 3DS or not.

magic slate
#

ok,

#

also for payment method addition flow where no amount collection is required, so what flow we should follow.
I mean customer can login to our app and simply add a payment method in their account which we will be using for future off_session txn

astral cedar
#

you want a save a card for later use, while sending the raw card numbers to Stripe?

#

if so, you would create the Payment Method, then attach it to a customer with a SetupIntent.

magic slate
#

yes

#

and want to avoid 3ds in future

astral cedar
#

that is not possible

#

again, it's completely up to the bank

magic slate
#

ok so what flow you recommend ?

astral cedar
#

the recommendation is that when you make a payment and you get status: requires_action (3DS is requested), you tell your user to come back to your website/app, and re-confirm the PaymentIntent on the frontend so they can complete the 3DS flow.

magic slate
#

ok, but I don't want customer to come again

#

I want to trigger 3ds if needed at the time of card addition itself

astral cedar
#

I want to trigger 3ds if needed at the time of card addition itself
that's not possible

#

ok, but I don't want customer to come again
then you won't be able to charge that customer when 3DS is requested.

magic slate
#

no, I think it's possible

#

people are using this flow

astral cedar
#

maybe you mean placing a hold on the card?

magic slate
#

no, can we use payment intent or setup intent for this?

astral cedar
#

for what?

#

SetupIntent is to save a card for later. PaymentIntent is to charge the card now.

#

both may or may not trigger 3DS.

magic slate
#

to add a paymnent method with 3ds if required

astral cedar
#

yes, if you want to save a PaymentMethod for later use, then use a SetupIntent as explained earlier. And 3DS may or may not be triggered at this point.

magic slate
#

ok,

#

and can we create a SetupIntent and charge an amount immediatly ?

#

like during signup I can collect card details and after 2-3 minutes during subscription purchase, I can charge via saved payment method

astral cedar
magic slate
#

ok,but during signup, I don't know which plan customer will select

#

so I can't create payment intent because I need to provide exact amount right?

astral cedar
#

correct

magic slate
#

ok, so is there any recommended flow?

astral cedar
#

recommendation for what exactly? can you be more clear?

  • if you want to make a one-time payment: PaymentIntent
  • if you want to make a one-time payment while saving the payment method for later: PaymentIntent + setup_future_usage
  • if you want to save a payment method for later without making a payment immediately: SetupIntent
    and in all of these cases, 3DS may or may not be requested by the bank. so that's something your integration needs to handle.
magic slate
#

I want to save a payment method and then make recurring payment

astral cedar
#

what do you mean by recurring payment? you want to start a Subscription?

magic slate
#

yes a Subscription

astral cedar
#

ideally you would directly create the Subscription object with it's price, and then use the PaymentIntent created by the Subscription to charge the customer.

magic slate
#

ok

#

can we use the Setup Intent to complete 3DS authentication and then immediately initiate the payment with the added payment method

astral cedar
#

yes you can. but the issue with this the customer might have to do two 3DS flow in a row.

magic slate
#

no I want only one 3ds at the time of Setup Intent

astral cedar
#

I understand, but like I said many times, it's not up to you or to Stripe. this is up to the bank, so it may happen.