#ionu_unexpected
1 messages ยท Page 1 of 1 (latest)
๐ 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/1318189398986194954
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
If you provide a return_url during confirmation etc then there'll be redirect_to_url hash in the response that you can use: https://docs.stripe.com/payments/3d-secure/authentication-flow#when-to-use-3d-secure
ok, but why in some cases the use_stripe_sdk type is returned? The code is the same in all situations
Got some example intents?
sure
pi_3QWcwQG5NORjrd4m0XxrKxS4 this comes with : [next_action] => Stripe\StripeObject Object
(
[type] => use_stripe_sdk
[use_stripe_sdk] => Stripe\StripeObject Object
pi_3QWc4RG5NORjrd4m0dMaNzvS this comes with: [next_action] => Stripe\StripeObject Object
(
[redirect_to_url] => Stripe\StripeObject Object
[type] => redirect_to_url
I meant some pi_xxx IDs
pi_3QWcwQG5NORjrd4m0XxrKxS4 - sdk
pi_3QWc4RG5NORjrd4m0dMaNzvS - redirect
I noticed that it the redirect happens always at the second or more attempt with the same card details
It's because the CT has Klarna context too meaning the intent can still be paid via Klarna
The other intent uses a card PM so you can redirect directly for 3DS if you wish (like I linked)
If you're using any non-card PMs then the recommendation is to always use Stripe.js to confirm/redirect. Otherwise you can handle 3DS yourself as the link noted
even if the actual pm is done via cc already ?
The thing is that we already have an integration for credit cards sca on our own page with the "popup" with normal createToken and payment intent in the backend.
I really need to use the backend php to confirm the payment. So stripe.js is not an option for me
I'm not sure what you're asking me. What is you're trying to do exactly? Add non-card PMs without using Stripe.js?
so the only difference is related to klarna
Well, non-card PMs that require redirects yes
I have something like this:
createConfirmationToken in the front end (where payment methods types can be payment_method_types: ['card', 'revolut_pay', 'klarna'],)
With the returned token I do a createPaymentIntent in the backend (php)
Based on the returned object, if there is a next_action related to sca we are going to a page where we do what shows in the screenshot.
But this "popup" works only if the next_action type is use_stripe_sdk. If not, it redirects to stripe.com
So I would need to have this popup in all the "sca" card cases
if possible, of course ๐
Yes, if next_action[type]: 'use_stripe_sdk' then you can't throw it into a custom modal/dialog
the screenshot is in the case of use_stripe_sdk. And my problem is that that is not always the case.
I have pi_3QWdgEG5NORjrd4m0EIRfIVs which has [payment_method_types] => Array
(
[0] => card
[1] => revolut_pay
[2] => klarna
)
and I still get [type] => use_stripe_sdk
I don't understand what the problem is then I'm afraid
But this "popup" works only if the next_action type is use_stripe_sdk. If not, it redirects to stripe.com
You must be using Stripe.js viaconfirmPaymentthen, right?
no, I am using \Stripe\PaymentIntent::create() in php
with the parameters 'confirm' => true, 'confirmation_token' from the stripe.js createConfirmationToken
My problem is that I would like the \Stripe\PaymentIntent::create() to always return "use_stripe_sdk" in the case of sca (klarna obviously will return a redirect url).
Or to understand why sometimes I get the use_stripe_sdk and sometimes I get the redirect_to_url using the same card
I already answered that, no? The two examples you shared are different
ok, but you said that is because of having klarna as a payment method in the one with redirect_to_url, right ? Sorry if I am understanding it wrongly
No, the PI with next_action[redirect_to_url] has a card PM set and when passing return_url that is expected in the 3DS/card scenario as I outlined: https://dashboard.stripe.com/test/logs/req_eCPBApbnGCF3Ce
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
That pm_xxx ID is of type: 'card'
ok, understood, but what about https://dashboard.stripe.com/test/logs/req_2BA51UroSDQ3j5 ?
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Yes I guess it just works differently with Confirmation Tokens
ok, now I think I get it. I am sorry I did not realize it .... The one with confirmation token works with the sdk, but if I send the pm, it gets redirected
so I guess sending the saved pm, will always generate the next_action as redirect_to_url ?
Only if it's a card PM I believe because of the 3DS control
Understood. Thanks for your patience with me ๐
Sure, np
I appreciate the help. Have a nice day
you too!