Use this skill for eGHL payment gateway integration work. eGHL is now branded ADAPTIS by NTT DATA Payment Services; the API, hosts, and field names are still the eGHL ones.
Source
Read references/eghl-api.md before giving factual API guidance or writing integration code. It contains the endpoint catalogue, payment URLs, request and response field tables, the exact hash string orders, return vs callback handling, Query/Refund/Reversal/Capture/Settle/SOPBL, amount rules, and gotchas.
Read references/eghl-codes.md for enums: TransactionType, PymtMethod, TxnStatus, TokenType, currencies, data types, acknowledgement bodies, and validator error messages.
Read references/account-setup.md when the user asks how to register, which credentials are needed, where they come from, test vs live, the ADAPTIS rebrand, plugins, pricing, or downtime notices.
Read references/source-map.md when choosing which official source (Bitbucket SDK, plugin, guide PDF, NTT DATA page) backs a fact.
The full eGHL Merchant API specification is distributed to merchants and is not published openly. Facts here come from eGHL's official public Bitbucket SDKs and plugins. When a detail is not in those sources, say so and tell the user to confirm with their account manager.
Core Workflow
- Identify environment: test (
pay.e-ghl.com) or live (securepay.e-ghl.com). - Confirm credentials: Merchant Service ID (
ServiceID, 3 chars) and Merchant Password, issued by eGHL/ADAPTIS. - Create a local pending payment with a unique
PaymentID(max 20 chars) and yourOrderNumber. - Build the SALE request server-side and compute
HashValue= SHA-256 over password + the SALE fields in the documented order. - Send the browser to
Payment.aspxwith an auto-submitting HTML form (POST). - Handle
MerchantCallBackURL(server to server): verifyHashValue2, settle idempotently, reply with the plain textOK. - Handle
MerchantReturnURL(browser): verifyHashValue2, show the result; settle only if the callback has not already done so, using the same idempotent code. - For
TxnStatus=2(pending) or a missing callback, requery withTransactionType=QUERYand verify the responseHashValue. - Refund (cards only), reverse (
RSALE), or capture (AUTHthenCAPTURE) through the samePayment.aspxendpoint with a signed server-side POST.
Core Facts
- Live payment URL:
https://securepay.e-ghl.com/IPG/Payment.aspx. - Test payment URL:
https://pay.e-ghl.com/IPGSG/payment.aspx. - Query, Refund, Reversal, and Capture are server-side form POSTs to the same URL; the response is a URL-encoded string.
- Hash algorithm: lowercase hex
sha256(MerchantPassword + field1 + field2 + ...), no separators, missing optional fields contribute an empty string. - SALE
HashValueorder:ServiceID, PaymentID, MerchantReturnURL, MerchantApprovalURL, MerchantUnApprovalURL, MerchantCallBackURL, Amount, CurrencyCode, CustIP, PageTimeout, CardNo, Token. - Payment response
HashValue2order:TxnID, ServiceID, PaymentID, TxnStatus, Amount, CurrencyCode, AuthCode, OrderNumber, Param6, Param7. - Query/Refund/Reversal/Capture request hash order:
ServiceID, PaymentID, Amount, CurrencyCode. - API response
HashValueorder:TxnID, ServiceID, PaymentID, TxnStatus, Amount, CurrencyCode, AuthCode. TxnStatus:0success,1failed,2pending; Query adds9reversed,10refunded,15authorised,16captured,31reversal pending,-1not found,-2system error.TxnStatus=1withTxnMessageBuyer cancelledmeans the shopper cancelled.- Amount is ringgit (major unit) with exactly 2 decimals and no commas, for example
10.00. - URLs inside request fields use
;instead of&in query strings. - Callback must answer with the body
OK. PymtMethodvalues used in official plugins:ANY,CC(card),DD(direct debit / online banking),WA(e-wallet).- Online refund is supported only for
PymtMethod=CC; partial refund allowed up to the original amount.
Critical Rules
- Keep the Merchant Password server-side only; never compute hashes in the browser.
- Do not mark paid from the return URL alone without verifying
HashValue2, and never trustTxnStatusfrom an unverified request. - Compare hashes in constant time, case-insensitively (official plugins use case-insensitive compare).
- Before settling, check
ServiceID,PaymentID,OrderNumber,Amount,CurrencyCode, andTransactionTypeagainst your stored pending payment. - Make settlement idempotent: callback and return can both arrive, and callbacks can repeat. A late
failedmust not overwrite a paid order. - Use a fresh unique
PaymentIDper attempt. Official plugins resend the sameOrderNumberon retries of one order, but keepOrderNumberunique per order across every store sharing a Service ID (WooCommerce: "ADAPTIS will not allow orders with the same invoice number"). - Load the Merchant Password from server config only. The official PrestaShop 1.6 handler accepts a password from the request; do not copy it.
- Reject a response whose
CurrencyCodediffers from the order unless your account uses shopper currency choice (then see Multi-Currency inreferences/eghl-api.md). - Use the password and URL for the same environment; test and live credentials are different.
- Treat
pending(2) as unresolved; requery later instead of failing the order. - Do not invent other endpoints (REST, JSON, webhooks with headers). None are in the official public sources. Do not build
SETTLE,SOP,SOP2, orSOPCARDwithout the merchant API spec; only partial details are public.
Completion Criteria
An eGHL integration is done only when:
- SALE request and
HashValueare built server-side with correct field order, 2-decimal amount, and;-escaped URLs. - Callback handler verifies
HashValue2, settles idempotently, and respondsOK. - Return handler verifies
HashValue2and shares the same settlement code. - Amount, currency,
PaymentID,OrderNumber, andServiceIDmatch the stored payment before marking paid. - Pending and missing-callback cases use QUERY with response
HashValueverification. - Tests cover bad hash, duplicate callback, wrong amount/currency, buyer cancelled, pending then success, and success.
- Deployment docs list
EGHL_SERVICE_ID,EGHL_MERCHANT_PASSWORD,EGHL_PAYMENT_URL, return URL, callback URL, and test/live separation.
Loophole Review Loop
When asked whether an eGHL strategy is "100% confident", run this loop until no factual gaps remain:
- List trust boundaries: browser form post, return URL, callback URL, hash builder, Payment.aspx, query job, refund job, database, fulfilment.
- Check bypasses: forged return post, hash over wrong field order, unescaped
&in URLs, amount formatting mismatch (10vs10.00), test/live password mix, reusedPaymentID, duplicate callback, late failed after success, pending treated as failed, refund on non-card method, reversal after bank settlement. - Add fixes: server-side hashing, strict field matching, idempotent state machine, QUERY fallback with hash check, environment-separated config,
OKacknowledgement only after durable write. - Re-read
references/eghl-api.mdsections relevant to any gap. - State remaining uncertainty: anything only in the private API spec (callback retry schedule, IP allowlist, full error code list, recurring/tokenisation details, sandbox test cards) must be confirmed with eGHL/ADAPTIS support.