Hosted card page
Take card payments on a Tranzak-hosted page with lakaypay_card, in a redirect or a modal, and set up recurring payments.
With payment_method: "lakaypay_card", the customer pays on a Tranzak page. Your server never sees card data.
How it works
- Create the payment with
payment_method: "lakaypay_card". - Open the returned
payment_url. The page is valid for about 12 minutes and can be used once. - The customer enters the card and confirms with a code sent by email.
- Tranzak sends the
payment.successorpayment.failedwebhook.
curl https://api.tranzak.co/api/gateway/v1/payments \
-H "X-Api-Key: $TRANZAK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"amount": 25,
"currency": "USD",
"payment_method": "lakaypay_card",
"customer_name": "Jean Dupont",
"customer_email": "[email protected]",
"reference": "ORDER-4822"
}'
const res = await fetch('https://api.tranzak.co/api/gateway/v1/payments', {
method: 'POST',
headers: { 'X-Api-Key': process.env.TRANZAK_API_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({
amount: 25,
currency: 'USD',
payment_method: 'lakaypay_card',
customer_name: 'Jean Dupont',
customer_email: '[email protected]',
reference: 'ORDER-4822',
}),
});
const payment = await res.json();
import os, requests
payment = requests.post(
"https://api.tranzak.co/api/gateway/v1/payments",
headers={"X-Api-Key": os.environ["TRANZAK_API_KEY"]},
json={
"amount": 25,
"currency": "USD",
"payment_method": "lakaypay_card",
"customer_name": "Jean Dupont",
"customer_email": "[email protected]",
"reference": "ORDER-4822",
},
).json()
Redirect or modal
You can send the browser to payment_url, or open the page in a modal or popup with the Tranzak checkout script:
<script src="https://api.tranzak.co/js/tranzak-checkout.js"></script>
<script>
TranzakCheckout.open({
paymentUrl: payment.payment_url,
mode: 'modal', // or 'popup'
onSuccess: function () { /* update the screen only */ },
onError: function () {},
onClose: function () {},
});
</script>
Warning
onSuccessis a user-interface callback, not proof of payment. Confirm on your server with the webhook or a read of the payment.
Recurring payments
Send recurring: true together with a recurring_interval when you create the payment. Recurring payments work with lakaypay_card only.
| Field | Values |
|---|---|
recurring |
true |
recurring_interval |
daily, weekly, monthly or yearly |
recurring_interval_count |
How many intervals between two charges (optional) |
A subscription is created only after the customer's first successful payment. Its identifier (SUB_…) arrives in metadata.subscription_id of the payment.success webhook. Store it immediately. Each billing cycle is a new transaction with its own webhook.
Minimum amount and fees
The minimum is set by Tranzak and returned in the message of a 400 amount_too_low response. Pricing is on the pricing page.