#amer-error

1 messages ยท Page 1 of 1 (latest)

red shell
#

Hi there! Let me take a look ๐Ÿ™‚

tropic heron
#

Sure, Thanks

red shell
#

This happens because the API would like to know how to charge ๐Ÿ™‚

#

Source is referring to the payment method.

#

For your information, the use of Source and Charge APIs are legacy.

#

The current recommended way is PaymentIntent and PaymentMethod.

tropic heron
#

what is different between PaymentIntent and PaymentMethod

red shell
#

Here's an example of how to accept a payment:

stripe.PaymentIntent.create(
  customer='cus_xyz',
  amount=2000,
  currency="usd",
  payment_method='pm_xyz',
)```
#

This is a great question!

#

PaymentIntent is the object that provides information about the payment flow, e.g. the amount to pay, which customer to charge, what is the payment method.

#

PaymentMethod as the name suggests, is the object that provides details about the payment method, e.g. card, ACH, Google Pay.

#

Hope this helps ๐Ÿ™‚

tropic heron
#

@red shell do we have to make 2 request api first PaymentMethod and then PaymentIntent

#

@red shell im getting this now parameter_missing - payment_method
The payment_method parameter supplied card_Test belongs to the Customer cus_Test. Please include the Customer in the customer parameter on the PaymentIntent

red shell
#

If the payment method is attached to a customer, you can specify the customer id in the PaymentIntent object

tropic heron
#

Thank you so much

red shell
#

No problem at all! ๐Ÿ™‚