Create a SetupIntent
POST
/v1/setup_intents请求参数
Set to true to attempt to confirm this SetupIntent immediately. This parameter defaults to false. If the payment method attached is a card, a return_url may be provided in case additional authentication is required.
ID of the Customer this SetupIntent belongs to, if one exists. If present, the SetupIntent’s payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent.
An arbitrary string attached to the object. Often useful for displaying to users.
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
ID of the payment method used with this SetupIntent.
The list of payment method types (e.g. card) that this SetupIntent is allowed to set up.
Payment-method-specific configuration for this SetupIntent.
When included, this hash creates a PaymentMethod that is set as the payment_method value in the SetupIntent.
Indicates how the payment method is intended to be used in the future. Use on_session if you intend to only reuse the payment method when the customer is in your checkout flow. Use off_session if your customer may or may not be in your checkout flow. If not provided, this value defaults to off_session.
The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method’s app or site. If you’d prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. This parameter can only be used with confirm=true.
{
"confirm": true,
"customer": "string",
"description": "string",
"metadata": {},
"payment_method": "string",
"payment_method_types": [
"string"
],
"payment_method_options": {
"card": {
"request_three_d_secure": "string"
}
},
"payment_method_data": {},
"usage": "on_session",
"return_url": "string"
}
示例代码
Responses
{}