⚡ Link Builder

Fill in your details and get a ready to use payment link instantly.

Find this in your dashboard
Max 200 characters. This is what the customer sees, and it comes back to you with the payment, so an order number here is a good idea.
Must be HTTPS. The customer is sent here after paying. You may add your own parameters, for example ?order=123.
Select an international currency (not EGP) to enable recurring payments.
Card payments only; wallet payments never have one. What each choice means for you is in llms.txt.

Your Payment Link
Open Link ↗

Three Payment Modes

The payment mode is determined by the currency parameter in the link.

👛

Wallet

No currency parameter. Customer pays from their Gammal Tech wallet balance in EGP. Phone, identity verification, then PIN.
🏦

Egyptian Card

Currency set to EGP. Customer pays with a local Egyptian debit or credit card. No login needed.
💳

International Card

Currency set to USD, EUR, GBP, etc. Customer pays with an international card. Supports recurring subscriptions. No login needed.
💡
Recurring payments. When you set 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).

Parameters Reference

ParameterRequiredDescription
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
📘
The 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.
⚠️
Never trust the URL alone. Anyone can type ?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:

  1. Prevent fakes. A malicious visitor could type ?status=success in the URL to fool a naive checkout page. Verifying the payment_token with us proves the payment is real.
  2. 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

StatusMeaningWhat 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:

FieldTypeDescription
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>
💡
Both functions are safe to call multiple times. You can refresh the page, the customer can revisit the URL, and the verification is always consistent. Status 1 is returned once per payment_token; every later call returns status 2. This is the replay protection that lets you deliver without worrying about double delivery. Because status 1 is given once, record the 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

📘
For digital products and instant delivery (downloads, account upgrades, course access), verify and deliver on the callback page directly. Status 1 means deliver; status 2 means show the existing order; status 0 means show an error.
📘
For physical products or anything requiring fulfillment, let your own backend verify the token itself (POST it to 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.
⚠️
If your delivery is high value (large amounts, business critical), also configure a webhook URL in your project settings. Webhooks fire server to server independently of the customer's browser: even if the customer closes the browser before the callback page loads, you still get notified. The webhook is also how your server hears about subscription renewals, wallet link payments, refunds and disputes.
Articles & Guides