Download the PHP package php-monsters/laravel-online-payment without Composer
On this page you can find all versions of the php package php-monsters/laravel-online-payment. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download php-monsters/laravel-online-payment
More information about php-monsters/laravel-online-payment
Files in php-monsters/laravel-online-payment
Package laravel-online-payment
Short Description Iranian payment gateways handler for laravel applications
License MIT
Informations about the package laravel-online-payment
Laravel Iranian Online Payment Component
Online Payment Module handler for Laravel 5+ known as LaraPay component completely compatible with BankTest sandbox. Larapay integrated all Iranian payment gateways into one component.
Here are a few short examples of what you can do:
-
create new transaction form your order model and generate bank form
-
handle gateway callback (verify/settle/...)
- get order transaction information
Currenctly supports:
- Mellat Bank Gateway - درگاه بانک ملت لاراول
- Saman Bank Gateway - درگاه بانک سامان لاراول
- Saderat/Sepehr Pay Bank Gateway - درگاه بانک صادرات / سپهر
- Pasargad Bank Gateway - درگاه بانک پاسارگاد لاراول
- Parsian Bank Gateway - درگاه بانک پارسیان لاراول
- Melli/Sadad Bank Gateway (Sadad) - درگاه بانک ملی / سداد لاراول
- Pay.ir Gateway / درگاه پرداخت پی
- Zarinpal Gateway / درگاه پرداخت زرین پال
- IDPay Gateway / درگاه آیدی پی
- Zibal Gateway / درگاه زیبال
-
nextpay Gateway / درگاه نکست پی
- ...
- Other gateways, coming soon... لطفا شما هم در تکمیل پکیج مشارکت کنید
But what is Banktest sandbox?
- BankTest is a sandbox service for all Iranian online payment gateways
- بانک تست یک سرویس شبیه ساز درگاه های پرداخت آنلاین ایرانی برای اهداف توسعه و تست نرم افزار می باشد
Requirements
Larapay Version 6+ required PHP 7+
Installation
-
Installing via composer
-
Add package service provider to your app service providers (only for Laravel < 5.5):
-
Add package alias to your app aliases (only for Laravel < 5.5):
-
Publish package assets and configs
- Run migration
Configuration
If you complete installation step correctly, you can find Larapay config file as larapay.php in you project config file.
For sandbox (banktest) you should set in your .env file otherwise set
If you choose development mode, Larapay use banktest.ir as it's payment gateway.
Set your gateway(s) configs in your .env file. Here are some example:
Setup callback route
you should create a route for handling callback from bank and set your route name in .env
For example create a POST route in routes folder, web.php like this:
then set the route name in .env file:
Usage
Prepare payable model
Use Payable
trait in your order model or any other model like user which will get payment feature and implement it.
You can impalement getAmount() method to return Iranian Rail
amount of your model.
Now you just have 3 steps to complete your payment:
1- create transaction
In your bank controller create a transaction for your order and generate bank for to transfer user to payment gateway.
2- show bank transfer form
Now you can show you $form
in your go-to-bank
view file:
You can modify bank forms in:
3- handle callback
After payment, bank call you callback route
If you want to revers transaction and your bank support it, you can do this way:
Methods
Methods available in Paybel
trait and your order model:
$order->transactions
: get all transactions of this model$order->accomplishedTransactions
: get all accomplished transactions$order->isPaid()
: return true if this model has at least one accomplished transaction$order->paidAmount()
: return sum of accomplished transactions amount in Rial$order->createTransaction( $paymentGateway, $amount = null, $description = null, array $additionalData = [] )
: create a transaction.
Methods available in LarapayTransaction
model:
$transaction->model
: return the model that create this transaction. for example$order
$transaction->reverseTransaction()
: reverse transaction and get back money to user. (if bank support reverse transaction)$transaction->generateForm($autoSubmit = false, $callback = null)
: generate bank transfer form$transaction->gatewayHandler()
: get gatewayHandler for advance use.
Fields available in LarapayTransaction
model:
id
created_at
updated_at
Status in boolean:
accomplished
verified
after_verified
reversed
submitted
approved
-
rejected
Gate information:
payment_method
bank_order_id
gate_name
gate_refid
gate_status
extra_params
additional_data
Order information:
amount
description
paid_at
LarapayTransaction
You can use LarapayTransaction
model to find your transaction:
This class use SoftDeletes. you can call delete() on your transaction model to softDelete it or forceDelete() to truly remove it from your database.
Security
If you discover any security related issues, please email [email protected] or [email protected] instead of using the issue tracker.
Team
This component is developed by the following person(s) and a bunch of awesome contributors.
Aboozar Ghaffari | Milad Kianmehr | Sina Miandashti | XShaan |
Support This Project
Please contribute in package completion. This is the best support.
License
The Laravel Online Payment Module is open-sourced software licensed under the MIT license
All versions of laravel-online-payment with dependencies
ext-soap Version *
ext-json Version *
ext-bcmath Version *
ext-simplexml Version *
illuminate/contracts Version >=7.0
illuminate/database Version >=7.0
illuminate/http Version >=7.0
illuminate/routing Version >=7.0
illuminate/support Version >=7.0
illuminate/view Version >=7.0
php-monsters/laravel-xlog Version ^1.3.0