⚡ Link Builder
Fill in your details and get a ready to use payment link instantly.
?order=123.What Is a Payment Link?
A payment link is a URL that takes a customer to a checkout page for a specified payment. With this pay by link approach, you send the link, the customer opens it, and Gammal Tech handles the payment page. The selected currency determines whether the customer pays from a Gammal Tech wallet or by card.
You can generate and share the link without writing code. If your website automatically delivers a download, grants account access, or fulfills an order, it also needs the payment-verification flow explained below.
How to Set Up a Payment Link
- Enable payments on your project. Open your dashboard, select your project, click Edit, set a Payment Callback URL, and tick the Enable Payments checkbox. No approval is needed — it activates instantly. Copy your Project ID.
- Enter the payment details. Add the Project ID, amount (up to 1,000,000), and a description your customer will recognize (up to 200 characters).
- Choose the payment currency and fee mode. Leave currency empty for Gammal Tech wallet payments in EGP, select
EGPfor local Egyptian cards, or choose an international currency (USD, EUR, GBP, etc.) for international cards. Choose whether the card service fee is added on top for the customer or absorbed so the customer pays the exact amount. - Choose one-time or recurring payment. Leave recurrence as one-time, or select monthly or yearly when using an international currency (not EGP or wallet).
- Generate and share the link. Click Generate Link, copy your link, and share it via WhatsApp, email, SMS, social media, QR code, or a button on your website.
Three Payment Modes
The payment mode is determined by the currency parameter in the link.
Wallet
Egyptian Card
EGP. Customer pays with a local Egyptian debit or credit card. No login needed.International Card
recurrence to monthly or yearly, the customer subscribes and their card is automatically charged on each billing cycle. Only available with international card payments (not EGP or wallet).Build the Link Manually
Every payment link follows this base URL:
https://api.gammal.tech/sdk/pay/link/?pid={PROJECT_ID}&amount={AMOUNT}&desc={DESCRIPTION}
Prefer that the customer is charged exactly the amount, with no card service fee added? Use the same parameters on this base URL instead (details in llms.txt):
https://api.gammal.tech/sdk/pay/link-no-fees/?pid={PROJECT_ID}&amount={AMOUNT}&desc={DESCRIPTION}
Add optional parameters as needed:
// Wallet payment (no currency: the customer pays from their Gammal Tech wallet)
https://api.gammal.tech/sdk/pay/link/?pid=5&amount=100&desc=Course+Access
// Egyptian card payment (currency=EGP)
https://api.gammal.tech/sdk/pay/link/?pid=5&amount=100&desc=Course+Access¤cy=EGP
// International card payment (any currency except EGP)
https://api.gammal.tech/sdk/pay/link/?pid=5&amount=10&desc=Pro+Plan¤cy=USD
// Monthly subscription (recurring, international card only)
https://api.gammal.tech/sdk/pay/link/?pid=5&amount=10&desc=Pro+Monthly¤cy=USD&recurrence=monthly
// Yearly subscription with callback (international card only)
https://api.gammal.tech/sdk/pay/link/?pid=5&amount=99&desc=Annual+Plan¤cy=USD&recurrence=yearly&callback=https://yoursite.com/thanks
// One time international card payment with callback
https://api.gammal.tech/sdk/pay/link/?pid=5&amount=50&desc=Premium¤cy=EUR&callback=https://yoursite.com/thanks
// Same payment, but the customer is charged exactly 50 EUR (no service fee added)
https://api.gammal.tech/sdk/pay/link-no-fees/?pid=5&amount=50&desc=Premium¤cy=EUR&callback=https://yoursite.com/thanks
Parameters Reference
| Parameter | Required | Description |
|---|---|---|
pid |
Required | Your Project ID. Find it in your dashboard. |
amount |
Required | Payment amount as a positive number, up to 1,000,000. Use a plain number like 19.99. Currencies without cents (JPY, KRW and similar) are charged in whole units. Very small amounts can be refused by the card network at checkout. |
desc |
Required | What the customer is paying for. Max 200 characters. Spaces can be + or %20. |
currency |
Optional |
If omitted: wallet mode (customer pays from their Gammal Tech balance in EGP). If EGP: Egyptian card mode (customer pays with a local Egyptian card).If any other currency: international card mode (customer pays with an international card). More than 130 currency codes are accepted (USD, EUR, GBP, AED, SAR, KWD, QAR, BHD, OMR, CAD, AUD, JPY, INR, CHF and so on). The builder lists the common ones; any other code goes in the link by hand. |
recurrence |
Optional |
Set to monthly or yearly to create a recurring subscription. The customer's card is automatically charged on each billing cycle.Only works with international card payments (when currency is set to something other than EGP). Ignored in wallet and Egyptian card modes.
|
callback |
Optional | HTTPS URL to redirect the customer after payment (at most 500 characters). If omitted, the customer sees a success page on Gammal Tech. You may include your own parameters, such as an order number; they are kept. |
Handling the Callback
When you provide a callback URL, the customer is redirected there after payment with these query parameters appended:
// Card payment success (EGP card or international card): carries a payment_token
https://yoursite.com/thanks?status=success&txn=GT-TXN-abc123...&payment_token=eyJhbGc...
// Wallet payment success (no currency in the link): status and txn only, no token
https://yoursite.com/thanks?status=success&txn=GT-TXN-abc123...
// Subscription success (includes subscription ID and recurrence)
https://yoursite.com/thanks?status=success&txn=GT-TXN-abc123...&payment_token=eyJhbGc...&subscription=sub_1abc...&recurrence=monthly
// Cancelled: the customer closed the payment page
https://yoursite.com/thanks?status=cancelled
txn parameter is the Gammal Tech transaction ID. Each one is unique and starts with GT-TXN-. For subscriptions, you also receive a subscription ID that you can store for reference. The payment_token is a signed proof of a card payment; the next section shows how to verify it. A wallet payment is confirmed on the hosted page and carries no token, so your page cannot prove it by itself: confirm it through the webhook (automatic) or in your Revenue Dashboard (by hand) before delivering.?status=success into their browser and visit your callback page without paying. Before delivering the product, you must verify the payment_token using our SDK. See Verify the Payment below.Verify the Payment
When the customer arrives at your callback page with ?payment_token=... in the URL, you need to verify it with Gammal Tech before delivering the product. Why? Two reasons:
- Prevent fakes. A malicious visitor could type
?status=successin the URL to fool a naive checkout page. Verifying thepayment_tokenwith us proves the payment is real. - Prevent double delivery. If a customer bookmarks the success URL, shares it, or reloads the page, you don't want to deliver the product twice. Our verification tells you whether this is the first time the token has been checked or a repeat.
Add this script to your callback page (the "thank you" page). That's it. No backend code, no API keys, no JWT libraries needed. (From a server, POST {"payment_token": "..."} to https://api.gammal.tech/sdk/pay/link/verify.php instead; same answer.)
<!-- Add to your thank-you page -->
<script src="https://api.gammal.tech/sdk/pay/link/verify.js"></script>
<script>
GammalVerify(function(payment) {
var url = new URLSearchParams(location.search);
if (payment.status === 1) {
// First verification: DELIVER THE PRODUCT NOW
// (also compare payment.project_id, payment.amount and payment.currency with what you sell)
console.log("Payment confirmed:", payment.currency, payment.amount);
} else if (payment.status === 2) {
// Already verified before: do NOT deliver again
console.log("This payment was already processed.");
} else if (payment.reason === "missing_token" && url.get("status") === "success") {
// Wallet payment: confirmed on the hosted page, no token here. Confirm via webhook or dashboard.
console.log("Wallet payment received:", url.get("txn"));
} else if (url.get("status") === "cancelled") {
// The customer closed the payment page. Not an error.
console.log("Payment cancelled.");
} else {
// Invalid or fake token
console.log("Payment could not be verified.");
}
});
</script>
Status codes
| Status | Meaning | What to do |
|---|---|---|
1 |
Valid, first verification. The token is genuine and has never been verified before. | Deliver the product. Mark the order as paid. Send confirmation email. |
2 |
Valid, but already verified. The token is genuine, but someone (often the customer reloading the page or following a bookmark) has verified it before. | Do not deliver again. Show the customer that their payment was already processed. You can still show order details from your database. |
0 |
Invalid. The token is fake, expired, malformed, or the request failed. | Do not deliver. Show an error and ask the customer to contact you if they believe this is a mistake. |
Full example with product delivery
A more complete example showing how to handle each status with real UI updates:
<div id="order-status">Checking your payment...</div>
<script src="https://api.gammal.tech/sdk/pay/link/verify.js"></script>
<script>
GammalVerify(function(payment) {
var el = document.getElementById("order-status");
var url = new URLSearchParams(location.search);
if (payment.status === 1) {
// Payment is real and this is the first time we're verifying it.
// Deliver the product now.
el.innerHTML = "Payment received: " + payment.currency + " " + payment.amount +
"<br>Your order is being prepared.";
// Now do whatever your app needs:
// - call your backend to mark the order as paid
// - unlock the digital download
// - send a confirmation email
// - redirect to the user's account page
deliverProduct(payment.txn, payment.amount, payment.currency);
} else if (payment.status === 2) {
// This token has been verified before. Do NOT deliver again.
// Show the customer their order status from your records.
el.innerHTML = "This payment was already processed on " +
payment.first_verified_at + ".";
} else if (payment.reason === "missing_token" && url.get("status") === "success") {
// Wallet payment (no token). Confirm it through the webhook or your Revenue Dashboard.
el.innerHTML = "Thank you! Your payment was received. We will activate your order shortly.";
} else if (url.get("status") === "cancelled") {
// The customer backed out at checkout. Not an error.
el.innerHTML = "Payment was cancelled. You can try again any time.";
} else {
// Invalid token: fake URL, expired, or network error.
el.innerHTML = "We could not verify your payment. " +
"If you were charged, please contact support.";
console.error("Verification failed:", payment.reason);
}
});
function deliverProduct(txn, amount, currency) {
// Your delivery logic here.
// Example: POST to your own backend
fetch("/api/orders/complete", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ txn: txn, amount: amount, currency: currency })
});
}
</script>
Response details
The payment object passed to your callback contains:
| Field | Type | Description |
|---|---|---|
status |
number | Always present. 0 = invalid, 1 = valid first time, 2 = valid but already verified. |
txn |
string | Transaction ID, starts with GT-TXN-. Present on status 1 and 2. |
amount |
number | Payment amount as a number. Present on status 1 and 2. |
currency |
string | Currency code (EGP, USD, EUR, etc). Present on status 1 and 2. |
description |
string | What the customer paid for. Present on status 1 and 2. |
project_id |
number | Your project ID. Always compare it (and the amount and currency) with what you sell before delivering: the verify endpoint is public and answers for any project's token. Present on status 1 and 2. |
first_verified_at |
string | Timestamp of the first verification, in YYYY-MM-DD HH:MM:SS format. Present only on status 2. |
verification_count |
number | How many times this token has been verified, including the current call. Present only on status 2. |
reason |
string | Short error code: invalid_signature, missing_token, network_error, timeout, etc. Present only on status 0. |
Advanced: explicit token and timeout
If the payment_token is somewhere other than the URL query string (a cookie, a hash fragment, a hidden form field, or fetched from your own backend), use GammalVerifyAdvanced:
<script src="https://api.gammal.tech/sdk/pay/link/verify.js"></script>
<script>
// Read the token from wherever you store it
var token = localStorage.getItem("my_payment_token");
GammalVerifyAdvanced({
payment_token: token, // optional, defaults to ?payment_token in URL
timeout: 15000 // optional, defaults to 10000 ms
}, function(payment) {
if (payment.status === 1) {
// Deliver the product
} else if (payment.status === 2) {
// Already verified: do not deliver again
} else {
// Invalid
}
});
</script>
txn as paid the moment you see it, before you deliver; if the delivery step fails afterwards, your record (or the Revenue Dashboard) tells you what to deliver by hand. The token is valid for about 5 minutes, so verify as soon as the customer arrives.Best practices
https://api.gammal.tech/sdk/pay/link/verify.php) rather than trusting what the browser sends it; status 1 or 2 from your backend's own call both prove the payment is genuine, and your records tell you whether it was already delivered. The txn is your unique reference for that payment.Tips
Order 123, Pro Plan): it comes back as description when you verify, and in the webhook. Or add your own parameter to the callback URL (https://yoursite.com/thanks?order=123); the builder encodes it for you and the customer returns to thanks?order=123&status=success&txn=....