Skip to content

Add Telr driver - #33

Merged
elbanbydev merged 1 commit into
mainfrom
feature/gateway-telr
Dec 4, 2026
Merged

elbanbydev merged 1 commit into
mainfrom
feature/gateway-telr

Conversation

@elbanbydev

Copy link
Copy Markdown
Owner

What this adds

Tahseel::gateway('telr') - a Gulf acquirer (UAE, Saudi Arabia, the wider region) on the hosted payment page. One endpoint does the work: POST /gateway/order.json, with method create for the page and check for a status read.

  • createPayment() - store id and auth key in the body as Telr documents, MAJOR-unit decimal-string amounts (95.00, never 9500), the three documented return urls. Returns order.ref and order.url.
  • verifyAndParseWebhook() - the documented advice hash: SHA1 of the secret key followed by the fourteen transaction fields (store, type, class, test, ref, prevref, firstref, currency, amount, cartid, desc, status, authcode, authmessage) colon-joined in that order, percent-encoded values decoded first and a missing field contributing an empty value, exactly as the docs say, compared in constant time. Status set honoured: A paid, H authorised-but-on-hold comes through pending, D/C/E fail, anything else refused.
  • fetchPaymentStatus() - the documented check call; the status text is matched against the documented messages and an unrecognised one is refused.

Honesty notes

  • Refunds are not wrapped. Telr documents them on a different product surface and I have not grounded that recipe, so the driver does not claim it. README, Arabic README and CHANGELOG all say so, and "What is not supported yet" lists it.
  • Fixture-tested only, no live Telr account has run it.

Metadata

README (EN) + docs/ar/README.md in sync (count 22 → 23, driver table, full ## Telr section), CHANGELOG [Unreleased], composer.json description + keywords (telr, uae, aed), config block + TELR_* env vars, every optional extra off by default.

Tests

16 fixture tests, including the two documented hash rules (percent-decoding, empty-for-missing). Suite 609 passed / 1452 assertions, PHPStan level 8 clean, Pint clean.

Telr is a Gulf acquirer (UAE, Saudi Arabia and the wider region) on the
hosted payment page. One endpoint does the work: POST /gateway/order.json,
with method create for the page and check for a status read.

- createPayment() returns order.ref and order.url.
- Transaction advice is verified the way Telr documents it: SHA1 of the
  secret key followed by the fourteen transaction fields, colon-joined in
  order, percent-encoded values decoded first and a missing field
  contributing an empty value, compared in constant time.
- A is paid, H is authorised but on hold and comes through pending, D, C and
  E fail, and anything outside the documented set is refused.
- Refunds are not wrapped: Telr documents them on a different product
  surface, and the docs say so.
@elbanbydev
elbanbydev merged commit 3c05a49 into main Dec 4, 2026
8 checks passed
@elbanbydev
elbanbydev deleted the feature/gateway-telr branch December 4, 2026 03:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants