A PaymentIntent
resource is used to track and handle different states of the payment until it succeeds. To learn how to use the PaymentIntent, you can check the Payment Intent workflow.
A PaymentIntent Resource
{
"data": {
"id": "pi_1JvFbEiRRnh2fsUE5nJ2F1z7",
"type": "payment_intent",
"attributes": {
"amount": 2000,
"currency": "PHP",
"description": "Order # 20190604",
"statement_descriptor": "The Barkery Shop",
"status": "awaiting_payment_method",
"livemode": false,
"client_key": "pi_1JvFbEiRRnh2fsUE5nJ2F1z7_client_mpe6tJkgaX3pSoiYeSp1AbEU",
"created_at": 1586179682,
"updated_at": 1586179682,
"last_payment_error": null,
"payment_method_allowed": [
"card"
],
"payments": [],
"next_action": null,
"payment_method_options": {
"card": {
"request_three_d_secure": "any"
}
},
"metadata": {
"yet_another_metadata": "good metadata",
"reference_number": "X1999"
}
}
}
}
id string
Unique ID of the resource.
type string
Represents the resource type. Value is always payment_intent
.
amount integer
amount to be collected by the PaymentIntent. A positive integer with a minimum amount is 2000. 2000 is the smallest unit in cents. If you want to receive an amount of 20.00, the value that you should pass is 2000. If you want to receive an amount of 1500.50, the value that you should pass is 150050.
currency string
Three-letter ISO currency code, in uppercase. PHP
is the only supported currency at the moment.
description string
Description of the payment intent. The value saved here will also be saved to the Payments resource that will be generated on attach PaymentMethod to PaymentIntent endpoint.
statement_descriptor string
You can use this value as the complete description that appears on your customer’s statements. Your account's business name is the default value if not passed.
status string
Status of the PaymentIntent. Possible values are awaiting_payment_method
, awaiting_next_action
, processing
and succeeded
.
livemode boolean
The value is true if the resource exists in live mode or the value is false if the resource exists in test mode.
client_key string
The client key of the PaymentIntent. This is used to retrieve a PaymentIntent from the client side using your public key. The client key is also used to attach the PaymentMethod to PaymentIntent from the client side.
Refer to our docs to accept card payment and learn about how client_key should be handled.
capture_type string
Sets the capture type of the transaction. The default value is automatic
. You can use our Pre-authorization and Capture API by setting this field to manual
.
last_payment_error dictionary
The last payment error encountered from the latest PaymentMethod attachment to PaymentIntent. This attribute is only available if the latest attachment had an error.
payment_method_allowed array
The list of payment method types that the PaymentIntent is allowed to use.
payments array
Payments that were created by the PaymentIntent. The payments attribute can only be queried using the secret key. Retrieving the PaymentIntent using the public key will not return this attribute for security purposes.
next_action dictionary
This attribute describes the next action that your customer needs to do. For example, this attribute holds the 3DS Authentication URL for thecard
payment method, checkout URL for e-wallets, and other payment methods.
Attribute | Description |
---|---|
type string | The type of the next action to perform. The possible value is redirect for now. |
redirect.url string | The URL you must redirect your customer to in order to authenticate the payment. |
redirect.return_url string | If the customer does not abort the authentication process, they will be redirected to this URL after complete authentication. |
payment_method_options dictionary
Specific configuration of the payment methods for the PaymentIntent.
Attribute | Description |
---|---|
card.request_three_d_secure string | This is the only current option for card payment method. Depending on the value, this option decides whether the card must require 3DS authentication or adjust depending on the default 3D Secure configuration of the card. Possible values are either any or automatic . any requires 3D Secure authentication if supported while automatic uses the default 3D Secure configuration of the card. |
setup_future_usage dictionary
Creating a payment intent with this attribute would connect the payment to our card vaulting feature.
Attribute | Description |
---|---|
session_type | Describes the behavior of card vaulting. For now, the only possible value is on_session . |
customer_id | The ID of the customer. |
metadata dictionary
A set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the object in a structured format. Only string values are accepted.
created_at timestamp
The date when the PaymentIntent has been created.
updated_at timestamp
The date when the PaymentIntent has been updated.