#akari-charge-setupintent

1 messages · Page 1 of 1 (latest)

fickle plume
#

HEllo! A SetupIntent is used to collect payment method details and doesn't create a payment/charge so usually you don't link the 2 together

iron dune
#

Right so once I have the payment method, how do I charge it?

#
PaymentMethod {#1436 ▼
  +"id": "pm_1LTED3KalH3Zcmn96HYjI8Ld"
  +"object": "payment_method"
  +"billing_details": StripeObject {#1415 ▶}
  +"created": 1659658573
  +"customer": "cus_MBbPUQSMvynWGR"
  +"livemode": false
  +"metadata": StripeObject {#1463}
  +"type": "us_bank_account"
  +"us_bank_account": StripeObject {#1465 ▶}
}

I have a payment method assigned to a customer

#

do I just create a charge with that customer ID?

#

I get "Cannot charge a customer that has no active card" when I try to charge the customer that the payment method belongs to.

fickle plume
iron dune
#

ok do I pass in the PaymentMethod object to the "payment_method" property when creating it?

iron dune
#

Hmmm, I get
"The PaymentMethod provided (us_bank_account) is not allowed for this PaymentIntent. Please attach a PaymentMethod of one of the following types: card. Alternatively, update the allowed payment_method_types for this PaymentIntent to include "us_bank_account"."

#

oh I think I know what the issue is

fickle plume
#

yeah you have the wrong payment method type!

iron dune
#

It's working now!

#

thank you very much