#gaurav_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/1307996058437160992
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
so you mean "create Payment Method" API.
how are you accepting payments? Checkout Session, Payment Element, something else?
no, we are not using Checkout Session, Payment Element
so how are you collecting the card information from the user?
yes
you send the raw card numbers directly to Stripe?
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.
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
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.
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
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.
ok so what flow you recommend ?
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.
ok, but I don't want customer to come again
I want to trigger 3ds if needed at the time of card addition itself
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.
maybe you mean placing a hold on the card?
no, can we use payment intent or setup intent for this?
for what?
SetupIntent is to save a card for later. PaymentIntent is to charge the card now.
both may or may not trigger 3DS.
to add a paymnent method with 3ds if required
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.
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
and can we create a SetupIntent and charge an amount immediatly ?
no, in this case it would be a PaymentIntent withsetup_future_usageset: https://docs.stripe.com/api/payment_intents/create?lang=go#create_payment_intent-setup_future_usage
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?
correct
ok, so is there any recommended flow?
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.
I want to save a payment method and then make recurring payment
what do you mean by recurring payment? you want to start a Subscription?
yes a Subscription
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.
ok
can we use the Setup Intent to complete 3DS authentication and then immediately initiate the payment with the added payment method
yes you can. but the issue with this the customer might have to do two 3DS flow in a row.
no I want only one 3ds at the time of Setup Intent
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.