Skip to content

hpez/gateway

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gateway (پکیج درگاه‌های بانکی ایران)

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();