47 lines
2.0 KiB
PHP
47 lines
2.0 KiB
PHP
<?php
|
|
// Setup E-xact parameters
|
|
$exactCode = $school_record['exact_code'];
|
|
$exactCurrency = $school_record['exact_currency'];
|
|
$exactRecordNum = $trxnum;
|
|
$exactTimeStamp = time();
|
|
|
|
echo("<!-- $exactCode -->\n");
|
|
echo("<!-- $exactTimeStamp -->\n");
|
|
echo("<!-- $exactCurrency -->\n");
|
|
|
|
$TRXamount = str_replace(',','',number_format($owing,2));
|
|
$hmac_data = $exactCode . "^" . $exactRecordNum . "^" . $exactTimeStamp . "^$TRXamount^$exactCurrency";
|
|
switch ($school_record['reseller']) {
|
|
case 'esns':
|
|
$exactFPHash = hash_hmac('MD5', $hmac_data, "4ZDsSbfLldrn~CnwrcqN");
|
|
break;
|
|
|
|
case 'duke':
|
|
// $exactFPHash = hash_hmac('MD5', $hmac_data, "lN2638NFNUdbgHOS3E5e");
|
|
$exactFPHash = hash_hmac('MD5', $hmac_data, "7Eso4vDJH95MgAwNleC~");
|
|
break;
|
|
}
|
|
|
|
$item_title = $school_record['school_name'] . " Order Payment";
|
|
|
|
$postLive = "https://checkout.e-xact.com/payment";
|
|
$postTest = "";
|
|
|
|
$postURL = $postLive;
|
|
$exactTestMode = "FALSE";
|
|
?>
|
|
<form method='post' action='<?php echo($postURL) ?>'>
|
|
<input type=hidden name="x_login" value="<?php echo($exactCode) ?>">
|
|
<input type=hidden name="x_amount" value="<?php echo($TRXamount) ?>">
|
|
<input type=hidden name="x_currency_code" value="<?php echo($exactCurrency) ?>">
|
|
<input type=hidden name="x_test_request" value="<?php echo($exactTestMode) ?>">
|
|
<input type=hidden name="x_fp_sequence" value="<?php echo($exactRecordNum) ?>">
|
|
<input type=hidden name="x_invoice_num" value="<?php printf("%012d",$exactRecordNum) ?>">
|
|
<input type=hidden name="x_fp_timestamp" value="<?php echo($exactTimeStamp) ?>">
|
|
<input type=hidden name="x_fp_hash" value="<?php echo($exactFPHash) ?>">
|
|
<input type=hidden name="x_show_form" value="PAYMENT_FORM">
|
|
<input type=hidden name="merchant_cookie_1" value="<?php echo($school_num) ?>">
|
|
<input type=hidden name="merchant_cookie_2" value="<?php echo($_SESSION['UserInfo']['record_num']) ?>">
|
|
<input type='submit' value="<?php echo($school_record['exact_button_text']) ?>" class='btn btn--primary'>
|
|
</form>
|