#kodai_82300
1 messages · Page 1 of 1 (latest)
Hello! You can't get it in that code. When you call stripe.confirmPayment and no error is encountered immediately it will redirect, which means none of the code following that will run.
What are you trying to build? Why do you want the Payment Method ID?
I would like to allow users to see the card information stored in their customer information.
You can retrieve that information on your server and display it when they load the page you want that info shown on.
How can I provide a PaymentMethod ID on the server side?
From this documentation, it seems to be returned from the front.
That is server-side code.
Your client-side code would call /retrieve-customer-payment-method on your server, which would cause that server-side code to run and return the Payment Method.
This is client-side, but it is written as paymentMethodId: paymentMethodId,.
I don't know how to get this paymentMethodId.
What happens when you try this code paired with the server-side code above?
The server-side console.log("confirmation"); is not outputting, so it is stopping on the client side.
What do you mean? Can you show me the client-side code that's not running as expected? That's your server-side code.
Wait... do you mean the server-side console.log call shown above isn't running?
Are you looking at the logs on your server for that?
Since the server-side console.log("confirmation"); is not output, no POST request has been sent from the client side.
Okay, can you share your client-side code?
On the client side, I enter the same code as in the documentation.
Okay, where is retrieveCustomerPaymentMethod being called from?
Back to the first question.
I am unable to get a PaymentMethodID and would like to know exactly how to get one.
Hi, stepping in and catching up.
A PaymentMethodID is required to display card information to the customer.
How exactly do I get a PaymentMethodID?
Do I need to save customer.id etc. when registering a customer?
On your server side code, it looks like you're sending paymentMethod, can you console log this on your server code to see what is being logged?