#Iapetus-testcard-3ds
1 messages ยท Page 1 of 1 (latest)
Iapetus-testcard-3ds
Hey @warped crown ! Can you provide a concrete example of a decline with a PaymentIntent id pi_123 and the exact information about how you set up that card first?
@warped crown did you have more details?
The card was created with a SetupIntent using Stripe elements with the provided test card number. Later on, a PaymentIntent was created using that test card with the capture method set to manual along with transfer_data, level3, and return_url fields specified. The payment method ID of the declining card is pm_1MWnlnFAed7s9c7spMnC41Yz.
Would a snippet of my Python code utilizing the Stripe SDK be of use?
Maybe but for now the most important things are
1/ The PaymentIntent id pi_123 for the decline
2/ The SetupIntent id seti_abc for the original set up
I'll have to recreate it to get the SetupIntent ID and PaymentIntent ID, I'll get back to you soon. Thank you!
SetupIntent ID: seti_1Mb7x6FAed7s9c7sYdZJ7DnM
PaymentIntent ID: pi_3Mb7x9FAed7s9c7s2y5bzkcy
Request ID: req_1uhUenRXj3Lx1R
Thank you, let me know if you need anything else.
thanks, looking
that SetupIntent was never used or confirmed. It never "succeeded"
https://dashboard.stripe.com/test/logs/req_5xb4bHZVix4Zlu all you did is create one and that's it
Then the PaymentIntent, you passed a pm_123 suddenly, but I don't understand where that pm_123 came from since it wasn't the SetupIntent
Weird, let me look into this further.
I double-checked the code, and everything seems ok.
Create SetupIntent on backend -> return client secret to frontend -> create Stripe elements instance using the client secret -> create payment element -> confirm payment element to create payment method.
I am unsure why it's not showing the SetupIntent as being confirmed.
๐ stepping in as Koopajah had to step away
๐
Are you trying to take a payment here or set up a future payment via just collecting PaymentMethod?
Trying to setup future payment(s).
Okay so above you said "create PaymentIntent"
Is that a typo?
And should be SetupIntent?
Yes, sorry, it should be SetupIntent.
Gotcha well as noted, that SetupIntent from your example is never confirmed.
Can you run another test after looking at your code?
Or, can you add some logs to your code?
Feel free to share your code snippets as well and I can take a look and we can debug together if that's easier.
But mostly you are going to need to walk through your code and see why no SetupIntent confirm is happening
Understood.
These are a couple snippets from our frontend. In the first snippet, clientSecret is the client_secret from the SetupIntent created on our API. I have confirmed that it is indeed the client secret returned from our API from the created SetupIntent.
this.stripeElements = this.getStripe().elements({
clientSecret: clientSecret,
});
this.paymentElement = this.stripeElements.create('payment');
this.paymentElement.on('change', (event) => {
this.paymentMethodType = event.value.type;
});
this.paymentElement.mount('#payment-element');
The below code is called when a submit button is pressed.
const { error } = await this.getStripe().confirmSetup({
elements: this.stripeElements,
redirect: 'if_required',
confirmParams: {
return_url: window.location.href,
payment_method_data: {
billing_details: {
email: this.paymentMethodType === 'card' ? this.submitData.email : undefined,
},
metadata: {
notes: this.submitData.notes,
},
},
},
});
Okay all that looks fine. Can you add a log right before confirmSetup where you log out the clientSecret and then run another test and let's see what we see there?
It is logged (first part of it is seti_1Mb8W6FAed7s9c7sRAkUdfLE), however the only time we use the clientSecret is when we create this.stripeElements (which is passed into confirmSetup(...))
Yep and that one looks like it was confirmed just fine
So seems like there was some issue with your first test
But that test was fine
(Here is the confirmation request: https://dashboard.stripe.com/test/logs/req_61IcsAghqPDLdx)
I printed out the IDs from the backend and frontend and they're different.
Ah well there you go
Does Stripe Elements create a new SetupIntent?
No
You create the SetupIntent in backend and then use its client secret in frontend to specifically confirm that SetupIntent
So it sounds like you are either incorrectly creating two SetupIntents or caching a client secret somewhere or something like that
I'll look into it more and reply with my findings, thank you