#blinkdaffer

1 messages · Page 1 of 1 (latest)

solid abyssBOT
hallow marlin
#

No you don't. SetupIntent is to collect card information. Token is another older API

frigid owl
#

so how would i attach a token id to a customer

#

?

#

let me explain a bit, so from Frontend i receive a tokenid, i want to use this token id and attach it to the customer as a payment method

hallow marlin
#

I see. How are you received a token in the first place?

frigid owl
#

generated on the client side

hallow marlin
#

By which component?

#

Card Element?

frigid owl
#
      stripe?.createToken(cardNumber).then((value) => {
        value.token && onPayWithCard({ tokenId: value.token.id });
      });
hallow marlin
#

Okiee

frigid owl
#

what would be the correct way to attach this token to the customer considering we want to use it for recurring payments

#

?

hallow marlin
#

So when you have this token already, you can use it directly in PaymentIntent

#

But in the first place, this is a legacy API and you should move over the SetupIntent completely

frigid owl
#

can directly use it in subscriptions.create

hallow marlin
#

Probably not. It's legacy you know..