#s0viet-payment-method-3ds

1 messages · Page 1 of 1 (latest)

obsidian ruin
eternal kindle
#

For the record - user has a list of payment methods and selects them, we just pass payment_method_id to subscripiton

#

And the error is that request url is missing.

obsidian ruin
#

Hey! Can you share the ID of the Subscription or the Payment Method? Thanks

eternal kindle
#

We are in the test environment , would this be ok?

obsidian ruin
#

Yep, of course

eternal kindle
#

pm_1Jx6K4HLVd2NTJNXR0a801sA payment method ID

obsidian ruin
#

Thanks, checking

#

How are you performing 3DS/auth on these payment methods?

eternal kindle
#

What do you mean ?

#

We did not implement anything additional, when you have payment form it is done out of the box by stripe (modal is shown where I can accept or fail the payment)

The case is we have problem when using stored payment method

obsidian ruin
eternal kindle
#

Hm I am not sure if we create payment intent

#

We use stripe.createPaymentMethod to create payment methods that are then connected to the subscription I guess

#

So this payment method is then connected to the customer on stripe, and we display this list to customer. The customer has therefore option to pick one from dropdown and we pass this to the stripe.confrimCardPayment on our client side.

obsidian ruin
#

How are you handling 3DS/auth in this case then? The createPaymentMethod doesn't handle that

eternal kindle
#

on our backend, when the subscription is created (Python) we call stripe.Subscription.create with payment_behavior='default_incomplete'

#

It is working fine if we provide card details right away, I am not sure what do you mean

obsidian ruin
#

Your subscription call will be failing as the payment method requires auth for the off-session payment. It's likely it hasn't been setup correctly

eternal kindle
#

Well so why it works? with that flow, after subscription is created we present payment form for the user. If user picks 3DS card, modal shows where I can complete or fail the payment

#

This is the error we have in modal:

{
  "error": {
    "code": "url_not_found",
    "type": "invalid_request_error",
    "message": "Requested URL not found"
  }
}
obsidian ruin
#

Are you using test cards?

eternal kindle
#

yup

#

4000002760003184

#

nevertheless - let's pause here for a minute and maybe then you can tell how should we then integrate 3ds into our flow?

#

maybe we really miss something and there is just some luck that it works

obsidian ruin
#

Ok, this is expected behaviour with that card:

This card requires authentication on all transactions, regardless of how the card is set up.

eternal kindle
#

Why is that expected

#

It works on our payment method form right?

obsidian ruin
#

That particular cards requires authentication on all transactions. The initial payment on the subscription would require auth

eternal kindle
#

okay I still do not know one thing - how this applies to our flow

#

and how we can adapt it

#

(frontend case)

obsidian ruin
#

With a subscription?

eternal kindle
#

yup

obsidian ruin
#

Can you share the subscription ID or the related Payment Intent ID?

eternal kindle
#

I need 10mins ok?

obsidian ruin
#

Sure!

eternal kindle
#

Hmm I think I got it... once we use confirmCardPayment we then have to check for PaymentIntentResult().status and show 3DS modal, is that right?

obsidian ruin
#

confirmCardPayment will the entire handle the 3DS flow for you, there's no need to check the status

eternal kindle
#

but now it does not handle it when I passed the return_url - why?

#

This is my call right now:

stripeApi.confirmCardPayment(clientSecret, {
      payment_method: paymentMethodId,
      return_url: window.location.href
    }, {handleActions: false}).then(result => {
obsidian ruin
#

The return_url is the URL that the user is returned to after/cancelling the auth flow

#

Can you share the Payment Intent ID please

eternal kindle
#

But it got returned before the modal was shown...

obsidian ruin
#

Then it's likely auth wasn't required

eternal kindle
#

4000002760003184 this card was used.

obsidian ruin
#

Can you share the Payment Intent ID please

eternal kindle
#

I do not use payment intents

#

Please check our flow again

obsidian ruin
#

Your subscription will have an underlying Payment Intent

eternal kindle
#

Ok I know what was wrong, handleActions is false - now I got the previous error

#
{
  "error": {
    "code": "url_not_found",
    "type": "invalid_request_error",
    "message": "Requested URL not found"
  }
}
obsidian ruin
#

You can share the subscription ID too

eternal kindle
#

sub_1Jx9J5HLVd2NTJNXwbe5G6tB

#
amount: 30000
automatic_payment_methods: null
canceled_at: null
cancellation_reason: null
capture_method: "automatic"
client_secret: "pi_3Jx9N7HLVd2NTJNX0hJ4tNy8_secret_AVD10SqZVUnzTFucig58XPHIf"
confirmation_method: "automatic"
created: 1637237145
currency: "usd"
description: "Subscription creation"
id: "pi_3Jx9N7HLVd2NTJNX0hJ4tNy8"
last_payment_error: null
livemode: false
next_action: {type: "use_stripe_sdk", use_stripe_sdk: {type: "three_d_secure_redirect",…}}
type: "use_stripe_sdk"
use_stripe_sdk: {type: "three_d_secure_redirect",…}
source: "src_1Jx9NJHLVd2NTJNXRcoj5rlf"
stripe_js: "https://hooks.stripe.com/redirect/authenticate/src_1Jx9NJHLVd2NTJNXRcoj5rlf?client_secret=src_client_secret_4TlcZ00kchnKCyF1wKdLHceA&source_redirect_slug=test_YWNjdF8xSmN0SlZITFZkMk5USk5YLF9LY085bVgyOWZRT3VGcHNZaDYweUxrVjNvQWd1WGY40100jceXIt6U"
type: "three_d_secure_redirect"
object: "payment_intent"
payment_method: "pm_1Jx9NIHLVd2NTJNXJJOWqRTR"
payment_method_types: ["card"]
receipt_email: null
setup_future_usage: "off_session"
shipping: null
source: null
status: "requires_action"

This is what I got after hitting confirmCardPayment

#

(these are just test variables so its ok to show the secrets here I guess)

#

Funny thing is that If I Copy the link from the iframe it works.....

deep bane
#

@eternal kindle jumping in for ynnoj here -- making sure I'm caught up: right now you're calling confirmCardPayment on the front end, and are you seeing the 3DS flow or not seeing it at all?

eternal kindle
#

Seeing with error

#

This is the 3DS iframe content. If I pick the link from the iframe and open it in the new tab, 3ds shows properly

deep bane
#

OK, and is there anything else in the browser's console or network tab that shows an error? Maybe CORS for example?

eternal kindle
#

hmm I saw a lot google pay issues - let me try again and confirm

#
#

and in fact - it is not being found.

#

Oh I found it out I think. Give me 3 minutes.

#

This is Ghostery plugin that is replacing merchant in your iFrame. I am really sorry for taking your time that much, I didn't know it also overrides data in Stripe. Therefore, I have checked and everything works perfectly.