Checkout
A checkout that converts on every device.
A hosted payment page that's fast, localised and wallet-first. Add your logo and colours, drop in one API call, and go live today.
Secured by HansaPay
Interactive demo. Try another language or payment method. Nothing is charged.
Conversion
Every detail tuned to get customers to paid.
Most checkout drop-off comes down to friction. We removed as much of it as we could find.
Wallet first
Apple Pay and Google Pay appear automatically on supported devices, so returning customers pay in one tap.
Localised automatically
Language, currency and address formats adapt to each customer's location and browser settings.
Designed for mobile
Large touch targets, the right keyboard for every field, and a layout that fits any screen.
Address autocomplete
Fewer keystrokes and fewer typos, with addresses validated before the customer pays.
Saved details
Customers can save their card for next time, securely tokenised and never stored on your servers.
Accessible by default
Keyboard navigation, screen reader labels and colour contrast that meet WCAG 2.2 AA.
Customisation
Your brand, our infrastructure.
Customers see your name, your colours and your style. Behind the scenes, card data is tokenised, with fraud screening and 3-D Secure built in.
- Logo, accent colour, button shape and font
- Your own domain for checkout pages
- Custom fields, terms of service and consent checkboxes
- Receipts and emails in your brand
Brand
Accent #147a4d
Corners 12px
Getting started
Three steps to getting paid.
- 01
Open an account
Tell us about your business and upload your documents. Most accounts are approved in about 24 hours, and test mode works straight away.
- 02
Start taking payments
Share a payment link, drop in hosted Checkout, or call the API. Cards and wallets are on from day one, with no extra contracts per method.
- 03
Get settled
Cleared funds land on your balance on your account's schedule, and you withdraw in any of 135+ currencies or in USDT.
For developers
One API call to a live checkout.
JSON over HTTPS, signed with HMAC-SHA256, with errors that carry a stable key. Every example in the reference was recorded from a running instance.
Signed both ways
Requests, responses and webhooks each carry an HMAC-SHA256 signature you can verify.
Webhooks that retry
Up to 9 attempts over about 90 minutes, until your endpoint replies success.
Plain REST
JSON over HTTPS. No library to install; sign requests from any language.
Your order number is the key
A repeated merchant_order_no is refused, so a retry can never charge twice.
import crypto from "node:crypto";
// HMAC-SHA256 over merchant ID, timestamp, nonce and the raw body.
async function hansapay(path, payload) {
const body = JSON.stringify(payload);
const ts = String(Math.floor(Date.now() / 1000));
const nonce = crypto.randomBytes(8).toString("hex");
const sign = crypto.createHmac("sha256", SECRET_KEY)
.update(`${MERCHANT_ID}\n${ts}\n${nonce}\n${body}`)
.digest("hex");
const res = await fetch(`https://api.hansapay.io/api/v1${path}`, {
method: "POST",
body, // send exactly the string you signed
headers: {
"Content-Type": "application/json",
"X-MerchantID": MERCHANT_ID,
"X-Timestamp": ts,
"X-Nonce": nonce,
"X-Sign": sign,
},
});
return JSON.parse(await res.text());
}
const { code, msg, data } = await hansapay("/payments/checkout", {
payment_method: "CARD",
merchant_order_no: "ORDER-1005",
trans_amount: { currency: "USD", value: "49.99" },
notify_url: "https://merchant.example.com/hansapay/notify",
return_url: "https://shop.example.com/orders/complete",
trade_info: { goods_name: "Pro plan, 1 month" },
});
// Errors come back as HTTP 200 too, so check code.
if (code !== 0) throw new Error(msg);
// Save checkout_url now: it can't be fetched again,
// and it expires after 30 minutes.
res.redirect(data.checkout_url);<?php
$rawBody = json_encode([
'payment_method' => 'CARD',
'merchant_order_no' => 'ORDER-1005',
'trans_amount' => ['currency' => 'USD', 'value' => '49.99'],
'notify_url' => 'https://merchant.example.com/hansapay/notify',
'return_url' => 'https://shop.example.com/orders/complete',
'trade_info' => ['goods_name' => 'Pro plan, 1 month'],
], JSON_UNESCAPED_SLASHES);
$timestamp = (string) time();
$nonce = bin2hex(random_bytes(8));
$payload = $merchantId . "\n" . $timestamp . "\n" . $nonce . "\n" . $rawBody;
$sign = hash_hmac('sha256', $payload, $secret);
$ch = curl_init('https://api.hansapay.io/api/v1/payments/checkout');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $rawBody, // exactly the string you signed
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'X-MerchantID: ' . $merchantId,
'X-Timestamp: ' . $timestamp,
'X-Nonce: ' . $nonce,
'X-Sign: ' . $sign,
],
]);
$res = json_decode(curl_exec($ch), true);
if ($res['code'] !== 0) {
throw new RuntimeException($res['msg']);
}
header('Location: ' . $res['data']['checkout_url']);BODY='{"payment_method":"CARD","merchant_order_no":"ORDER-1005","trans_amount":{"currency":"USD","value":"49.99"},"notify_url":"https://merchant.example.com/hansapay/notify","trade_info":{"goods_name":"Pro plan, 1 month"}}'
TIMESTAMP="$(date +%s)"
NONCE="$(openssl rand -hex 8)"
SIGN_PAYLOAD="${MERCHANT_ID}"$'\n'"${TIMESTAMP}"$'\n'"${NONCE}"$'\n'"${BODY}"
SIGN=$(printf '%s' "$SIGN_PAYLOAD" | openssl dgst -sha256 -hmac "$SECRET_KEY" -binary | xxd -p -c 256)
curl -X POST "https://api.hansapay.io/api/v1/payments/checkout" \
-H "Content-Type: application/json" \
-H "X-MerchantID: ${MERCHANT_ID}" \
-H "X-Timestamp: ${TIMESTAMP}" \
-H "X-Nonce: ${NONCE}" \
-H "X-Sign: ${SIGN}" \
-d "$BODY"FAQ
Checkout, answered.
What is a hosted checkout?
A hosted checkout is a payment page that HansaPay serves on your behalf. Customers are sent to it to pay, then returned to your site. Because card details are entered on our page, they never touch your servers, which keeps your own PCI scope to the simplest self-assessment questionnaire.
Can I customise the checkout page?
Yes. Add your logo, accent colour, button style and corner radius from the dashboard, and use your own domain for checkout pages. Changes apply to every checkout session instantly.
Which payment methods does Checkout support?
Every method HansaPay supports: Visa, Mastercard, American Express, Apple Pay, Google Pay, PayPal and Cash App Pay. Checkout only shows the methods that are available to each customer.
Do I need to write code to use Checkout?
A small amount. You create a checkout payment from your server with one API call and redirect the customer to the link it returns. If you'd rather not write any code, Payment Links use the same hosted page.
Does Checkout work on mobile?
Yes. Checkout is designed mobile first, with large touch targets, the right keyboard for every field, and Apple Pay or Google Pay on supported devices.
Launch your checkout today.
Open an account, share your first payment link, and start taking payments from customers anywhere.
- Approved in about 24 hours
- Test mode from day one
- No long-term contract
- Settle in 135+ currencies or USDT
