#cheqo-charge-offsession

1 messages · Page 1 of 1 (latest)

white garnetBOT
marble ether
#

cheqo-charge-offsession

heady notch
marble ether
#

There's no PaymentElement at all in this flow

#

PaymentElement is here to collect new payment method details. If you're using a previously saved card, you wouldn't render that UI/element at all in this case

#

more like building your own list of saved card(s) with a radio button like what Amazon does during checkout if that makes sense?

#

but that's only if your customer is "on session" like they are on your website/app ready to pay again

heady notch
# marble ether There's no PaymentElement at all in this flow

so I get the payment methods here:

const paymentMethods = await stripe.paymentMethods.list({
  customer: '{{CUSTOMER_ID}}',
  type: 'card',
});

and then simply create a charge in the same api call?

const charge = await stripe.charges.create({
  amount: 2000,
  currency: 'usd',
  source: 'tok_mastercard',
  description: 'My First Test Charge...'

where source is the paymentMethod.id?

marble ether
#

well no, that will never work with the Charges API

#

use the PaymentIntents API which is what is compatible with PaymentMethod and PaymentElement and all of this. Basically exactly waht is in the doc I just linked you to

heady notch
marble ether
#

yes. I'd recommend trying it carefully in Test mode, will be as fast!

heady notch