#DeputyCheese
1 messages · Page 1 of 1 (latest)
When you say update their credit card, do you mean just update the CVC/postal code?
I don't think createPaymentMethod would mount the form. Will check to see if we have docs on this process
No I meant replacing the credit card
For example if the previous one is expired and they have to update the exiting one
I'm not sure how to mount the form for that action
Ah as in they will put in an entirely new credit card?
Exactly
Or do I just use https://stripe.com/docs/api/payment_methods/create on the backend and createPaymentMethod on the frontend and then overwrite the customers default payment method?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
You can follow this guide then, you can just use your existing Customer ID instead of creating a new one https://stripe.com/docs/payments/save-and-reuse
createPaymentMethod is for something slightly different on the frontend. Here, you will want to create a setup intent on your server, mount the payment element on your client side, and have the page confirm the setup intent. That will create a reusable payment method on your account
If I understand correctly the user would be redirected to an external page when using the mentioned guide
I was hoping to reuse the components that are already there and styled etc. from the standard payment procedure
Where we use createPaymentMethod during checkout
Oh in that case, yes you can use and code. This should be basically the same procedure as what you are already doing when you call createPaymentMethod. You would just use an existing customer ID instead of creating a new one