#el_quick

1 messages · Page 1 of 1 (latest)

simple windBOT
sage pagoda
#

Hello! Do you have an example?

candid crane
#

sure!

#

POST /v1/payment_intents

Request POST body
{
"description": "Booking purchase",
"currency": "gbp",
"off_session": "false",
"customer": "cus_JojCwalD1ejGKl",
"payment_method": "pm_1MAim6KC4Ot1qhBTteVMVTBJ",
"confirm": "false",
"amount": "2500",
"payment_method_types": {
"0": "card"
}
}

Response body
{
"id": "pi_3MAimWKC4Ot1qhBT1PfUoVOe",
"object": "payment_intent",
"allowed_source_types": [
"card"
],
"amount": 2500,
"amount_capturable": 0,
"amount_details": {
"tip": {
}
},
"amount_received": 0,
"application": "ca_BhJKCN3adIBlrxdJjuBNEan6tMLo2ZrH",
"application_fee_amount": null,
"automatic_payment_methods": null,
"canceled_at": null,
"cancellation_reason": null,
"capture_method": "automatic",
"charges": {
"object": "list",
"data": [
],
"has_more": false,
"total_count": 0,
"url": "/v1/charges?payment_intent=pi_3MAimWKC4Ot1qhBT1PfUoVOe"
},
"client_secret": "pi_3MAimWKC4Ot1qhBT1PfUoVOe_secret_EAOJt0VYP5uT27sZjXqNg6uKk",
"confirmation_method": "automatic",
"created": 1670024196,
"currency": "gbp",
"customer": "cus_JojCwalD1ejGKl",
"description": "Booking purchase",
"invoice": null,
"last_payment_error": null,
"livemode": false,
"metadata": {
},
"next_action": null,
"next_source_action": null,
"on_behalf_of": null,
"payment_method": "pm_1MAim6KC4Ot1qhBTteVMVTBJ",
"payment_method_options": {
"card": {
"installments": null,
"mandate_options": null,
"network": null,
"request_three_d_secure": "automatic"
}
},
"payment_method_types": [
"card"
],
"processing": null,
"receipt_email": null,
"review": null,
"setup_future_usage": null,
"shipping": null,
"source": null,
"statement_descriptor": null,
"statement_descriptor_suffix": null,
"status": "requires_confirmation",
"transfer_data": null,
"transfer_group": null
}

sage pagoda
#

Why are you passing in confirm: false when you create the Payment Intent?

candid crane
#

because I am passing off_session = false, which can't be together

sage pagoda
#

Well let's back up for a second - what are you trying to do? In order to succeed PaymentIntents do need to be confirmed, so it makes sense that your PaymentIntents have a status of requires_confirmation

candid crane
#

even though is the 4242 test card?

sage pagoda
#

Yes, there's nothing special about the 4242 card that would allow you to bypass confirmation (there's no test card that would let you do that)

candid crane
#

Hmmm, ok, so, I'll get another issue by doing that, if I send confirm: true, Stripe tries confirm the payment intent and if it fails, Stripe cancel it immediately, so, I'm not able to confirm it any more

sage pagoda
#

Again, let's back up - what are you trying to do? Is there a reason you're creating and confirming the Payment Intent in a singel request? You can always create the Payment Intent in one request, and then confirm it in a separate request (https://stripe.com/docs/api/payment_intents/confirm?event_types-payment_intent.payment_failed) so that even if confirmation fails you have the Payment Intent so you can try again

candid crane
#

Ok, I am going to check back again! thank you for your time! have a nice day!