Checkout Session Charge
Use the Checkout Session API to initiate a new payment instead of using the Card API method. Confirmation of the Checkout Session creates the Checkout Session object used to request payment.
Create A Checkout Session
We recommend using our recommended Card API (Server to Server) integrations to perform the charge and tokenization process client-side. This ensures that no sensitive card data touches your server and allows your integration to operate in a PCI-compliant way.
- You need to redirect the user to to Axxonpay's Checkout Session URL received after the request is sent.
- You can refer to the code below to handle the checkout session creation aspect Axxonpay backoffice or the Checkout Session API end-point below.
POST / v1 / process / checkout - session;
const axios = require('axios');
// Define the request body
const dataObj = {
amount: 10000,
currency: 'EUR',
checkout_id: '6059BFPS7738',
description: 'Payment for Service',
email: 'johnsmith@gmail.com', //Optional
return_url: 'https://google.com',
};
const headers = {
authorization: 'key\_<Your-Key>'
};
// Make the POST request
const response = await axios.post('https://<axxonpay-url-gateway>/v1/process/checkout-session', dataObj, { headers });
Parameters
Parameter | Required/Optional | Type | Description |
---|---|---|---|
amount | REQUIRED | Number | Amount intended to be collected by this Charge. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or equivalent in charge currency. The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). |
currency | REQUIRED | String | Three-letter ISO currency code, in lowercase. Must be a supported currency ["EUR"]. |
checkout_id | OPTIONAL | String | An arbitrary string attached to the object. Often useful for retrieving payments made by checkout session. |
description | REQUIRED | String | An arbitrary string attached to the object. Often useful for displaying to users. |
OPTIONAL | String | Email address of the customer associated with the charge. | |
return_url | REQUIRED | String | REQUIRED IN FOR REDIRECT AFTER PAYMENT IS SUCCESSFUL OR CANCELED |