#amer-error
1 messages ยท Page 1 of 1 (latest)
Sure, Thanks
This happens because the API would like to know how to charge ๐
Customer is referring to the Stripe Customer object https://stripe.com/docs/api/customers
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.
what is different between PaymentIntent and PaymentMethod
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.
For your convenience, here's our official guide to accept a payment: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements
Hope this helps ๐
@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
If the payment method is attached to a customer, you can specify the customer id in the PaymentIntent object
Thank you so much
No problem at all! ๐