PHPackages                             morpheusadam/anypay - 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. morpheusadam/anypay

ActiveLibrary[Payment Processing](/categories/payments)

morpheusadam/anypay
===================

Anypay is a comprehensive PHP,LARAVEL library for handling multiple payment gateway integrations seamlessly.

v1(2y ago)77MITPHPPHP &gt;=7.2

Since Jun 25Pushed 2w ago1 watchersCompare

[ Source](https://github.com/morpheusadam/anypay)[ Packagist](https://packagist.org/packages/morpheusadam/anypay)[ RSS](/packages/morpheusadam-anypay/feed)WikiDiscussions main Synced today

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

AnyPay
======

[](#anypay)

AnyPay is a PHP and Laravel library that puts more than 40 payment gateways behind one unified API, for developers who need to support several providers without writing a separate integration for each.

Overview
--------

[](#overview)

Instead of learning a different SDK for every bank or PSP, you write the checkout flow once and switch providers by changing a driver name. Every gateway follows the same `purchase → pay → verify` sequence.

The package bundles drivers for the major Iranian bank and PSP gateways (Mellat, Melli/Sadad, Saman, Parsian, Pasargad, Saderat, Zarinpal, IDPay, Zibal and others), wallet and installment (BNPL) providers (Azki, Etebarino, Walleta, Digipay, Vandar, Toman), and international gateways such as PayPal and Bitpay. It ships with Laravel auto-discovery — service provider and facade — and also works in plain PHP projects.

Features
--------

[](#features)

- More than 40 payment gateways behind one driver-based interface.
- The same `purchase()`, `pay()` and `verify()` flow regardless of gateway.
- Dedicated exceptions for invalid payments, failed purchases, and missing drivers or invoices.
- Configuration passed inline or loaded from a published config file.
- Payment lifecycle events you can hook into.
- Auto-registered Laravel service provider and `Anypay` facade; usable standalone.
- Supports card gateways as well as BNPL and installment providers.

Supported gateways
------------------

[](#supported-gateways)

The following drivers are bundled under `src/Drivers/`:

AqayepardakhtAsanpardakhtAtipayAzki *(installment)*Behpardakht *(Mellat)*BitpayDigipayEtebarino *(installment)*FanavacardGooyapayIDPayIrankishJibitLocalMinipayNextpayOmidpayParsianPasargadPayfaPay.irPayPalPaypingPaystarPoolamRayanpaySadad *(Melli)*SamanSEP *(Saman Electronic)*Sepehr *(Saderat)*SepordehSizpayTomanVandarWalleta *(installment)*YekpayZarinpalZibalTech stack
----------

[](#tech-stack)

ComponentTechnologyLanguagePHP &gt;= 7.2FrameworkLaravel (service provider and facade; works standalone)HTTP clientGuzzleUtilitiesCarbon (dates), Ramsey UUID, chillerlan/php-cacheInstallComposer (PSR-4: `Morpheusadam\Anypay\`)Requirements
------------

[](#requirements)

- PHP 7.2 or higher
- Composer

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

[](#installation)

```
composer require morpheusadam/AnyPay
```

In Laravel, the service provider and `Anypay` facade are auto-discovered; no manual registration is required.

Usage
-----

[](#usage)

### Create and pay an invoice

[](#create-and-pay-an-invoice)

```
$config  = ['driver' => 'gatewayName', 'api_key' => 'your_api_key'];
$anypay  = new Morpheusadam\Anypay\Anypay($config);

$invoice = new Morpheusadam\Anypay\Invoice();
$invoice->amount(1000); // amount in Rials

$anypay->via('gatewayName')->purchase($invoice)->pay();
```

### Quick pay with the `payWith` helper

[](#quick-pay-with-the-paywith-helper)

```
$config  = ['api_key' => 'your_api_key'];
$gateway = 'gatewayName';
$amount  = 1000; // amount in Rials

try {
    $anypay   = new Morpheusadam\Anypay\Anypay($config);
    $response = $anypay->payWith($gateway, $amount, $config);
    echo $response->getContent(); // payment response details
} catch (Exception $e) {
    echo 'Payment error: ' . $e->getMessage();
}
```

### Verify a payment on the callback

[](#verify-a-payment-on-the-callback)

```
try {
    $anypay  = new Morpheusadam\Anypay\Anypay($config);
    $receipt = $anypay->verify();
    echo 'Payment confirmed. Transaction ID: ' . $receipt->getTransactionId();
} catch (Exception $e) {
    echo 'Verification error: ' . $e->getMessage();
}
```

### Laravel facade with a published config

[](#laravel-facade-with-a-published-config)

```
use Morpheusadam\Anypay\Facades\Anypay;

$invoice = (new Invoice)->amount(1000);

Anypay::via('driverName')->purchase($invoice, function ($driver, $transactionId) {
    // store $transactionId against the order
});
```

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

[](#contributing)

Open an [issue](https://github.com/morpheusadam/AnyPay/issues) or submit a pull request to add a gateway driver, fix a bug, or improve the docs.

License
-------

[](#license)

Distributed under the MIT License. See [`LICENSE`](LICENSE) for full terms.

Author
------

[](#author)

Morpheus Adam — web developer, PHP, Laravel, Go.

- GitHub: [morpheusadam](https://github.com/morpheusadam)
- Website: [sam.zeonic.me](https://sam.zeonic.me)
- Email:

###  Health Score

31

—

LowBetter than 65% of packages

Maintenance63

Regular maintenance activity

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor1

Top contributor holds 77.8% 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

Unknown

Total

1

Last Release

783d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/171357505?v=4)[morpheus](/maintainers/morpheusadam)[@morpheusadam](https://github.com/morpheusadam)

---

Top Contributors

[![morpheusadam](https://avatars.githubusercontent.com/u/171357505?v=4)](https://github.com/morpheusadam "morpheusadam (7 commits)")[![samgeeksdev](https://avatars.githubusercontent.com/u/162323631?v=4)](https://github.com/samgeeksdev "samgeeksdev (2 commits)")

---

Tags

bnplcomposer-packageiran-paymentlaravelonline-paymentpayment-gatewaypayment-integrationpaypalphpunified-apizarinpalpayment gatewayPHP payment integrationmulti-gateway supportpayment processing libraryIran payment gatewayIranian payment solutionsIran online paymentsIran payment systemsIranian banks integrationIran bank payment APIIran financial servicesIranian local payment gatewayIranian bank transactions

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/morpheusadam-anypay/health.svg)

```
[![Health](https://phpackages.com/badges/morpheusadam-anypay/health.svg)](https://phpackages.com/packages/morpheusadam-anypay)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.9k556.2M21.5k](/packages/laravel-framework)[shetabit/multipay

PHP Payment Gateway Integration Package

298368.9k4](/packages/shetabit-multipay)[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.2k99.8M354](/packages/laravel-horizon)[statamic/cms

The Statamic CMS Core Package

4.9k3.8M1.2k](/packages/statamic-cms)[leantime/leantime

Open source project management system for non-project managers. Simple like Trello, powerful like Jira. Built with neurodiversity in mind.

11.3k4.0k](/packages/leantime-leantime)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.8M672](/packages/shopware-core)

PHPackages © 2026

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