2017 © Pedro Peláez
 

library iran-payment

a Laravel package to handle Internet Payment Gateways for Iran Banking System

image

dena-a/iran-payment

a Laravel package to handle Internet Payment Gateways for Iran Banking System

  • Saturday, January 20, 2018
  • by dena-a
  • Repository
  • 1 Watchers
  • 3 Stars
  • 48 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 6 Versions
  • 4 % Grown

The README.md

, (*1)

IranPayment for Laravel

, (*2)

a Laravel package to handle Internet Payment Gateways (IPGs) for Iran Banking System, (*3)

Accepting Sadad (Melli), Saman (Sep), Zarinpal and more iranian payment gateways. Just use the IranPayment to receive payments directly on your website., (*4)

Latest Stable Version Total Downloads Latest Unstable Version License, (*5)

Gateways

Gateways

Logo Gateway Description Available Tested Last Update
Sadad (Melli) بانک ملی (سداد) 2020/09/10
Saman (Sep) (سپ) بانک سامان 2020/08/03
Pay.ir پرداخت پی 2020/08/03
Zarinpal زرین پال 2020/08/03
Payping پی پینگ 2020/08/04
Novinopay نوینو پرداخت 2022/03/23
Digipay دیجی پی CPG ✓ BPG/BNPL ✓ 2024/06/24
--- Qeroun قرون - خرید امن با ایجاد توافق‌نامه - - -
--- Mellat (Behpardakht) (به پرداخت) بانک ملت - - -
--- Parsian (Pec) (پک) بانک پارسیان - - -
--- Pasargad (Pep) (پپ) بانک پاسارگاد - - -
--- Zibal زیبال - - -
--- IDPay آیدی پی - - -

Requirements

  • PHP >= 7.4
  • PHP ext-curl
  • PHP ext-json
  • PHP ext-soap
  • Laravel (or Lumen) >= 5.7

Installation

  1. Add the package to your composer file via the composer require command:, (*6)

    $ composer require dena-a/iran-payment:^2.0
    

    Or add it to composer.json manually:, (*7)

    "require": {
       "dena-a/iran-payment": "^2.0"
    }
    
  2. IranPayment's service providers will be automatically registered using Laravel's auto-discovery feature., (*8)

    Note: For Lumen you have to add the IranPayment service provider manually to: bootstrap/app.php :, (*9)

    $app->register( Dena\IranPayment\IranPaymentServiceProvider::class);
    
  3. Publish the config-file and migration with:, (*10)

    php artisan vendor:publish --provider="Dena\IranPayment\IranPaymentServiceProvider"
    
  4. After the migration has been published you can create the transactions-tables by running the migrations: bash php artisan migrate

Usage

New Payment:

use Dena\IranPayment\IranPayment;

// Default gateway
$payment = IranPayment::create();
// Select one of available gateways
$payment = IranPayment::create('sadad');
// Test gateway (Would not work on production environment)
$payment = IranPayment::create('test');
// Or use your own gateway
$payment = IranPayment::create(NewGateway::class);

$payment->setUserId($user->id)
        ->setAmount($data['amount'])
        ->setCallbackUrl(route('bank.callback'))
        ->ready();

return $payment->redirect();

Verify Payment:

use Dena\IranPayment\IranPayment;
use Dena\IranPayment\Exceptions\IranPaymentException;

try {
    $payment = IranPayment::detect()->confirm();
    $trackingCode = $payment->getTrackingCode();
    $statusText = $payment->getTransactionStatusText();
} catch (Dena\IranPayment\Exceptions\IranPaymentException $ex) {
    throw $ex;
}

Create your own payment gateway class

use Dena\IranPayment\Gateways\AbstractGateway;
use Dena\IranPayment\Gateways\GatewayInterface;

class NewGateway extends AbstractGateway implements GatewayInterface
{
    public function getName(): string
    {
        return 'new-gateway';
    }

    public function initialize(array $parameters = []): self
    {
        parent::initialize($parameters);

        return $this;
    }

    public function purchase(): void
    {
        // Send Purchase Request

        $reference_number = 'xxxx';

        $this->transactionUpdate([
            'reference_number' => $reference_number,
        ]);
    }


    public function purchaseUri(): string
    {
        return 'http://new-gateway.com/token/xxxx';
    }

    public function verify(): void
    {
        $this->transactionVerifyPending();

        // Send Payment Verify Request

        $tracking_code = 'yyyy';

        $this->transactionSucceed([
            'tracking_code' => $tracking_code
        ]);
    }
}

Contribute

Contributions are always welcome!, (*11)

Support

If you believe you have found a bug, please report it using the GitHub issue tracker, or better yet, fork the library and submit a pull request., (*12)

License

The MIT License (MIT). Please see License File for more information., (*13)

The Versions

20/01 2018

dev-master

9999999-dev https://github.com/dena-a/iran-payment

a Laravel package to handle Internet Payment Gateways for Iran Banking System

  Sources   Download

MIT

The Requires

 

by Dena Ajdari

laravel payment banking bank iran zarinpal saman payment system sep

14/05 2017

dev-development

dev-development https://github.com/dena-a/iran-payment

a Laravel package to handle Internet Payment Gateways for Iran Banking System

  Sources   Download

MIT

The Requires

 

by Dena Ajdari

laravel payment banking bank iran zarinpal saman payment system sep

05/03 2017

1.0.0

1.0.0.0 https://github.com/dena-a/iran-payment

a Laravel package to handle Internet Payment Gateways for Iran Banking System

  Sources   Download

MIT

The Requires

 

by Dena Ajdari

laravel payment banking bank iran zarinpal saman payment system sep

06/02 2017

0.2

0.2.0.0 https://github.com/dena-a/iran-payment

a Laravel package to handle Internet Payment Gateways for Iran Banking System

  Sources   Download

MIT

The Requires

 

by Dena Ajdari

laravel payment banking bank iran zarinpal saman payment system sep

15/11 2016

v0.1.1

0.1.1.0 https://github.com/dena-a/iran-payment

a Laravel package to handle Internet Payment Gateways for Iran Banking System

  Sources   Download

MIT

The Requires

 

by Dena Ajdari

laravel payment banking bank iran zarinpal payment system

15/11 2016

v0.1

0.1.0.0 https://github.com/dena-a/iran-payment

a Laravel package to handle Internet Payment Gateways for Iran Banking System

  Sources   Download

MIT

The Requires

 

by Dena Ajdari

laravel payment banking bank iran zarinpal payment system