#yogesh_api

1 messages ¡ Page 1 of 1 (latest)

dire sentinelBOT
#

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

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

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

pale yacht
#

Hi, let me help you with this.

#

Could you please share the request with requires_action?

tidal lily
#

Sure, here you go req_jqlT20ySucvYPU

pale yacht
dire sentinelBOT
tidal lily
#

okay, let me try this

quiet pulsar
#

hi! I'm taking over this thread. let me know if you have other questions!

tidal lily
#

Hey, tried with suggested payment method. Still got the same error
req_ERcQqmORwdbh4i

quiet pulsar
#

in your request you set off_session: true. this means that the customer is not currently present.
but you used a test card that reuquires 3DS (4000000000003220). since the customer is not there to do the 3DS flow, the payment fails.
if you want to get a requires_action status, then you need to set off_session: false (or not set it at all, since off is the default value)

tidal lily
#

Make sense, let me change and try again

#

OMG, it actually worked. But why did it worked for 3DS card attached without stripe link.

#

it should not work for this request also req_jqlT20ySucvYPU

quiet pulsar
#

which test card did you use in that request?

tidal lily
#

4000002760003184

quiet pulsar
#

hum... not sure. but I wouldn't worry to much about this. these are just test cards.

dire sentinelBOT
tidal lily
#

sure, I'll keep an eye in live mode for this.
I think we can conclude that off_session: false is the solution for now.

whole halo
#

You used the 3814 card to attempt invoice payment and that card always requires auth

tidal lily
#

Yes, when we use 3814 card we always get requires_action status.

But when the same card 3814 is used with stripe link https://docs.stripe.com/payments/link it returns requires_payment_method

whole halo
#

Sorry you'd need to provide some examples of what you're describing. In any case the /pay endpoint cannot gracefully handle 3DS/auth requests so will always be a fail regardless of on/off session

#

Not like PI confirmation which will succeed, but transition the intent to requires_action

tidal lily
#

Okay let's describe this very simply
When creating an Invoice and calling /pay endpoint with a 3814 card. How that card is attached to the customer changes the response of payment_intent status

pm_1QmXpqHz4yo2lH7mJ12I71e3 - requires_action standalone card

pm_1QmBWWHz4yo2lH7mCII6fE5f - requires_payment_method card attached with Stripe link

whole halo
#

Those aren't Invoice examples

#

I need a in_xxx or pi_xxx ID

tidal lily
#

pi_3QmWf3Hz4yo2lH7m13URJ7kf - failed with requires_payment_method
pi_3QmXqZHz4yo2lH7m13x2cMkg - failed with requires_action

#

both the payment_intent is using the same 3184 card

whole halo
#

As I said, the /pay endpoint shouldn't be used in 3DS/auth scenarios really

tidal lily
#

Okay, then what should be used?

whole halo
#

You'd confirm the PI generated by the invoice

tidal lily
#

Hmm, according to doc I've to send pi to client and confirm it everytime.
But we would like to avoid this as we already save the payment method for future off session mode.

So we directly charge users without loading client side SDK. And only initiate stripe if action is required.

I'll check this out.

whole halo
#

Well then use the server-side confirm endpoint if your user is off-session

tidal lily
#

Ohh So I need to call payment_intent /confirm instead of Invoice /pay

whole halo
#

Yes

#

Don't use /pay as a rule of thumb. Maybe only if you're paying an invoice out-of-band or something. It has quirky behaviour with 3DS/auth (as you can see) so it's best to just avoid it

tidal lily
#

Understood, okay so once payment_intent is succeeded after confirmation. Will the invoice status change to paid automatically?

whole halo
#

Yep!

tidal lily
#

Excellent! I'll make those changes then.