#fkaib-paymentelement-save

1 messages · Page 1 of 1 (latest)

copper berryBOT
wary fiber
#

fkaib-paymentelement-save

gusty whale
#
const { paymentMethod, error } = await stripe.createPaymentMethod({
  type: "card",
  card: cardElement,
});```

So I want to use the stripe.createPaymentMethod in the frontend but I can't retrieve the cardElement. I want to use the PaymentElement instead of CardElement. Is this possible?
wary fiber
#

Why are you trying to do that though? The doc I linked clearly explained how to properly collect card details securely with a SetupIntent. So that's what you should use, it has a clear React example too

#

@gusty whale I'm happy to clarify if anything is unclear here, I'm just not sure which part confuses you

gusty whale
#

Just tried everything on the doc and it worked. thank you very much!