PHPackages                             mostafa\_kz/zarinpal\_payment - 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. mostafa\_kz/zarinpal\_payment

ActiveLibrary[Payment Processing](/categories/payments)

mostafa\_kz/zarinpal\_payment
=============================

111PHP

Since Sep 16Pushed 7y ago1 watchersCompare

[ Source](https://github.com/mkz2035/laravel-zarinpal)[ Packagist](https://packagist.org/packages/mostafa_kz/zarinpal_payment)[ RSS](/packages/mostafa-kz-zarinpal-payment/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

laravel-zarinpal
================

[](#laravel-zarinpal)

written by mostafa karimzadeh
-----------------------------

[](#written-by-mostafa-karimzadeh)

#### Accountant in khu university

[](#accountant-in-khu-university)

laravel-zarinpal is a package for Laravel 5+ provides helpers your simple payments

### Features

[](#features)

- Friendly Interface
- Ease of use
- Ease of set Merchant\_ID and callback url

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

[](#installation)

### 1 - Dependency

[](#1---dependency)

The first step is using composer to install the package and automatically update your composer.json file, you can do this by running

```
composer require mostafa_kz/zarinpal_payment

```

### 2 - Provider

[](#2---provider)

You need to update your application configuration in order to register the package so it can be loaded by Laravel, just update your **config/app.php** file adding the following code at the end of your '**providers**

```
    'providers' => [
         Payment\PaymentServiceProvider::class,
    ],

```

### 3 - Facade

[](#3---facade)

In order to use the **Payment** facade, you need to register it on the **config/app.php** file, you can do that the following way:

```
   'aliases' => [
    'Payment' => Payment\PaymentFacade::class,
    ],

```

### 4 - Configuration

[](#4---configuration)

In your terminal type

```
  php artisan vendor:publish

```

or

```
 php artisan vendor:publish --provider=" Payment\PaymentServiceProvider"

```

Usage
-----

[](#usage)

### 1 - Database(Migration)

[](#1---databasemigration)

run this command for init tables in your project

```
 php artisan migrate

```

### 2 - Init Routes

[](#2---init-routes)

put this routes in **web.php**

### Danger! your callback Url must be same of config/payment.php

[](#danger-your-callback-url-must-be-same-of-configpaymentphp)

```
Route::get('/','PaymentController@payForm');
Route::post('/installment/payment', 'PaymentController@payInstallment')->name('payment.redirectBank');
//your callback Url(must be same of config/payment.php)
Route::get('/installment/payment/check','PaymentController@checkPayment');

```

### 3 - Init Controllers

[](#3---init-controllers)

run this command for create controller

```
php artisan make:controller PaymentController

```

then put this code on **PaymentController**

```
