PHPackages                             php-monsters/shaparak - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. php-monsters/shaparak

ActiveLibrary[Payment Processing](/categories/payments)

php-monsters/shaparak
=====================

Iranian payment gateways handler for laravel based applications

v3.1.0(2mo ago)323378[2 issues](https://github.com/php-monsters/shaparak/issues)MITPHPPHP &gt;8.0

Since Mar 9Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/php-monsters/shaparak)[ Packagist](https://packagist.org/packages/php-monsters/shaparak)[ RSS](/packages/php-monsters-shaparak/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (22)Used By (0)

[![State Machine](https://camo.githubusercontent.com/a270b86729da1ac0d05d68e2f89424c65ee241ee1724d2bd2319fe615eb5026e/68747470733a2f2f663030352e6261636b626c617a6562322e636f6d2f66696c652f646f63732d696d616765732f736861706172616b2d73746174656d616368696e652e706e673f313233)](https://camo.githubusercontent.com/a270b86729da1ac0d05d68e2f89424c65ee241ee1724d2bd2319fe615eb5026e/68747470733a2f2f663030352e6261636b626c617a6562322e636f6d2f66696c652f646f63732d696d616765732f736861706172616b2d73746174656d616368696e652e706e673f313233)

Shaparak :: Laravel Online Payment Component
============================================

[](#shaparak--laravel-online-payment-component)

Online Payment Component for Laravel 5+ known as Shaparak component completely compatible with [BankTest](http://banktest.ir) simulator. Shaparak integrated all Iranian/Shetab payment gateways to one component.

What is Banktest?
-----------------

[](#what-is-banktest)

- [BankTest](http://banktest.ir) is a sandbox service for all Iranian online payment gateways
- [بانک تست](http://banktest.ir) یک سرویس شبیه ساز درگاه های پرداخت آنلاین ایرانی برای اهداف توسعه و تست نرم افزار می باشد

Support This Project
--------------------

[](#support-this-project)

Please support the package by giving it ⭐ and contributing to its development.

Currently supported PSPs:
-------------------------

[](#currently-supported-psps)

- Mellat Bank Gateway - درگاه بانک ملت (به پرداخت ملت) لاراول
- Saman Bank Gateway - درگاه بانک سامان (پرداخت الکترونیک سامان) لاراول
- Saderat Bank Gateway - درگاه بانک صادرات (پرداخت الکترونیک سپهر) لاراول
- Pasargad Bank Gateway - درگاه بانک پاسارگاد (پرداخت الکترونیک پاسارگاد) لاراول
- Parsian Bank Gateway - درگاه بانک پارسیان (تجارت الکترونیک پارسیان) لاراول
- Melli Bank Gateway - درگاه بانک ملی (سداد) لاراول
- ...

Requirements
------------

[](#requirements)

Shaparak require PHP 7.1+

Installation
------------

[](#installation)

1. Installation via php composer

```
composer require php-monsters/shaparak
```

2. Add package service provider to your app service providers:

```
PhpMonsters\Shaparak\ShaparakServiceProvider::class,
```

3. Add package alias to your app aliases:

```
'Shaparak' => PhpMonsters\Shaparak\Facades\Shaparak::class,
```

4. Publish package assets and configs

```
php artisan vendor:publish --provider="PhpMonsters\Shaparak\ShaparakServiceProvider"
```

Configuration
-------------

[](#configuration)

If you complete installation step correctly, you can find Shaparak config file as `shaparak.php` in you project config file.

For using sandbox environment you should set `SHAPARAK_MODE=development` in your .env file otherwise set `SHAPARAK_MODE=production`

if you choose development mode, Shaparak uses [banktest.ir](https://banktest.ir) as its payment gateway.

Usage
-----

[](#usage)

### Add required fields to the model migration

[](#add-required-fields-to-the-model-migration)

```
$table->string('token', 40)->nullable(); // It keeps token that we get from the IPG
$table->jsonb('gateway_callback_params')->nullable(); // It keeps the IPG callback parameters (just for tracking and debugging)

$table->boolean('verified')->default(false); // Transaction verified or not
$table->boolean('after_verified')->default(false); // Transaction settled or not
$table->boolean('reversed')->default(false); // Transaction revered/refunded or not
$table->boolean('accomplished')->default(false); // Transaction accomplished or not
```

### Prepare required model(s)

[](#prepare-required-models)

Your Transaction, Invoice or Order model MUST implement Shaparak Transaction Interface.

```
