#deaa-3ds-off_session

1 messages ยท Page 1 of 1 (latest)

spark adder
#

hello, can you share the PaymentIntent ID?

pine kraken
#

pi_3JZHBUHUFZQ2qqlk1IV6YPhn

#

this payment method id: pm_1JZHBVHUFZQ2qqlkM6cKo7vm

spark adder
#

well that is expected, for 2 reasons:
you're not creating an off_session PaymentIntent.

1/ That PaymentIntent was not off_session: true
You just specified setup_future_usage: off_session

which says "I want to set this PaymentMethod up for future off session payments"

2/ you used pm_card_threeDSecure2Required test card, this card always requires 3DS authentication regardless of being set up previously or not

#

so the right way to do this is:

#

1/ perform a PaymentIntent with setup_future_usage: off_session
with the pm_card_authenticationRequiredOnSetup card and confirm and authenticate it

#

2/ then create a second PaymentIntent with off_session: true, and pass the PaymentMethod ID from part 1 above. That will no longer require authentication

pine kraken
#

yes i used this "2/ you used pm_card_threeDSecure2Required test card, this card always requires 3DS authentication regardless of being set up previously or not"

spark adder
#

yep I know that is what I was flagging, that you're using the wrong card

pine kraken
#

so the problem from "pm_card_threeDSecure2Required"

#

if i used "pm_card_authenticationRequiredOnSetup " it will work?

#

im using setup_future_usage: offsession

spark adder
#

^that will work

#

the steps I highlighted above

pine kraken
#

when i used pm_card_authenticationRequiredOnSetup or pm_card_threeDSecure2Required not working

#

im using exactly what you said

spark adder
#

can you share examples of 2 PaymentIntents IDs?
1/ the first one where you used pm_card_authenticationRequiredOnSetup ??
2/ the second PaymentIntent where you used the pm_123 from step 1

#

and lets ignore pm_card_threeDSecure2Required completely, as that isn't the right card to test this behavior at all

pine kraken
#

pi_3JZIFmHUFZQ2qqlk0mkAcp1h

#

pm_1JZIFnHUFZQ2qqlkN3mg4ha1

spark adder
#

what about the second PaymentIntent ID?

there are 2 involved here.

The first PaymentIntent will require authentication
The second one will not

pine kraken
#

two is same

#

sorry

#

second one i created it using paymentMethod with stripe csutomer id

spark adder
#

can you share the PaymentIntent ID for that?

#

like there are supposed to be 2 PaymentIntent IDs

#

but you shared one

pine kraken
#

i have only one

#

when i try recharge i will get error

spark adder
#

sorry I think there is a misunderstanding here

#

let me clarify

#

your original question:

Hi, why off-line future payment not working in case 3dsecure , im using payment intent method?

to do this, you need 2 PaymentIntents

The first one to "set up" the pm_card_authenticationRequiredOnSetup card

The second one to skip the authenticaiton

#

your code is making an incorrect request to /v1/sources so that is what the error is there, you don't need to make any /v1/sources requests here at all

pine kraken
#

but id don't know if the user will use 3ds card or not

spark adder
#

so let's take a step back

#

what is the main question here

#

maybe I have misunderstood

#

so I can clarify

pine kraken
#

first i create payment intent with futue setup

#

i will return client payment intent to frontend to use it to pay

#

the customer will pay using this secret_payment_intent_id ,he maybe use 3ds card or not

#

in case he used normal card and i want to recharge again i will not face any issue

#

but if he used 3ds i will get this error No such source: 'pm_1JZIFnHUFZQ2qqlkN3mg4ha1'

spark adder
#

but if he used 3ds i will get this error No such source: 'pm_1JZIFnHUFZQ2qqlkN3mg4ha1'
that is because your code is making a wrong request

#

the /v1/sources request in the screenshot above is wrong and doesn't even need to be made

pine kraken
#

so how to recharge in case 3ds

spark adder
#

first of all, don't make the /v1/sources request, that is not needed at all

#

second ...

#
  • make a new PaymentIntent creation request. Pass the pm_123 PM ID from the PaymentMethod that was created in the first PaymentIntent. Also pass off_session: true. And confirm: true
    and that is it
pine kraken
#

this what i did

