Skip to content

Add Anor Bank driver #2

Description

@SamDevXuz

Goal

Add support for Anor Bank notification bot messages by implementing a new AnorbankDriver, alongside the existing ClickDriver, PaymeDriver, and UzumDriver.

This is a great first contribution — the pattern is well established, the driver base class does most of the work, and you only need to provide a few regex patterns plus tests.

Why

CONTRIBUTING.md lists new bank drivers (Anor, Asaka, TBC, Hamkorbank, Davr) as the highest-impact contribution right now. Each new driver lets more Uzbek merchants use the package without writing custom parsing.

What to do

  1. Create the driver at src/Drivers/AnorbankDriver.php, extending AbstractRegexDriver. Look at src/Drivers/ClickDriver.php for a minimal reference — you'll override:

    • incomingMarkers(): array — Uzbek/Russian phrases that indicate incoming transfer (e.g. hisobingizga tushdi, qabul qilindi, зачислен, поступил).
    • amountPatterns(): array — regexes that capture the amount, with currency suffix (so'm, сум, UZS).
    • transactionPatterns(): array — regexes for transaction/cheque IDs if Anor Bank includes them.
  2. Register the driver in config/algorix-pay.php under the drivers key. Mirror the existing entries — add an enabled flag and a default source (the bot's Telegram username, lower-case, no @). Also expose env vars (ALGORIX_ANOR_ENABLED, ALGORIX_ANOR_SOURCE).

  3. Add tests at tests/Unit/AnorbankDriverTest.php with at minimum:

    • one real incoming-transfer message that parses correctly (amount in tiyin, currency, optional transactionId, optional sender/receiver card masks),
    • one outgoing transfer message that must return null,
    • one unrelated message (login OTP, balance check, marketing) that must return null.
  4. Update README.md — add ALGORIX_ANOR_* to the env table and mention Anor Bank in the supported-banks list.

Helpful pointers

  • Money is stored in tiyin (1 so'm = 100 tiyin). AbstractRegexDriver::amountToTiyin() already handles thousand separators and decimals — you just need to capture the digit group.
  • looksLikeOutgoing() in the base class already filters common outgoing markers (yechildi, списан, etc.). Don't duplicate that logic.
  • declare(strict_types=1);, final class, and constructor property promotion are required per CONTRIBUTING.md.

Need real message samples?

If you don't have access to Anor Bank notifications yourself, that's fine — open a comment on this issue and we'll coordinate. Anonymized samples (mask card numbers, amounts can be real) are extremely welcome on their own, even without code.

Definition of done

  • src/Drivers/AnorbankDriver.php exists and extends AbstractRegexDriver.
  • Registered in config/algorix-pay.php.
  • tests/Unit/AnorbankDriverTest.php passes locally (vendor/bin/phpunit --testdox).
  • README env table updated.
  • CI green on the PR.

Questions? Just drop a comment — happy to help you get unblocked.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions