hpez/gateway

A Laravel package for using all Iranian payment gateways

v0.5.3 2024-06-30 13:40 UTC

This package is auto-updated.

Last update: 2024-11-30 14:53:59 UTC


README

Latest Version on Packagist Total Downloads

A package for simplifying the integration with Iranian banks.

Supported gatways:

  1. MELLAT
  2. SADAD (MELLI)
  3. SAMAN
  4. PARSIAN
  5. PASARGAD
  6. ZARINPAL
  7. PAYPAL
  8. ASAN PARDAKHT
  9. PAY.IR
  10. SADERAT
  11. 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();