spark adder
#

can you share the PaymentIntent ID for that^ request?

pine kraken
#

pi_3JZIFmHUFZQ2qqlk0mkAcp1h

spark adder
#

thanks, looking

#

that code is not the same as this request: https://dashboard.stripe.com/test/logs/req_kUfcJApge04vr1

  amount: "1543",
  currency: "USD",
  customer: "cus_GwCfMw4wMS4PVR",
  setup_future_usage: "off_session",
  statement_descriptor: "onestopparking.com"
}```

that is what you passed in this request, which is not the same as the code you linked earlier
#

that is what I meant earlier that you have not provided me with a request or PaymentIntents that passes off_session: true

pine kraken
#

sorry for late, i was out for urgent thing

#

so what the wrong thing i missed?

harsh ocean
#

๐Ÿ‘‹ @spark adder had to step out so I'm taking over.
We've taken a look at that Payment Intent ID, but we're a bit confused since it's not matching what's in your code. For example, your code has off_session: true, but pi_3JZIFmHUFZQ2qqlk0mkAcp1h doesn't set that at all.

pine kraken
#

this how i create the first paymentintent

#

should be like this?

#

i cant use off_session with setup_future_usage

#

ุŸ

harsh ocean
#

That is correct - setup_future_usage implies that extra steps (like authentication) will be needed so it can't happen off session

#

Just to clarify - are you just trying to test out not needing to provide authentication for a payment method that has already been set up?

pine kraken
#

yes

#

i need to recharge exists Payment Intent with session off

#

this how i try to recharge it

harsh ocean
#

Yup, that should work as long as you're using the correct test card.

pine kraken
#

but its not working

#

i get this error No such source: 'pm_1JZIFnHUFZQ2qqlkN3mg4ha1'

harsh ocean
#

Do you have the request ID that had that error?

pine kraken
#

req_rqU7BHqFlt96a7

harsh ocean
#

Are you sure that request is calling the code you just sent me? That request is creating a Source, not a Payment Intent

pine kraken
#

yes

#

i used this test card "pm_card_threeDSecureRequired"

harsh ocean
#

The code you sent over was creating a PaymentIntent though, so that request must be coming from somewhere else?

pine kraken
#

no, its is

harsh ocean
#

Do you have code that's creating a source in your code base at all?

pine kraken
#

pm_card_threeDSecureRequired

harsh ocean
#

It may be that specific requests was calling the wrong part of your code? I do see more recent requests to create a PaymentIntent that are working - do you have it all sorted out now?

pine kraken
#

you need paymentintent ids?

harsh ocean
#

Let me start over:

  • The code that you've sent over looks correct, where first you create a PaymentIntent with setup_future_usage: off_session and then you use the Payment Method from there to create a NEW payment Intent with off_session: true.
  • You should be using pm_card_authenticationRequiredOnSetup to test this flow. This test card is meant to be used when the card is properly set up for future usage, and then is charge off session at a later time.
  • The request you sent over (req_rqU7BHqFlt96a7) does not match either of the code screenshot you've already sent over. Request req_rqU7BHqFlt96a7 is creating a Source (not a PaymentIntent like in your code screenshots). If you have code that is currently creating Sources then you should remove it, since it's not necessary if you're working with card Payment Methods
pine kraken
#

yes, thanks

#

this from 3ds code from my code

#

thanks alot

#

i will find why it not working, you put me on the right way

harsh ocean
#

๐Ÿ‘ Let us know if you run into more issues!

pine kraken
#

after fixing my code
if i use - pm_card_authenticationRequiredOnSetup , it will work

#

if i used pm_card_threeDSecureRequired , it will not work, and i get "Your card was declined."

harsh ocean
#

That's expected - pm_card_threeDSecureRequired needs 3ds for EVERY payment, and so when you create the follow-up PaymentIntent with off_session: true we're unable to request 3DS and it fails

pine kraken
#

but it was working fine before 2 month at least,

#

or maybe im wrong

harsh ocean
#

Do you have an example of it working before? I would have expected this to never work with off_session: true

pine kraken
#

maybe im wrong, i was tested it before 2 month

#

i will check it, if i found any thing will till you

#

thanks a lot
stripe support is the fast and the best๐Ÿ˜