#harshitbhargava

1 messages ยท Page 1 of 1 (latest)

runic marshBOT
sudden vector
wild jewel
#

How can you please give m reference through code

sudden vector
#

It'll just simply be:

const result = await stripe.confirmSetup({
      elements,
      redirect: 'if_required',
      confirmParams: {
        return_url: window.location.href,
      },
    });

You can find payment_method in the result param

wild jewel
#

result.payment_method

#

Will wirk?

sudden vector
#

Have you given it a try?

wild jewel
#

Yes but it is not giving me any response

sudden vector
#

Can you share the setup intent ID (seti_xxx)?

wild jewel
sudden vector
#

Can you copy and paste the ID here instead of the screenshot?

wild jewel
#

Give me one minute

sudden vector
#

When you console log the result, what does the response look like?

wild jewel
#

seti_1NVpyZInbsls4AaoBQuxnEyO

#

Actually we are not getting any thing

sudden vector
#

Can you share your code?

wild jewel
#

In the docs it is written when there is any error then it will print, so thats why i am confused

sudden vector
#

Can you share your code?

#

It's likely that your code didn't retrieve the correct parameter

wild jewel
#

I am using th same cide what you have sent

sudden vector
#

Please share your code as there can be other reasons. Mine is just partial example

wild jewel
#

But you are finding the payment method id through setupIntentId , hiw we can find through confirmSetup function itself?

sudden vector
#

The response should be what you recevied from confirmSetup

wild jewel
#

Ok

#

Will check and get back to you

runic marshBOT
shell swan
#

๐Ÿ‘‹ how may I help?

wild jewel
#

const addPaymentMethod = async (e) => {

e.preventDefault();

if (!stripe || !elements) {

  return;

}

const result = stripe.confirmSetup({

  elements,

  confirmParams: {

    return_url: window.location.href,

  },

});

console.log(result);

};

#

This is th code

#

And i am not able to find payment method id

shell swan
#

the result will only give you whether the confirmation errored or not