dev-master
9999999-devPEP IPG code for using in PHP projects.
MIT
The Requires
- php >=5.5
- ext-soap *
- ext-bcmath *
The Development Requires
by Morteza Poussaneh
pepgateway
Wallogit.com
2017 © Pedro Peláez
PEP IPG code for using in PHP projects.
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., (*1)
$ composer require "gdpa/pep-gateway":"dev-master", (*2)
Create pep-certificate.xml in your root directory and provide your private key provided by PEP company in it., (*3)
In your classes you can use package this way:, (*4)
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);
}
}
$buyHiddenFields is contain all necessary fields for using in sending user to gateway:
$verify values:
$refund values:
$check values:
MPG 'isValid' function also added. (See Their MPG documents.)., (*5)
PEP IPG code for using in PHP projects.
MIT
pepgateway