aharen/mpg

This package is abandoned and no longer maintained. The author suggests using the aharen/pay package instead.

Maldives Payment Gateway (MPG) by Bank of Maldives

Maintainers

Details

github.com/aharen/MPG

Source

Issues

Installs: 49

Dependents: 0

Suggesters: 0

Security: 0

Stars: 3

Watchers: 1

Forks: 1

Open Issues: 0

Type:package

v1.0.4 2017-02-22 08:22 UTC

This package is auto-updated.

Last update: 2020-08-26 08:29:50 UTC


README

This package is no longer updated, please consider using https://github.com/aharen/Pay

MPG

Maldives Payment Gateway (MPG) by Bank of Maldives

Installation

composer require aharen/mpg

or update your composer.json as follows and run composer update

require: {
	"aharen/mpg": "1.0.*"
}

Usage

$pay = new MPG();

$url         = [Gateway URL from BML];
$MerID       = [Merchant ID];
$AcqID       = [Acquirer ID];
$MerPassword = [Merchant Account Password];

$pay->initialize($url, $MerID, $AcqID, $MerPassword);

/* 
* setup transanction
* $amount = amount to debit eg: 100.01
* $transactionId = your transaction id eg: TRN/001
*/
$pay->setTransaction($amount, $transactionId);

You can use one of the following methods to get the fields.

Get form values, which will give you an array of all the form values.

$form_values = $pay->getFormValues();

Or, Get Form, which will give you an HTML form.

$form = $pay->getForm();

You may use the following method to format the response from the gateway.

Pay::response($_REQUEST);