#shaun-subs

1 messages · Page 1 of 1 (latest)

icy crest
#

No, there isn't a way to attach a Payment Method to a customer from a client-side request. You can only do it from a server request

proven island
#

So the publishable key is purely just to tokenize the payment method? And so we would send a payment method id to the backend?

#

And attach it there?

icy crest
#

It depends on what you're trying to do, a common flow is that you create a Payment Intent with customer and setup_future_usage set. Then once that Payment Intent is confirmed client side, the created Payment Method would automatically be attached to the customer - but again, you need to set customer and setup_future_usage server-side to work

#

If you have a flow where you're just creating the Payment Method client-side and not confirming an Intent, then yes, you'd have to first create the Payment Method client-side and send it back to your server to be attached

proven island
#

for our use case we're trying to create a subscription and accept payment via web?

#

so wondering which flow would work in that scenario

icy crest
#

shaun-subs