All Projects → dena-a → iran-payment

dena-a / iran-payment

Licence: MIT license
a Laravel package to handle Internet Payment Gateways for Iran Banking System

Programming Languages

PHP
23972 projects - #3 most used programming language
Blade
752 projects

Projects that are alternatives of or similar to iran-payment

sep-pay
Pay.ir Payment Package for Laravel 5.3+
Stars: ✭ 17 (+6.25%)
Mutual labels:  pay, sep, iran, payment-gateway, saman, pay-ir, iran-payment, iranian-bank, saman-bank, sep-pay
az-iranian-bank-gateways
درگاه اتصال به بانک های ایرانی ( درگاه پرداخت بانک ملی ایران،بانک سامان، بانک ملت، درگاه پرداخت زرین پال و ... ) با استفاده از پایتون
Stars: ✭ 308 (+1825%)
Mutual labels:  sep, iran, zarinpal, payment-gateway, saman, iran-payment, iranian-bank, payping
BankPayment
Persian Bank Payment Server
Stars: ✭ 37 (+131.25%)
Mutual labels:  saman, saman-bank
php-ipg-ir
IPG (Internet Payment Gateway) manager for Iran Banking System
Stars: ✭ 26 (+62.5%)
Mutual labels:  iran, saman
mollie-api-go
Golang wrapper for Mollie's REST API with full resource coverage.
Stars: ✭ 45 (+181.25%)
Mutual labels:  pay, payment-gateway
Begiresh
Smart Android App Banner for Persian Markets
Stars: ✭ 28 (+75%)
Mutual labels:  iran
Paynow-NodeJS-SDK
NodeJS SDK for Zimbabwe's leading payments gateway, Paynow
Stars: ✭ 23 (+43.75%)
Mutual labels:  payment-gateway
laravel-pix
Uma solucão simples para integrar sua aplicação Laravel a API PIX do Banco Central do Brasil
Stars: ✭ 73 (+356.25%)
Mutual labels:  payment-gateway
prisoners
حبس از دید اعداد واقعی - Persian translation for "Incarceration in real numbers"
Stars: ✭ 22 (+37.5%)
Mutual labels:  iran
cashier
Cashier is an Elixir library that aims to be an easy to use payment gateway, whilst offering the fault tolerance and scalability benefits of being built on top of Erlang/OTP
Stars: ✭ 43 (+168.75%)
Mutual labels:  payment-gateway
adyen-python-api-library
Adyen API Library for Python
Stars: ✭ 41 (+156.25%)
Mutual labels:  payment-gateway
Documentations
Documentation to integrate PayU SDKs
Stars: ✭ 26 (+62.5%)
Mutual labels:  payment-gateway
omnipay-2checkout
2Checkout driver for the Omnipay PHP payment processing library
Stars: ✭ 25 (+56.25%)
Mutual labels:  payment-gateway
tbc-credit-card-payment-gateway-php-lib
PHP library for the TBC credit card payment gateway API.
Stars: ✭ 80 (+400%)
Mutual labels:  payment-gateway
DYFStoreKit
([Swift] https://github.com/chenxing640/DYFStore) A lightweight and easy-to-use iOS library for In-App Purchases (Objective-C). DYFStoreKit uses blocks and notifications to wrap StoreKit, provides receipt verification and transaction persistence and doesn't require any external dependencies.
Stars: ✭ 52 (+225%)
Mutual labels:  pay
react-native-wx-ali-pay
react-native pay for Ali && WeiXin
Stars: ✭ 15 (-6.25%)
Mutual labels:  pay
tir
Have time.ir in shell!
Stars: ✭ 114 (+612.5%)
Mutual labels:  iran
PaymentCardView
Custom Credit/Debit card view
Stars: ✭ 62 (+287.5%)
Mutual labels:  payment-gateway
iran beauty
list of iran cities and province
Stars: ✭ 18 (+12.5%)
Mutual labels:  iran
matnbaz
📚 The source-code for matnbaz.net. A monorepo containing the back-end (NestJS/Prisma/Apollo), front-end (Next.js/Apollo) and some tooling.
Stars: ✭ 481 (+2906.25%)
Mutual labels:  iran

IranPayment for Laravel

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

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

Latest Stable Version Total Downloads Latest Unstable Version License

Gateways

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

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:

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

    Or add it to composer.json manually:

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

    Note: For Lumen you have to add the IranPayment service provider manually to: bootstrap/app.php :

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

    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:

    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!

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.

License

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].