3
0
WHMCS/modules/gateways/payanyway.php

60 lines
2.3 KiB
PHP

<?php
function payanyway_config() {
$configarray = array(
"FriendlyName" => array("Type" => "System", "Value"=>"PayAnyWay"),
"mnt_id" => array("FriendlyName" => "Account Number", "Type" => "text", "Size" => "20", ),
"mnt_dataintegrity_code" => array("FriendlyName" => "Code of data integrity verification", "Type" => "text", "Size" => "20", ),
"mnt_test_mode" => array("FriendlyName" => "Test Mode", "Type" => "yesno" ),
);
return $configarray;
}
function payanyway_link($params) {
# Gateway Specific Variables
$gatewayusername = $params['mnt_id'];
$gatewaytestmode = intval($params['mnt_test_mode']);
$gatewaykey = $params['mnt_dataintegrity_code'];
# Invoice Variables
$invoiceid = $params['invoiceid'];
$description = $params["description"];
$amount = $params['amount']; # Format: ##.##
$currency = $params['currency']; # Currency Code
# Client Variables
$firstname = $params['clientdetails']['firstname'];
$lastname = $params['clientdetails']['lastname'];
$email = $params['clientdetails']['email'];
$address1 = $params['clientdetails']['address1'];
$address2 = $params['clientdetails']['address2'];
$city = $params['clientdetails']['city'];
$state = $params['clientdetails']['state'];
$postcode = $params['clientdetails']['postcode'];
$country = $params['clientdetails']['country'];
$phone = $params['clientdetails']['phonenumber'];
# System Variables
$companyname = $params['companyname'];
$systemurl = $params['systemurl'];
$currency = $params['currency'];
# Enter your code submit to the gateway...
$signature = md5($gatewayusername . $invoiceid . $amount . $currency . $gatewaytestmode . $gatewaykey);
$code = '<form method="post" action="https://www.payanyway.ru/assistant.htm">
<input type="hidden" name="MNT_ID" value="'.$gatewayusername.'" />
<input type="hidden" name="MNT_TRANSACTION_ID" value="'.$invoiceid.'" />
<input type="hidden" name="MNT_AMOUNT" value="'.$amount.'" />
<input type="hidden" name="MNT_CURRENCY_CODE" value="'.$currency.'" />
<input type="hidden" name="MNT_SIGNATURE" value="'.$signature.'" />
<input type="hidden" name="MNT_TEST_MODE" value="'.$gatewaytestmode.'" />
<input type="hidden" name="MNT_DESCRIPTION" value="'.$description.'" />
<input type="submit" value="Pay Now" />
</form>';
return $code;
}
?>