#ilyeselb

1 messages ยท Page 1 of 1 (latest)

tropic lynxBOT
mossy epoch
#

Could you link the original thread?

unique mantle
#

we didnt talk too much i just asked if it was the cause

#

he said maybe it can cause payment failure

#

i had to disconnect at that time

#

but im searching for a solution , without updating my whole payment flow

#

im creating a setupIntent then subsccription and confirmSetup

mossy epoch
#

We need a lot more details to triage. Do you have any example SetupIntent Id? seti_xxx

unique mantle
#

let me see

#

seti_1NLlsmGyOBDbEOMCyLkIOU9v

#

this intent has failed

#

seti_1NNt3lGyOBDbEOMClqqAo2Eh

#

i just tested with this one now

mossy epoch
#

seti_1NLlsmGyOBDbEOMCyLkIOU9v <- I see it failed but succeeded later

unique mantle
#

seti_1NNt3lGyOBDbEOMClqqAo2Eh can you see this one

mossy epoch
#

That one succeeded

unique mantle
#

seti_1NNt3lGyOBDbEOMClqqAo2Eh ? this one i just received a webhook telling me this Message: invoice payment attempt fails, due either to a declined payment or to the lack of a stored payment method.
Util Data:
id = in_1NLm6MGyOBDbEOMCO8EYp509

#

i just tested with this test card

#

4000000000003220

mossy epoch
#

What event id is that? I don't see any failure on seti_1NNt3lGyOBDbEOMClqqAo2Eh

unique mantle
#

so this is the invoice related to this setup intent

#

i have a webhook for the failed invoice and payment , and it send me this every time i use 3D secure for the payment

tropic lynxBOT
mossy epoch
#

Yes but you should have an event id when you refer to webhook evt_xxx

unique mantle
#

where can i get the id of the webhook

#

i didnt found event hook

#

id

mossy epoch
unique mantle
#

okay

#

i will send it to you in a couple of minutes

#

evt_1NNt4BGyOBDbEOMCXzd8cXXl

#

this the event for the setup intent

#

evt_1NNt4FGyOBDbEOMCPpjHmkN7 this for the subscription that is incomplete due to the error

#

evt_1NNt4FGyOBDbEOMCY64c2KSL and this for the invoice

#

so what do you think the problem is ?

fallow musk
#

Hi! I'm taking over this thread.

#

The first event you shared is for setup_intent.succeeded, so what exactly is the issue?

unique mantle
#

the issue is that the invoice and the subscription are incomplet and i receive a hook telling me
Message: invoice payment attempt fails, due either to a declined payment or to the lack of a stored payment method.

fallow musk
#

So your flow is to:

  1. Create a SetupIntent to collecgt a payment method
  2. Then create a Susbcription witht hat payemnt method
    Is this correct?
unique mantle
#

yess

#

exact

fallow musk
#

Is there a particular reason you are doing this? Because that's a flow we don't recommend doing. Instead you should directly create the Subscription with will directly contain a PaymentIntent or SetupIntent you can use.

unique mantle
#

i think its because we have a coupon input on the checkout page , and we cant update the subcription with the coupon after creating it , so every time we need to create a new subscription if the user put a coupon , and we end up having incomplete subscription remaining

fallow musk
unique mantle
#

yes i saw this method , i have a question about it , when should i save the pm ? i click submit i create the subs before redirrecting

#

but the subscription dosent contain the pm

fallow musk
#

With this link the flow is different:

  1. First mount the Payment Element
  2. Then when the user submits the form: create the subscription and confirm the payment using the client secret of the subscription
unique mantle
#

i will test it now

#

i got this

fallow musk
#

Yes you need to follow exactly the link I shared. First submit and then confirm the payment:

unique mantle
#

event using axios in place of fetch ?

#

can caus eissue

fallow musk
#

No both should work. But just to be safe you could follow the documentation exactly for now.

unique mantle
#

okay

#

okay thanks it worked

fallow musk
#

Happy to help ๐Ÿ™‚