PHPackages                             noorani-mm/irankish-laravel-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. noorani-mm/irankish-laravel-gateway

ActiveLibrary[Payment Processing](/categories/payments)

noorani-mm/irankish-laravel-gateway
===================================

Laravel package for integrating IranKish payment gateway (درگاه پرداخت ایران کیش برای لاراول)

v1.0.0(6mo ago)113MITPHPPHP &gt;=8.1CI passing

Since Nov 9Pushed 6mo agoCompare

[ Source](https://github.com/Noorani-MM/irankish-laravel-gateway)[ Packagist](https://packagist.org/packages/noorani-mm/irankish-laravel-gateway)[ Docs](https://github.com/noorani-mm/irankish-laravel-gateway)[ RSS](/packages/noorani-mm-irankish-laravel-gateway/feed)WikiDiscussions main Synced 1mo ago

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

IranKish Laravel Gateway
========================

[](#irankish-laravel-gateway)

[![Latest Version on Packagist](https://camo.githubusercontent.com/aa48c9bd5283f0209244df9cea89b1dc7b5c7e92e7c777d6563b42b2e335d121/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e6f6f72616e692d6d6d2f6972616e6b6973682d6c61726176656c2d676174657761792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/noorani-mm/irankish-laravel-gateway)[![Total Downloads](https://camo.githubusercontent.com/03f557726c641118f728c378d7d3fffc82ad645206e48f846c90ef832a609e6d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e6f6f72616e692d6d6d2f6972616e6b6973682d6c61726176656c2d676174657761792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/noorani-mm/irankish-laravel-gateway)[![License: MIT](https://camo.githubusercontent.com/784362b26e4b3546254f1893e778ba64616e362bd6ac791991d2c9e880a3a64e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e2e737667)](LICENSE)[![Tests](https://github.com/noorani-mm/irankish-laravel-gateway/actions/workflows/tests.yml/badge.svg)](https://github.com/noorani-mm/irankish-laravel-gateway/actions)

> A modern and developer-friendly **Laravel integration for the IranKish Payment Gateway (IPG)**,
> implemented fully according to the [official technical documentation V9](https://www.irankish.com/App_Data_Public/IPG/IPG_TechnicalGuide.V9.pdf).

---

🚀 Installation
--------------

[](#-installation)

```
composer require noorani-mm/irankish-laravel-gateway
```

---

⚙️ Configuration
----------------

[](#️-configuration)

After installation, publish the configuration file:

```
php artisan vendor:publish --provider="IranKish\IranKishServiceProvider" --tag="config"
```

This creates the file: `config/irankish.php`

### `.env` variables

[](#env-variables)

```
IRANKISH_TERMINAL_ID=12345678
IRANKISH_ACCEPTOR_ID=87654321
IRANKISH_PASSWORD=YourSecurePassword
IRANKISH_PUBLIC_KEY="-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkq...\n-----END PUBLIC KEY-----"
IRANKISH_REVERT_URL=https://example.com/payment/callback
```

### `config/irankish.php`

[](#configirankishphp)

```
return [
    'terminal_id' => env('IRANKISH_TERMINAL_ID'),
    'acceptor_id' => env('IRANKISH_ACCEPTOR_ID'),
    'password'    => env('IRANKISH_PASSWORD'),
    'public_key'  => env('IRANKISH_PUBLIC_KEY'),
    'revert_url'  => env('IRANKISH_REVERT_URL'),
];
```

---

💳 Example Usage
---------------

[](#-example-usage)

```
use IranKish\Facades\IranKish;
use IranKish\Enums\TransactionType;
use IranKish\Exceptions\IranKishException;
use Illuminate\Http\Request;

class PaymentController extends Controller
{
    public function pay()
    {
        try {
            // Step 1: Request token
            $response = IranKish::requestToken(150000, TransactionType::PURCHASE, [
                'paymentId' => 'ORDER-1234',
            ]);

            // Step 2: Redirect user to payment page (auto-submit form)
            return IranKish::redirect($response['token']);

            // OR (manual redirect data)
            // $redirect = IranKish::redirectData($response['token']);
            // return view('payments.redirect', compact('redirect'));
        }
        catch (IranKishException $e) {
            return back()->withErrors($e->getMessage());
        }
    }

    public function callback(Request $request)
    {
        try {
            // Step 3: Confirm transaction
            $confirmation = IranKish::confirm(
                $request->input('tokenIdentity'),
                $request->input('retrievalReferenceNumber'),
                $request->input('systemTraceAuditNumber')
            );

            return response()->json(['status' => 'success', 'data' => $confirmation]);
        }
        catch (IranKishException $e) {
            return response()->json(['status' => 'failed', 'message' => $e->getMessage()]);
        }
    }
}
```

---

📘 Methods Reference
-------------------

[](#-methods-reference)

MethodDescription**`requestToken(int $amount, ?TransactionType $type = null, array $options = [])`**Create a payment token using the `/tokenization/make` endpoint.**`requestSpecialToken(int $amount, ?TransactionType $type = null, array $options = [])`**Same as `requestToken` but for special merchants (e.g., AsanShpWPP, IsacoWPP).**`redirect(string $token)`**Automatically renders a POST form and redirects the payer to IranKish payment page.**`redirectData(string $token)`**Returns redirection data array for manual handling or SPA redirects.**`confirm(string $token, string $rrn, string $stan)`**Confirms the transaction after return from payment page.**`reverse(string $token, string $rrn, string $stan)`**Reverses a previously successful transaction (before settlement).**`inquiry(array $criteria)`**Checks transaction status by RRN, tokenIdentity, or requestId.---

🧠 Transaction Types
-------------------

[](#-transaction-types)

EnumMeaning`Purchase`Standard purchase`Bill`Bill payment`AsanShpWPP`AsanShp wallet`SpecialBill`Special bill payments`AsanShpWPPDrug`AsanShp Drug Wallet`IsacoWPP`ISACO Wallet Payment---

🧪 Running Tests
---------------

[](#-running-tests)

The package includes a complete test suite using **Orchestra Testbench** and `Http::fake()`.

```
composer install
composer test
```

To re-run cleanly:

```
rm -rf vendor
composer install && composer test
```

📁 All tests are located in `/tests`. A fake public key (`tests/stubs/pubkey.pem`) is included for encryption testing.

---

💡 Development Notes
-------------------

[](#-development-notes)

- Compatible with **Laravel 10.x – 14.x**
- Built following PSR-4, PSR-12, and Laravel package conventions
- Fully supports `Http::fake()` for integration testing
- AES-128 + RSA encryption exactly as per [IranKish API Guide V9](https://www.irankish.com/App_Data_Public/IPG/IPG_TechnicalGuide.V9.pdf)

---

🤝 Contributing
--------------

[](#-contributing)

Contributions are welcome! If you encounter a bug or have a feature request, please open an issue at:

👉 [GitHub Issues](https://github.com/noorani-mm/irankish-laravel-gateway/issues)

To contribute code:

```
git clone https://github.com/noorani-mm/irankish-laravel-gateway.git
composer install
phpunit
```

Follow PSR-12 and submit a Pull Request 💪

---

🧾 License
---------

[](#-license)

This package is open-source software licensed under the [MIT License](LICENSE).

> MIT License © [Mohammad Mahdi Noorani](https://github.com/noorani-mm)

---

👥 Contributors
--------------

[](#-contributors)

[ ![](https://camo.githubusercontent.com/4f4c05fd1f1c6c36722a49eca4d22f7a8cfae9efcbdd43523bfaff43e093436f/68747470733a2f2f636f6e747269622e726f636b732f696d6167653f7265706f3d6e6f6f72616e692d6d6d2f6972616e6b6973682d6c61726176656c2d67617465776179)](https://github.com/noorani-mm/irankish-laravel-gateway/graphs/contributors)---

> 🌐 Also available in Persian: [README-Fa.md](README-Fa.md)

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance68

Regular maintenance activity

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity43

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

Unknown

Total

1

Last Release

184d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/adc3bc9ac4a10a57a87fce7a8a9839d7057bb9809b4f7e260eaa98c1b4cab455?d=identicon)[Noorani](/maintainers/Noorani)

---

Top Contributors

[![Noorani-MM](https://avatars.githubusercontent.com/u/74505328?v=4)](https://github.com/Noorani-MM "Noorani-MM (17 commits)")

---

Tags

laravelpaymentgatewaypayment gatewayiranshaparakirankishlaravel iranKishlaravel-paymentiran kishirankish-laravel-gateway

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/noorani-mm-irankish-laravel-gateway/health.svg)

```
[![Health](https://phpackages.com/badges/noorani-mm-irankish-laravel-gateway/health.svg)](https://phpackages.com/packages/noorani-mm-irankish-laravel-gateway)
```

###  Alternatives

[shetabit/payment

Laravel Payment Gateway Integration Package

944330.1k5](/packages/shetabit-payment)[larabook/gateway

A Laravel package for connecting to all Iraninan payment gateways

24553.7k](/packages/larabook-gateway)[parsisolution/gateway

A Laravel package for connecting to all Iraninan payment gateways

231.7k](/packages/parsisolution-gateway)

PHPackages © 2026

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