This package allows you to connect to all Iranian banks using a single, unique API.
If you encounter any bugs or issues, please inform us by creating an issue on our GitHub repository.
- MELLAT
- SADAD (MELLI)
- SAMAN
- PARSIAN
- PASARGAD
- ZARINPAL
- JAHANPAY
- PAYLINE
- PAY (PAY.IR)
- IDPAY (IDPAY.IR)
- ALFACOINS (alfacoins.com)
- PAYPING (payping.io)
- PLISIO (plisio.net)
- BAZARPAY
- THAWANI
Follow these steps to install the package:
-
Run the following command in your terminal:
composer require larabook/gateway
-
Add the following lines to
config/app.php
:'providers' => [ // ... Larabookir\Gateway\GatewayServiceProvider::class, ], 'aliases' => [ // ... 'Gateway' => Larabookir\Gateway\Gateway::class, ]
-
Publish the configuration file:
php artisan vendor:publish --provider=Larabookir\Gateway\GatewayServiceProvider
-
Run migrations:
php artisan migrate
The configuration file is located at config/gateway.php
. Open the file and enter your bank's credentials.
You can connect to a bank using either a facade or the service container:
try {
$gateway = \Gateway::make(new \Mellat());
// $gateway->setCallback(url('/path/to/callback/route')); // You can also change the callback
$gateway->price(1000)->ready();
$refId = $gateway->refId();
$transID = $gateway->transactionId();
// Your code here
return $gateway->redirect();
} catch (Exception $e) {
echo $e->getMessage();
}
You can call the gateway using these methods:
Gateway::make(new Mellat());
Gateway::mellat();
app('gateway')->make(new Mellat());
app('gateway')->mellat();
Replace MELLAT
with the desired bank's name.
In the price
method, enter the price in IRR (RIAL).
In your callback:
try {
$gateway = \Gateway::verify();
$trackingCode = $gateway->trackingCode();
$refId = $gateway->refId();
$cardNumber = $gateway->cardNumber();
// Your code here
} catch (Exception $e) {
echo $e->getMessage();
}
If you're interested in contributing to this package, you can help in the following ways:
- Improving documentation.
- Reporting issues or bugs.
- Collaborating on writing code and adding support for other banks.
This package is an extension of PoolPort, with added functionality and improvements.