GladysDevelopers

Hosted checkout

Send the payer to Gladys to approve, and bring them back.

Payers approve payments on a page Gladys hosts, at the payment's checkout_url. They sign in and confirm with their PIN there, so your app never handles Gladys credentials, and can't be blamed for losing them.

Sending the payer

Redirect the payer's browser to checkout_url, or link to it:

// After creating the payment on your server
res.redirect(303, payment.checkout_url);

Open it as a full page, not in a frame: the checkout page refuses to be embedded, so that nobody can lay a fake form over it.

What the payer sees

  1. Sign in with their Gladys phone number and login PIN.
  2. Confirm: they see your business's name, the amount and your description, and approve with their transaction PIN, or decline.
  3. The result: Paid, Approved (waiting for you to capture), Cancelled or Expired.

The page shows your business's name, not your app's name.

If the payer opens the link after the payment has finished, they see the result without signing in.

On TEST payments

The page also offers Approve as test payer and Decline as test payer, so you can complete a checkout without a Gladys account. See Test and live.

Bringing the payer back

Set return_url when you create the payment, and the result page offers a Back to button that sends the payer there, with the payment added:

https://shop.example/payment-complete?reference=pay_yM5jfhPZAGaJPTSMrSVpklbh&status=CAPTURED

return_url must be exactly one of your app's Redirect URIs: add it on your app's page in the dashboard first. Query parameters you include in it are kept.

Confirm before you ship

The status in the return link is there to show the right page, nothing more. Anyone can type a URL. Before you ship an order, confirm the payment with GET /payments/{reference} or by its webhook.

The button only appears once the payment has a result, and only if the payer presses it: some will close the tab instead. Don't rely on the return to finish an order; rely on the webhook.

On this page