#amer-paymentintent
1 messages · Page 1 of 1 (latest)
hi there! that seems normal though - the PaymentIntent needs a PaymentMethod to charge : https://stripe.com/docs/payments/intents
Exactly that what i thought so i add the api request to
charge = Stripe::PaymentIntent.create({
amount: total_amount,
currency: 'usd',
customer: user.stripe_id,
payment_method: s_payment_source,
description: "Reservation ##{self.id}, Charge for #{item.item_name} reservation"
})
Now im getting this error
The payment_method parameter supplied card_1KcIiXITest belongs to the Customer cus_L2VTrTest. Please include the Customer in the customer parameter on the PaymentIntent.
@flat sequoia ^
have you tried following the instructions from the error message? What is the customer id which you're providing in customer and does that match what the error message mentioned i.e. cus_L2VTrTest?
Now it's back to Status Incomplete
The customer has not completed the payment.
This is the api request im sending:
{
"amount": "143",
"currency": "usd",
"customer": "cus_KzVSeBvmTest",
"payment_method": "card_1KJWYVITest",
"description": "Reservation #478, Charge for Feb 1a reservation"
}
@flat sequoia ^
i'm guessing that the next step is that you need to confirm the payment
if you include confirm=true in your request, the payment would be automatically confirmed
if you want to manually confirm the payment from your server : https://stripe.com/docs/api/payment_intents/confirm