#sudhanshu-3ds-test
1 messages · Page 1 of 1 (latest)
Hello @jade quarry ! I'm happy to try adn help but I'm going to need a lot more information and context beyond this one short sentence
sure
so first we are creating a user and then adding a payment method to that user and then allowing the user to slelect any of the payment methods and proceed with payments but when we are using test cards for authentication we are getting 'your card was declined'
Which exact test card are you using? How did you collect and attach it? Which exact end to end doc are you using?
sudhanshu-3ds-test
I'm sorry I ask multiple separate questions. Please try and provide all information at once to be clear about the overall issue so that I can help you!
so we are using react native sdk to collect payments
👋 stepping in here as koopajah needed to step away
Can you provide me a PaymentIntent ID that you tested with?
pi_3NezIxHBzVLseUqK11CZeprj
and could you please provide us any proper documentation from which we can initiate 3d secure?
we are not able to add this feature
The React Native SDK handles this all for you assuming you are integrated correctly. Let me take a look at what you are doing based on the PI above, one sec.
yes please , we are using php for backend
Ah okay actually you are just using the 3220 card and attempting to charge it off session. That specific card will require 3DS every time regardless of how it was set up. I can see that you are correctly setting up PaymentMethods using a SetupIntent so in this case you should test with the 4000002500003155 card
That said, is your flow going to charge immediately or charge later on with regards to when you actually collect these payment methods?
not immediately , we are asking user to select from one of the payment method then we are generating the payment intent based on payment method selected by user
and if we integrate this will it ask every cards for authentication?
Ah okay so the customer is still within the flow when you are doing this though?
Okay so yeah what you really want to do here is handle the confirm yourself after collecting the PaymentMethod but you don't want to use a SetupIntent at all. You do this by using customFlow: true like we discuss here: https://stripe.com/docs/payments/accept-a-payment?platform=react-native&ui=payment-sheet#react-native-flowcontroller
what exactly it will do?
actually we are facing an issue where lot of fraud payments are happening , so we wanted to make sure that the card owner should authenticate every single transaction and if that is not authenticated the transaction should not happen
will this solution help me to achieve the goal?
Yes if you want to force 3DS then you can pass payment_method_options.request_three_d_secure: 'any' when you create the PaymentIntent
we have already tried this but nothing happened i just confirmed from my Front end team
'amount' => ($data['amount']+ 3) * 100 + ($data['amount']*100)*0.03,
'currency' => 'usd',
'customer' => $customer,
'payment_method' => $data['payment_method_id'],
'off_session' => true,
'confirm' => true, this is how i am creating the payment intent no w where i am suppose to add the request for 3d secure?
Yeah in that example you are passing off_session => true
This means the customer isn't there
So they can't complete 3DS
If the customer is going to be present each time then you should not pass off_session => true
and confirm => true?
That is dependent on whether you are going to confirm server-side or client-side.
okay
If you pass confirm => true and request_three_d_secure => 'any' then the PaymentIntent is going to move to requires_action
At which point you will need to handle 3DS on the client
So really I would just not confirm on the server and instead just create the PI and pass the client secret to the client and then confirm there
'amount' => ($data['amount']+ 3) * 100 + ($data['amount']*100)*0.03,
'currency' => 'usd',
'customer' => $customer,
'payment_method' => $data['payment_method_id'],
'confirm' => true,
'request_three_d_secure'=> 'any',
is this okay?
Personally I'd remove confirm => true
okay after that it will ask client to authenticatre if i send the PI and client secrete?
Yep you would use confirmPayment() on the client
Sorry wait a second
We are getting mixed up here.
You said this is when you are collecting a PaymentMethod
yes we are collecting the payment method for first time , now it depend on user which exact payment method he/she chose the new one or already added one
Okay so you aren't going to have a PaymentMethod at all yet and you don't need to worry about that. You just create a PaymentIntent like: ```'amount' => ($data['amount']+ 3) * 100 + ($data['amount']100)0.03,
'currency' => 'usd',
'customer' => $customer,
'request_three_d_secure'=> 'any',
and then i have to return the payment intent and client secrete to frontend right?
where they can use the confirmPayment() method?
Yeah sorry was grabbing the docs. You want this flow: https://stripe.com/docs/payments/save-during-payment?platform=react-native&ui=payment-sheet and you want to use the customFlow (https://stripe.com/docs/payments/save-during-payment?platform=react-native&ui=payment-sheet#react-native-flowcontroller) so that you know what PaymentMethod was selected before you actually confirm.
Yep
exactly we want to know which payment method is selected
Ignore the confirmPayment() part
by the user
okay
You won't use that since you are using PaymentSheet
okay
As long as you select customFlow: truethen when const { error, paymentOption } = await presentPaymentSheet(); resolves you will know the PaymentMethod based on paymentOption
so i have to keep the payment method part while creating the payment intent right?
After that you use const { error } = await confirmPaymentSheetPayment();
'amount' => ($data['amount']+ 3) * 100 + ($data['amount']*100)*0.03,
'currency' => 'usd',
'customer' => $customer,
'payment_method' => $data['payment_method_id'];
'request_three_d_secure'=> 'any',
this will be my create payment intent?
No you won't have the PaymentMethod ID
Because you are handling all of this client side.
The PaymentSheet will show the saved PaymentMethods for you.
no we are not using that payment sheet
we have our own
custom payment sheet were we are showing all of the cards(payment methods) which are added
by the user
The initial example you provided (pi_3NezIxHBzVLseUqK11CZeprj) did use a PaymentMethod that was created via Payment Sheet (https://dashboard.stripe.com/test/logs/req_nhLVTQw7rFhlKx)
So I'm confused.
okay i will explain
the payment sheet opens and user create new payment method or edit the existing one
then we close that sheet and show all the payment methods on out custom screen
from that screen user select a particular card( which has a payment method)
now we use that payment method to initiate the poyment intent
now what should we do next to authorize the payment since we are going to use request_three_d_secure = any now as an argument
forget about the previous PI which i sent
Okay you are going to run into issues with this flow where the Customer has to complete 3DS twice in a row. For instance, they will oftentimes be required to complete 3DS when you save the new card. Then if they attempt to pay with that card immediately and you force 3DS then they will have to complete it again.
is there any possible way to use this flow only and integrate 3d?
because this is how our flow is
what if we are okay with authenticating user twice?
okay if we authenticate user while adding the card only , then is it okay if we dont ask user to authenticate while payment?
or will it ask to authenticate again?
then i have to send the 'payment_method' => $data['payment_method_id'] in paymentintent creation and send the payment intent id and client secrete back to client side for authentication , is this okay?
Yeah if you are going to go the route you are suggesting right now i would basically just not pass request_three_d_secure: 'any' if the customer selects the card they just added. Otherwise, if they select a previously added payment method then you can pass that param to force 3DS.
Yes that's correct. You pass the PaymentMethod ID and confirm => true
Just omit off_session => true
So that the PaymentIntent then moves to requires_action and you can then handle 3DS on your client via confirmPayment()
incase if i pass request_three_d_secure: 'any' it will ask the user again to authenticate right?
Yes
okay got it thankyou so much for helping out one more question how to keep this conversation pinned ? just by pinning this thread?