#edgar_3ds-question
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/1229810745143857205
๐ 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.
- edgar-soloviev_3ds-just-once, 1 hour ago, 20 messages
- edgar-soloviev_api, 6 days ago, 6 messages
Hi ๐ what test card did you use to test your flow?
Sorry I accidentally specified the wrong top related id. This is the correct 1229780727508504617
Sorry, that isn't a Stripe object ID, nor an ID of a request made to the Stripe API.
Sorry, it's been a busy morning. Can you share the ID of an object from your testing where you saw that behavior?
sub_1P6DA9KGtF9GaoEAfXtJ7N8K
That Payment Method doesn't look like it went through a Setup Intent, but maybe I've overlooked it.
It looks like the Payment Method was created directly here:
https://dashboard.stripe.com/test/logs/req_fl7soP2JmWBdZP
Did you run it through a Setup Intent after that, and can you share the ID of that intent if so?
I created a new subscription.
sub_1P6DwgKGtF9GaoEAGdlRBZj6
seti_1P6DwfKGtF9GaoEAmjB0tpl7
Thank you, taking a closer look
Ok
Hm, I see what you're saying. That Setup Intent was created and completed, though just barely, before the Subscription was created. Something that seems a little off, is that you were able to confirm that Setup Intent server-side without the customer needing to complete a 3DS challenge at that point.
๐ taking over and trying to make sense of the convo. Why would confirming a SetupIntent server-side be a bad thing @icy axle ? Like 3DS is not required for everything all the time
It's for the 3155 test card, so it should require authentication if it wasn't set up previously, right?
Ah gotcha that's the part I was missing. Going to take over and figure it out you're all set!
edgar_3ds-question
I can create a payment intent on this card and 3ds will not be requested as I did before. I want the same behaviour to happen when I make subscriptions.
4000002500003155
This card requires authentication for off-session payments unless you set it up for future payments. After you set it up, off-session payments no longer require authentication.
So as long as you properly set up the card and do 3DS on session client-side, then future off session payments will work.
so now can you share some end to end code about your test so I can help you debug what you're doing wrong?
First, I create a setup intent
$si = $this->stripe->setupIntents->create([
'customer' => $user->customer->stripe_id,
'payment_method' => 'pm_1P6CQbKGtF9GaoEA7Gv6o60Z',
'confirm' => true,
'usage' => 'off_session',
'return_url' => 'http://localhost',
]);
then I create a subscription
$sub = $this->stripe->subscriptions->create([
'customer' => $user->customer->stripe_id,
'items' => [
['price' => $priceId]
]
]);
Okay but that's only a small part of your code really. Like where is the PaymentMethod coming from? Was is attached to the Customer first? What is your overall flow?
Can you try a brand new customer end to end? I want to see all the requests you make but it's tough on a Customer you used a lot already
I'll do it now.
thanks, give me the Customer id once you're done and I'll try to understand the order of requests
I'll create a new customer cus_Pw6v52pX4zjsyR
are you doing this on a completely different Stripe account?
I added card card_1P6EjgAp3opAT5B0vSFXF7vT
this is a Legacy Card card_123. What's going on? That looks like a completely different account and integration pattern from earlier
Yeah, it's a different account. Because it was quicker for me to create everything from the app. The difference is that last time I created the card from the dashboard.
$paymentMethod = $this->client->customers->createSource(
$customer->id,
['source' => $source]
);
so the card is created, the source is handed to me by the client.
Okay I think there's a ton of confusing data here, it's going to be really hard to help without focusing on your real and exact integration path. You're using deprecated APIs already when you use the Create Card API https://docs.stripe.com/api/cards/create, using the Dashboard is not relevant to what you would do in production
It's really tough for me to help you without grasping what your end goal is. But if you are doing that createSource you are using an integration that was deprecated many years ago at this point so it's not completely surprising that the SetupIntent doesn't work
Ultimately, you really shouldn't be doing a SetupIntent at all in that world.
Like your whole integration is quite sub-optimal alread. But if you want to do the least amount of changes you would mostly create the Subscription and then look at pending_setup_intent if any and confirm it client-side if so
What a new path. Do we need to use only stripe.js?
Not really, but you're using APIs that are 5+ years old and not really using a newer integration. Sorry it's tough to help as you shared almost no details about your existing integration right now
I used this resource https://docs.stripe.com/api. I didn't realise it was old information. Could you share a more recent version with me and maybe I won't have any more questions. Or next time we'll have a more substantive conversation?
Ah so you built a brand new integration? It's not a multi-years old integration you were trying to change?
I don't quite understand the question?
But it's not the integration of many years ago
https://docs.stripe.com/billing/subscriptions/build-subscriptions is our canonical integration guide. It will be wildly different from the calls you are making
I see in the documentation that this https://docs.stripe.com/api/sources is deprecated
but it doesn't say that here https://docs.stripe.com/api/cards/create
I didn't use this api
the API works, but it's a bad idea to use it for a new integration
https://docs.stripe.com/api/ - all of this?
of course not, just the specific API method you were referencing
If you are trying to start a new integration to accept recurring payments and want to handle 3DS and other payment methods, then your next step is to carefully read our end to end guide https://docs.stripe.com/billing/subscriptions/build-subscriptions
Don't just browse our API reference to pick API methods randomly
Thank you very much. I'll look into it.
sure thing!
You might want to also just look at our Checkout product and let it handle everything for you! https://docs.stripe.com/billing/quickstart