aharen / mpg
v1.0.4
2017-02-22 08:22 UTC
README
此包已不再更新,请考虑使用https://github.com/aharen/Pay
MPG
马尔代夫银行支付网关(MPG)
安装
composer require aharen/mpg
或更新您的composer.json
如下,然后运行composer update
require: {
"aharen/mpg": "1.0.*"
}
使用
$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);
您可以使用以下方法之一获取字段。
获取表单值,这将给您一个包含所有表单值的数组。
$form_values = $pay->getFormValues();
或者,获取表单,这将给您一个HTML表单。
$form = $pay->getForm();
您可以使用以下方法来格式化网关的响应。
Pay::response($_REQUEST);