hpez / gateway
A Laravel package for using all Iranian payment gateways
v0.5.3
2024-06-30 13:40 UTC
Requires
- ext-json: *
- ext-soap: *
- ext-xml: *
- guzzlehttp/guzzle: ~6.0
- nesbot/carbon: >=1.20
- paypal/rest-api-sdk-php: *
README
A package for simplifying the integration with Iranian banks.
Supported gatways:
- MELLAT
- SADAD (MELLI)
- SAMAN
- PARSIAN
- PASARGAD
- ZARINPAL
- PAYPAL
- ASAN PARDAKHT
- PAY.IR
- SADERAT
- IRANKISH
Install
Step 1:
composer require hpez/gateway
Step 2:
php artisan vendor:publish --provider="Hpez\Gateway\GatewayServiceProvider"
Step 3:
Find the config file at config/gateway.php and change it according to your needs.
Usage example:
Redirecting to gateway:
$gateway = \Gateway::make(new \Hpez\Gateway\Mellat\Mellat()); $gateway->setCallback("your callback route"); $gateway->setCellNumber("09xxxxxxxxx"); // Optional $gateway->price($invoiceTotal)->ready(); $refId = $gateway->refId(); // شماره ارجاع بانک $transactionId = $gateway->transactionId(); // شماره تراکنش return $gateway->redirect();
Settling the transaction:
$gateway = \Gateway::verify(); $trackingCode = $gateway->trackingCode(); $refId = $gateway->refId(); $cardNumber = $gateway->cardNumber();