#AM-payments

1 messages · Page 1 of 1 (latest)

harsh bay
wise quail
#

I get the following error: A source must be attached to a customer to be used as a payment method. Where did I go wrong?

#

And btw thanks for answering my question directly and not just saying update the frontend. Much appreciated!

harsh bay
wise quail
#

req_9dctCk41WexUw5

harsh bay
#

yep you can't use a card_xxx directly in a call like that(I assume you pulled that from the token->card->id in your code)

#

you have to convert the token to a PaymentMethod first as mentioned above, and then use the PaymentMethod with the SetupIntent

wise quail
#

Where do I use the token here?

harsh bay
#

so it's 'card' => ['token' => 'tok_xxx'], in PHP

wise quail
#

Ok, I'll give that a go and let you know if it works. Thanks