A payment_intent
is created to help you navigate the 3DS flow of collecting payment from your customer. It is necessary only for implementing 3DS flow using Chargebee.js.
Auto-expiry
All payment_intent
s with status
as inited
, in_progress
or authorized
become expired
after an hour automatically.
Sample payment intent [ JSON ]
{
"amount": 5000,
"created_at": 1517501515,
"currency_code": "USD",
"expires_at": 1517503315,
"gateway": "chargebee",
"gateway_account_id": "gw___test__KyVnGlSBWTQeudG",
"id": "__test__KyVnHhSBWTQz2Cu__test__0DZayCQMcAwDkEIPpUrGwkiyL25s7W1X",
"modified_at": 1517501515,
"object": "payment_intent",
"payment_method_type": "card",
"status": "inited"
}
Identifier for PaymentIntent.
string, max chars=150
Current status of PaymentIntent.
enumerated stringPossible values are
initedIntent is initialized.in_progressStatus will be in_progress if the Active Payment Attempt state is in requires_identification, requires_challenge or requires_redirection.authorized3DS verification successfully completed.consumedIf any Chargebee operation such as create subscription etc. is completed using the intent, it will be in consumed state. Intent cannot be used if it's already in consumed state.expiredIntent has expired, since it was not consumed before the predefined time-out.
The currency code (ISO 4217 format) of the amount used in transaction.
optional, string, max chars=3
Amount(in cents) to be authorized for 3DS flow.
in cents, min=0
The gateway account used for performing the 3DS flow.
string, max chars=50
Timestamp indicating when the PaymentIntent will expire if left unconsumed.
timestamp(UTC) in seconds
Reference for payment method at gateway. Only applicable when the PaymentIntent is created for cards stored in the gateway.
optional, string, max chars=200
The payment method of this intent.
optional, enumerated string, default=cardPossible values are
cardcard.idealideal.sofortsofort.bancontactbancontact.google_paygoogle_pay.dotpaydotpay.giropaygiropay.
The URL the customer will be directed to once 3DS verification is successful. Applicable only when payment_method_type
is ideal
, sofort
, dotpay
or giropay
.
optional, string, max chars=250
The URL the customer will be directed to when 3DS verification fails. Applicable only when payment_method_type
is ideal
, sofort
, dotpay
or giropay
.
optional, string, max chars=250
Timestamp indicating when the PaymentIntent was created.
timestamp(UTC) in seconds
Timestamp indicating when the PaymentIntent was last modified.
timestamp(UTC) in seconds
Version number of this resource. Each update of this resource results in incremental change of this number. This attribute will be present only if the resource has been updated after 2016-09-28.
optional, long
Timestamp indicating when this payment intent was last updated.
optional, timestamp(UTC) in seconds
Identifier of the customer associated with the PaymentIntent. Applicable only if it’s an existing customer in Chargebee.
string, max chars=50
Gateway associated with the PaymentIntent.
optional, string, max chars=null
Active payment attempt for the PaymentIntent.
optional, payment_attempt
Active payment attempt attributes
Identifier for PaymentIntent's active payment attempt.
optional, string, max chars=70
Current status of active payment attempt.
enumerated stringPossible values are
initedPayment attempt is initialized.requires_identificationCustomer's device fingerprint is used to verify their identity. It needs to be sent to the Issuing Bank for verification.requires_challengeThe transaction has to go through 3DS Challenge flow and the customer needs to authenticate via 3DS 2.0.requires_redirectionThe transaction has to go through 3DS Redirection flow and the customer needs to authenticate via 3DS 1.0.authorized3DS verification successfully completed.refused3DS verification attempt failed.
The payment method of this attempt.
optional, enumerated string, default=cardPossible values are
cardcard.idealideal.sofortsofort.bancontactbancontact.google_paygoogle_pay.dotpaydotpay.giropaygiropay.
Reference of PaymentIntent at gateway.
optional, string, max chars=50
Error code received from the payment gateway on failure.
optional, string, max chars=100
Error message received from the payment gateway on failure.
optional, string, max chars=65k
Timestamp indicating when the active payment attempt was created.
timestamp(UTC) in seconds
Timestamp indicating when the active payment attempt was last modified.
timestamp(UTC) in seconds
Creates a PaymentIntent object. This is to be used with Chargebee.js API to complete the 3DS flow for new or stored cards.
While creating, specify the appropriate gateway account and amount. Exact amount can be estimated using our Estimate API.
Sample Request
curl https://{site}.chargebee.com/api/v2/payment_intents \
-u {site_api_key}:\
-d amount=5000 \
-d currency_code="USD"
copy
curl https://{site}.chargebee.com/api/v2/payment_intents \
-u {site_api_key}:\
-d amount=5000 \
-d currency_code="USD"
Sample Response [ JSON ]
Show more...
{"payment_intent": {
"amount": 5000,
"created_at": 1517501515,
"currency_code": "USD",
"expires_at": 1517503315,
"gateway": "chargebee",
"gateway_account_id": "gw___test__KyVnGlSBWTQeudG",
"id": "__test__KyVnHhSBWTQz2Cu__test__0DZayCQMcAwDkEIPpUrGwkiyL25s7W1X",
"modified_at": 1517501515,
"object": "payment_intent",
"payment_method_type": "card",
"status": "inited"
}}
URL Format POST
https://{site}.chargebee.com/api/v2/payment_intents
Identifier of the customer associated with the PaymentIntent. Applicable only if it’s an existing customer in Chargebee.
optional, string, max chars=50
Amount(in cents) to be authorized for 3DS flow.
required, in cents, min=0
The currency code (ISO 4217 format) of the amount used in transaction.
required, string, max chars=3
The gateway account used for performing the 3DS flow.
optional, string, max chars=50
Reference for payment method at gateway. Only applicable when the PaymentIntent is created for cards stored in the gateway.
optional, string, max chars=200
The payment method of this intent.
optional, enumerated string, default=cardPossible values are
cardcard.idealideal.sofortsofort.bancontactbancontact.google_paygoogle_pay.dotpaydotpay.giropaygiropay.
The URL the customer will be directed to once 3DS verification is successful. Applicable only when payment_method_type
is ideal
, sofort
, dotpay
or giropay
.
optional, string, max chars=250
The URL the customer will be directed to when 3DS verification fails. Applicable only when payment_method_type
is ideal
, sofort
, dotpay
or giropay
.
optional, string, max chars=250
Resource object representing payment_intent.
always returned
Updating properties on a PaymentIntent object. All the subsequent 3DS transaction attempts will have the updated values.
Sample Request
curl https://{site}.chargebee.com/api/v2/payment_intents/__test__KyVnHhSBWTR3ZCw__test__6AP6PXGBruIztRxpb4L0Si0Rihcur2fil \
-u {site_api_key}:\
-d amount=4000 \
-d currency_code="USD"
copy
curl https://{site}.chargebee.com/api/v2/payment_intents/__test__KyVnHhSBWTR3ZCw__test__6AP6PXGBruIztRxpb4L0Si0Rihcur2fil \
-u {site_api_key}:\
-d amount=4000 \
-d currency_code="USD"
Sample Response [ JSON ]
Show more...
{"payment_intent": {
"amount": 4000,
"created_at": 1517501515,
"currency_code": "USD",
"expires_at": 1517503315,
"gateway": "chargebee",
"gateway_account_id": "gw___test__KyVnGlSBWTQeudG",
"id": "__test__KyVnHhSBWTR3ZCw__test__6AP6PXGBruIztRxpb4L0Si0Rihcur2fil",
"modified_at": 1517501515,
"object": "payment_intent",
"payment_method_type": "card",
"status": "inited"
}}
URL Format POST
https://{site}.chargebee.com/api/v2/payment_intents/{payment_intent_id}
Amount(in cents) to be authorized for 3DS flow.
optional, in cents, min=0
The currency code (ISO 4217 format) of the amount used in transaction.
optional, string, max chars=3
The gateway account used for performing the 3DS flow.
optional, string, max chars=50
The payment method of this intent.
optional, enumerated stringPossible values are
cardcard.idealideal.sofortsofort.bancontactbancontact.google_paygoogle_pay.dotpaydotpay.giropaygiropay.
The URL the customer will be directed to once 3DS verification is successful. Applicable only when payment_method_type
is ideal
, sofort
, dotpay
or giropay
.
optional, string, max chars=250
The URL the customer will be directed to when 3DS verification fails. Applicable only when payment_method_type
is ideal
, sofort
, dotpay
or giropay
.
optional, string, max chars=250
Resource object representing payment_intent.
always returned
Retrieves the payment intent resource.
Sample Request
curl https://{site}.chargebee.com/api/v2/payment_intents/__test__KyVnHhSBWTR1HCv__test__5COaMLU3JrmJkDQKOFQqcdOocdusvy0UBl \
-u {site_api_key}:
copy
curl https://{site}.chargebee.com/api/v2/payment_intents/__test__KyVnHhSBWTR1HCv__test__5COaMLU3JrmJkDQKOFQqcdOocdusvy0UBl \
-u {site_api_key}:
Sample Response [ JSON ]
Show more...
{"payment_intent": {
"amount": 5000,
"created_at": 1517501515,
"currency_code": "USD",
"expires_at": 1517503315,
"gateway": "chargebee",
"gateway_account_id": "gw___test__KyVnGlSBWTQeudG",
"id": "__test__KyVnHhSBWTR1HCv__test__5COaMLU3JrmJkDQKOFQqcdOocdusvy0UBl",
"modified_at": 1517501515,
"object": "payment_intent",
"payment_method_type": "card",
"status": "inited"
}}
URL Format GET
https://{site}.chargebee.com/api/v2/payment_intents/{payment_intent_id}
Resource object representing payment_intent.
always returned