#DeputyCheese

1 messages · Page 1 of 1 (latest)

heavy smeltBOT
shell bridge
#

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

lime palm
#

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

shell bridge
#

Ah as in they will put in an entirely new credit card?

lime palm
#

Exactly

shell bridge
#

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

lime palm
#

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

shell bridge
#

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

lime palm
#

Ah perfect

#

Thanks for your help, I'll try that