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.

  1. Provide the customerId, amount and description in the request body.
  2. 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"
}
  1. Customers can choose their payment method / add a new payment method and proceed with payment.

    Figure 2: Checkout Page for Existing Customer
  2. 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

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:

ParameterDescription
documentNumberThe document number of the associated invoice created by the checkout session.
invoiceIdThe Ezypay's invoice ID of the associated invoice created by the checkout session.
customerIdThe 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.
paymentMethodTokenPayment 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.