#Iapetus-testcard-3ds

1 messages ยท Page 1 of 1 (latest)

trail spokeBOT
copper moat
#

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?

warped crown
#

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?

copper moat
#

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

warped crown
#

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.

copper moat
#

thanks, looking

#

that SetupIntent was never used or confirmed. It never "succeeded"

#

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

warped crown
#

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.

cold kettle
#

๐Ÿ‘‹ stepping in as Koopajah had to step away

warped crown
#

๐Ÿ‘‹

cold kettle
#

Are you trying to take a payment here or set up a future payment via just collecting PaymentMethod?

warped crown
#

Trying to setup future payment(s).

cold kettle
#

Okay so above you said "create PaymentIntent"

#

Is that a typo?

#

And should be SetupIntent?

warped crown
#

Yes, sorry, it should be SetupIntent.

cold kettle
#

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

warped crown
#

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,
            },
        },
    },
});
cold kettle
#

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?

warped crown
#

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(...))

cold kettle
#

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

warped crown
#

I printed out the IDs from the backend and frontend and they're different.

cold kettle
#

Ah well there you go

warped crown
#

Does Stripe Elements create a new SetupIntent?

cold kettle
#

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

warped crown
#

I'll look into it more and reply with my findings, thank you