PHPackages                             azozzalfiras/payment-gateway - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. azozzalfiras/payment-gateway

ActiveLibrary[Payment Processing](/categories/payments)

azozzalfiras/payment-gateway
============================

A unified PHP library for integrating with MENA payment gateways: MyFatoorah, Paylink, and EdfaPay

v1.0.2(3mo ago)08MITPHPPHP ^8.1

Since Apr 2Pushed 3mo agoCompare

[ Source](https://github.com/AzozzALFiras/payment-gateway)[ Packagist](https://packagist.org/packages/azozzalfiras/payment-gateway)[ RSS](/packages/azozzalfiras-payment-gateway/feed)WikiDiscussions main Synced 2d ago

READMEChangelogDependencies (2)Versions (4)Used By (0)

Payment Gateway PHP Library
===========================

[](#payment-gateway-php-library)

[![PHP Version](https://camo.githubusercontent.com/d94da5b84eac3af68cb611609ef21f04dff28b2bfb3daf366d3922a79a475838/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253545382e312d626c75652e737667)](https://www.php.net/)[![License](https://camo.githubusercontent.com/8bb50fd2278f18fc326bf71f6e88ca8f884f72f179d3e555e20ed30157190d0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e737667)](LICENSE)[![Composer](https://camo.githubusercontent.com/7dff382c24b651cdf57824710537d4905f553dd0449b6da4ba6922a726485a79/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436f6d706f7365722d617a6f7a7a616c66697261732532467061796d656e742d2d676174657761792d6f72616e67652e737667)](https://packagist.org/packages/azozzalfiras/payment-gateway)

A **unified**, **extensible** PHP Composer package for integrating with **18 payment gateways** (Middle East + Iraq + Europe + International). Built with clean architecture, full API coverage, zero external dependencies, and enterprise-grade security.

---

Table of Contents
-----------------

[](#table-of-contents)

- [Supported Gateways](#supported-gateways)
- [Installation](#installation)
- [Quick Start](#quick-start)
- [Factory Pattern](#factory-pattern)
- [Feature Matrix](#feature-matrix)
- [Documentation](#documentation)
- [Testing](#testing)
- [Contributing](#contributing)
- [License](#license)

---

Supported Gateways
------------------

[](#supported-gateways)

  [![](assets/logos/myfatoorah.png)](assets/logos/myfatoorah.png)
**MyFatoorah** [![](assets/logos/paylink.png)](assets/logos/paylink.png)
**Paylink** [![](assets/logos/edfapay.png)](assets/logos/edfapay.png)
**EdfaPay** [![](assets/logos/tap.png)](assets/logos/tap.png)
**Tap** [![](assets/logos/clickpay.png)](assets/logos/clickpay.png)
**ClickPay**   [![](assets/logos/tamara.png)](assets/logos/tamara.png)
**Tamara** [![](assets/logos/thawani.png)](assets/logos/thawani.png)
**Thawani** [![](assets/logos/fatorah.png)](assets/logos/fatorah.png)
**Fatora** [![](assets/logos/payzaty.png)](assets/logos/payzaty.png)
**Payzaty** [![](assets/logos/payzah.png)](assets/logos/payzah.png)
**Payzah**   [![](assets/logos/stripe.png)](assets/logos/stripe.png)
**Stripe** [![](assets/logos/paypal.png)](assets/logos/paypal.png)
**PayPal** [![](assets/logos/neonpay.png)](assets/logos/neonpay.png)
**NeonPay** [![](assets/logos/asiapay.png)](assets/logos/asiapay.png)
**AsiaPay** [![](assets/logos/zaincash.png)](assets/logos/zaincash.png)
**ZainCash**   [![](assets/logos/mollie.png)](assets/logos/mollie.png)
**Mollie** [![](assets/logos/redsys.png)](assets/logos/redsys.png)
**Redsys** [![](assets/logos/gocardless.png)](assets/logos/gocardless.png)
**GoCardless** GatewayRegionClassesKey FeaturesAuthentication**MyFatoorah**Middle East5Payments, Sessions, Invoices, Customers, WebhooksAPI Key (Bearer)**Paylink**Middle East5Invoices, Digital Products, Reconciliation, WebhooksAPI ID + Secret Key**EdfaPay**Middle East6Checkout, Embedded S2S, Apple Pay, Recurring, RefundsClient Key + Password**Tap**Middle East7Charges, Authorize/Void, Refunds, Invoices, Customers, TokensSecret Key (Bearer)**ClickPay**Middle East3Hosted Page, Auth/Capture/Void/Refund, TokenizationServer Key**Tamara**Middle East4BNPL Checkout, Order Authorize/Capture/Cancel, RefundsAPI Token (Bearer)**Thawani**Middle East4Checkout Sessions, Payment Intents, Customer ManagementSecret + Publishable Key**Fatora**Middle East4Checkout, Verify, Refunds, Recurring (Card Tokenization)API Key**Payzaty**Middle East3Secure Checkout, Mada/VISA/MC/Apple Pay/STC PayAccount No + Secret Key**Payzah**Middle East3Hosted Checkout, K-Net/VISA/MC/Apple Pay/AmexPrivate Key**NeonPay**Middle East3Payments, Refunds, Webhooks (EBIK Key Auth)EBIK Key (Header)**AsiaPay**Middle East4Orders, Refunds, JWT Auth, WebhooksApp Key + Secret (JWT)**ZainCash**Middle East3Transactions, JWT HS256 Auth, WebhooksMerchant ID + Secret (JWT)**Stripe**International6Checkout Sessions, Charges, Customers, Refunds, WebhooksSecret Key (Bearer)**PayPal**International6Orders, Captures, Authorizations, Refunds, OAuth 2.0Client ID + Secret (OAuth)**Mollie**Europe5Payments, Refunds, Customers, iDEAL, SEPA, KlarnaAPI Key (Bearer)**Redsys**Europe3Payments, Refunds, 3DES + HMAC-SHA256 SigningMerchant Key (3DES)**GoCardless**Europe5Payments, Mandates, Refunds, Direct Debit, WebhooksAccess Token (Bearer)> **79 PHP classes** across 18 gateways organized in 3 regions: `International/`, `MiddleEast/`, `Europe/`

---

Installation
------------

[](#installation)

```
composer require azozzalfiras/payment-gateway
```

RequirementVersionPHP&gt;= 8.1ext-curlRequiredext-jsonRequiredext-mbstringRequired---

Quick Start
-----------

[](#quick-start)

```
use AzozzALFiras\PaymentGateway\PaymentGateway;
use AzozzALFiras\PaymentGateway\Enums\Gateway;
use AzozzALFiras\PaymentGateway\Enums\PaymentStatus;
use AzozzALFiras\PaymentGateway\DTOs\PaymentRequest;
use AzozzALFiras\PaymentGateway\DTOs\Customer;

// Create gateway from enum
$gateway = PaymentGateway::create(Gateway::TAP->value, [
    'secret_key' => 'sk_test_xxx',
    'testMode'   => true,
]);

// Or use typed static factory
$gateway = PaymentGateway::stripe(['secret_key' => 'sk_test_xxx', 'testMode' => true]);

// Purchase
$response = $gateway->purchase(new PaymentRequest(
    amount:      100.00,
    currency:    'SAR',
    orderId:     'ORDER-001',
    description: 'Premium Plan',
    callbackUrl: 'https://yoursite.com/callback',
    customer:    new Customer(name: 'Ahmed', email: 'ahmed@example.com'),
));

// Redirect customer to payment page
header("Location: {$response->paymentUrl}");

// Check payment status
$status = $gateway->status($response->transactionId);

// Gateway metadata from enum
echo Gateway::TAP->label();           // "Tap Payments"
echo Gateway::TAP->region();          // "MiddleEast"
echo Gateway::TAP->supportsRefund();  // true
echo Gateway::TAP->countries();       // ['KWT', 'SAU', 'ARE', ...]
```

---

Factory Pattern
---------------

[](#factory-pattern)

```
use AzozzALFiras\PaymentGateway\PaymentGateway;

// 1. Generic factory — accepts any driver name string
$gateway = PaymentGateway::create('tap', ['secret_key' => '...']);

// 2. Typed static factory — full IDE autocomplete per gateway
$gateway = PaymentGateway::myfatoorah([...]);
$gateway = PaymentGateway::paylink([...]);
$gateway = PaymentGateway::edfapay([...]);
$gateway = PaymentGateway::tap([...]);
$gateway = PaymentGateway::clickpay([...]);
$gateway = PaymentGateway::tamara([...]);
$gateway = PaymentGateway::thawani([...]);
$gateway = PaymentGateway::fatora([...]);
$gateway = PaymentGateway::payzaty([...]);
$gateway = PaymentGateway::payzah([...]);
$gateway = PaymentGateway::stripe([...]);
$gateway = PaymentGateway::paypal([...]);
$gateway = PaymentGateway::neonpay([...]);
$gateway = PaymentGateway::asiapay([...]);
$gateway = PaymentGateway::zaincash([...]);
$gateway = PaymentGateway::mollie([...]);
$gateway = PaymentGateway::redsys([...]);
$gateway = PaymentGateway::gocardless([...]);

// List all 18 available driver names
PaymentGateway::getAvailableDrivers();
```

---

Feature Matrix
--------------

[](#feature-matrix)

Feature[![](assets/logos/myfatoorah.png)](assets/logos/myfatoorah.png)[![](assets/logos/paylink.png)](assets/logos/paylink.png)[![](assets/logos/edfapay.png)](assets/logos/edfapay.png)[![](assets/logos/tap.png)](assets/logos/tap.png)[![](assets/logos/clickpay.png)](assets/logos/clickpay.png)[![](assets/logos/tamara.png)](assets/logos/tamara.png)[![](assets/logos/thawani.png)](assets/logos/thawani.png)[![](assets/logos/fatorah.png)](assets/logos/fatorah.png)[![](assets/logos/payzaty.png)](assets/logos/payzaty.png)[![](assets/logos/payzah.png)](assets/logos/payzah.png)[![](assets/logos/stripe.png)](assets/logos/stripe.png)[![](assets/logos/paypal.png)](assets/logos/paypal.png)[![](assets/logos/neonpay.png)](assets/logos/neonpay.png)[![](assets/logos/asiapay.png)](assets/logos/asiapay.png)[![](assets/logos/zaincash.png)](assets/logos/zaincash.png)[![](assets/logos/mollie.png)](assets/logos/mollie.png)[![](assets/logos/redsys.png)](assets/logos/redsys.png)[![](assets/logos/gocardless.png)](assets/logos/gocardless.png)Purchase✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅Status✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅Refund✅—✅✅✅✅—✅——✅✅✅✅—✅✅✅Recurring——✅✅✅—✅✅——✅———————Auth/Capture✅—✅✅✅✅————✅✅——————Customer CRUD✅——✅——✅———✅————✅——Direct Debit—————————————————✅Webhook✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅---

Documentation
-------------

[](#documentation)

DocumentDescription**[Gateway Reference](docs/GATEWAYS.md)**Configuration, code examples, and sub-modules for all 18 gateways**[Architecture](docs/ARCHITECTURE.md)**Project structure, directory tree, and design principles**[Security](docs/SECURITY.md)**Signature verification, input sanitization, and best practices**[Webhooks](docs/WEBHOOKS.md)**Unified webhook handling across all gateways**[Database Integration](docs/DATABASE.md)**SQL schemas, models, and full payment flow examples**[Contributing](docs/CONTRIBUTING.md)**How to add gateways, code style, and PR guidelines---

Testing
-------

[](#testing)

```
composer install
composer test       # PHPUnit
composer analyse    # PHPStan Level 5
```

**Current test results:**

- PHPUnit: 135 tests, 281 assertions — all passing
- PHP Lint: all files — zero syntax errors
- PHPStan Level 5: 0 errors

---

Contributing
------------

[](#contributing)

We welcome pull requests! Whether you're adding a new payment gateway, fixing bugs, or improving documentation.

See **[CONTRIBUTING.md](docs/CONTRIBUTING.md)** for detailed guidelines on:

- How to add a new gateway (file structure, contracts, registration)
- Code style (PHP 8.1+, PSR-12, strict types)
- Testing requirements
- PR process

---

License
-------

[](#license)

MIT License — see [LICENSE](LICENSE) file.

---

Author
------

[](#author)

**AzozzALFiras** — [GitHub](https://github.com/AzozzALFiras)

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance82

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~19 days

Total

3

Last Release

93d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/33958581?v=4)[Azozz ALFiras ](/maintainers/AzozzALFiras)[@AzozzALFiras](https://github.com/AzozzALFiras)

---

Top Contributors

[![AzozzALFiras](https://avatars.githubusercontent.com/u/33958581?v=4)](https://github.com/AzozzALFiras "AzozzALFiras (11 commits)")

---

Tags

payment-gatewaypayment-integrationphpcomposerpayment processingpaymentgatewaymyfatoorahpaylinksaudikuwaitmenaedfapay

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/azozzalfiras-payment-gateway/health.svg)

```
[![Health](https://phpackages.com/badges/azozzalfiras-payment-gateway/health.svg)](https://phpackages.com/packages/azozzalfiras-payment-gateway)
```

###  Alternatives

[sudiptpa/omnipay-nabtransact

National Australia Bank (NAB) Transact driver for the Omnipay payment processing library.

1020.1k](/packages/sudiptpa-omnipay-nabtransact)[baklysystems/laravel-paymob

Laravel PayMob online payment gateway package

292.4k](/packages/baklysystems-laravel-paymob)[lucassmacedo/omnipay-mercadopago

MercadoPago gateway for OmniPay

155.7k](/packages/lucassmacedo-omnipay-mercadopago)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
