gdpa/pep-gateway
最新稳定版本:v1.0
Composer 安装命令:
composer require gdpa/pep-gateway
包简介
PEP IPG code for using in PHP projects.
关键字:
README 文档
README
PepGateway provides Pardakht Electronic Pasargad (PEP) internet payment gateway (IPG) code for using in PHP projects.
This package is base on PEP company sample code (pep-phpsample(v3.3.3).rar) that is provided in their website.
For more information you can see their documentation at pep.co.ir.
Usage
$ composer require "gdpa/pep-gateway":"dev-master"
Create pep-certificate.xml in your root directory and provide your private key provided by PEP company in it.
In your classes you can use package this way:
use gdpa\PepGateway\PepGateway; class payment { protected $merchantCode; // Your merchand code protected $terminalCode; // Your terminal code protected $certificate; // Path to certificate xml public function buySomething() { $gateway = new PepGateway($this->merchantCode, $this->terminalCode, $this->certificate); $buyHiddenFields = $gateway->buy($invoiceNumber, $invoiceDate, $amount, $redirectAddress, $timestamp); ... } public function verifyPurchase() { $gateway = new PepGateway($this->merchantCode, $this->terminalCode, $this->certificate); $verify = $gateway->verify($invoiceNumber, $invoiceDate, $amount, $timestamp); } public function refundTransaction() { $gateway = new PepGateway($this->merchantCode, $this->terminalCode, $this->certificate); $refund = $gateway->refund($invoiceNumber, $invoiceDate, $amount, $timestamp); } public function check() { $gateway = new PepGateway($this->merchantCode, $this->terminalCode, $this->certificate); $check = $gateway->check($transactionReferenceID, $invoiceNumber, $invoiceDate); } }
$buyHiddenFieldsis contain all necessary fields for using in sending user to gateway:- formAction (Using in form action)
- action
- merchantCode
- terminalCode
- invoiceNumber
- invoiceDate
- amount
- redirectAddress (Your redirect address that you implement settlement codes)
- timestamp
$verifyvalues:- result (true or false)
- resultMessage
$refundvalues:- result (true or false)
- resultMessage
$checkvalues:- result (true or false)
- resultMessage
MPG 'isValid' function also added. (See Their MPG documents.).
统计信息
- 总下载量: 6.96k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-08-08