Checkout
Ezypay's Checkout is a hosted payment page enabling customers to complete purchases instantly using card payments. Checkout transactions do not trigger Ezypay's automatic payment recovery service, and any failed invoice will remain as past_due
in the system.
Pre-requisites
Verify your customer
Integrators should have already validated the authenticity of their customer before redirecting them to the checkout page. One common practice is using 2-factor verification either via email or SMS. This is to reduce the chance of fraudsters misusing Ezypay services.
Get Started
Use Create Checkout Session API to create the checkout URL.
- Provide the
customerId
,amount
anddescription
in the request body. - Retrieve the
checkoutUrl
from the API response and redirect the customer to the generated URL
{
"amount": {
"currency": "AUD",
"value": 120
},
"description": "fitness subscription",
"customerId": "040d43eb-425d-4ca0-b5fd-4bc81c1650ff"
}
{
"checkoutUrl": "https://checkout-sandbox.ezypay.com/bf42feec",
"id": "51c12344-6648-4391-935d-8bc83f7e2c0d"
}
-
Customers can choose their payment method / add a new payment method and proceed with payment.
-
Payment outcomes are returned immediately. Customers can retry in case of failure.
Note
Transaction fees for checkout change dynamically depending on the chosen payment method.
Best practice
Capture newly added payment method
Payment data added to the checkout page is stored in Ezypay's system and available for future use. Use payment_method_linked
webhook to obtain the newly added payment method.
Provide the successUrl
and cancelUrl
successUrl
and cancelUrl
These are the callback URLs for a 'successful payment' and a 'cancelled payment'. Integrators can add additional logic to further enhance the customer's payment experience.
Parameters returned to the successUrl
:
Parameter | Description |
---|---|
documentNumber | The document number of the associated invoice created by the checkout session. |
invoiceId | The Ezypay's invoice ID of the associated invoice created by the checkout session. |
customerId | The customerId supplied during checkout creation. If none are provided, a new customerId is generated. Integrators can store and use the same ID for future billing of the customer. |
paymentMethodToken | Payment method token used by customer for the payment. Can be reused by integrators. |
Callback to cancelUrl
does not return any parameters. It merely redirects customer back to the integrators page.
Disabled the checkout session
To prevent fraud (e.g., BIN attacks), be sure to disable unused checkout sessions. Ezypay automatically disables sessions after 3 failed attempts by default. This threshold is configurable during merchant onboarding.
Anonymous checkout
If a customerId
is not provided when creating the checkout session, the system will treat the transaction as an anonymous checkout. The customer will be prompted to enter their personal details for registration before proceeding with the payment. After the registration process, the customerId
and paymentMethodToken
captured can be used for future billing.
Updated about 1 month ago