#s0viet-payment-method-3ds
1 messages · Page 1 of 1 (latest)
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.
Hey! Can you share the ID of the Subscription or the Payment Method? Thanks
We are in the test environment , would this be ok?
Yep, of course
pm_1Jx6K4HLVd2NTJNXR0a801sA payment method ID
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
When creating the initial one-time Payment Intent, did you use the setup_future_usage parameter? https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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.
How are you handling 3DS/auth in this case then? The createPaymentMethod doesn't handle that
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
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
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"
}
}
Are you using test cards?
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
Ok, this is expected behaviour with that card:
This card requires authentication on all transactions, regardless of how the card is set up.
That particular cards requires authentication on all transactions. The initial payment on the subscription would require auth
okay I still do not know one thing - how this applies to our flow
and how we can adapt it
basically we are trying to apply this flow:
https://stripe.com/docs/payments/3d-secure#confirm-payment-intent
(frontend case)
With a subscription?
yup
Can you share the subscription ID or the related Payment Intent ID?
I need 10mins ok?
Sure!
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?
confirmCardPayment will the entire handle the 3DS flow for you, there's no need to check the status
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 => {
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
But it got returned before the modal was shown...
Then it's likely auth wasn't required
4000002760003184 this card was used.
Can you share the Payment Intent ID please
Your subscription will have an underlying Payment Intent
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"
}
}
You can share the subscription ID too
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.....
@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?
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
OK, and is there anything else in the browser's console or network tab that shows an error? Maybe CORS for example?
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.