Cancel a PaymentIntent
POST
/v1/payment_intents/{id}/cancelA PaymentIntent object can be canceled when it is in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_action.
Once canceled, no additional charges will be made by the PaymentIntent and any operations on the PaymentIntent will fail with an error. For PaymentIntents with status=’requires_capture’, the remaining amount_capturable will automatically be refunded.
You cannot cancel the PaymentIntent for a Checkout Session. Expire the Checkout Session instead.
请求参数
Path Params
id
string
required
Body Params application/json
cancellation_reason
string
required
Reason for canceling this PaymentIntent.
Example
{
"cancellation_reason": "customer cancelled"
}
示例代码
Responses
OK(200)
HTTP 状态码: 200
内容格式: JSONapplication/json
Data Schema
object {0}
Example
Not configured
Last modified: 4 个月前