-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathccard.php
34 lines (31 loc) · 971 Bytes
/
ccard.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
require_once('conf.php');
require_once('mwt-newebpay_sdk.php');
/* 金鑰與版本設定 */
$MerchantID = $merchantID;
$HashKey = $hashKey;
$HashIV = $hashIV;
$URL = $url;
$VER = $ver;
/* 送給藍新資料 */
$trade_info_arr = array(
'MerchantID' => $merchantID,
'RespondType' => 'JSON',
'TimeStamp' => 1485232229,
'Version' => $VER,
'MerchantOrderNo' => getOrderNo(),
'Amt' => $NTD,
'ItemDesc' => $Order_Title,
'CREDIT' => 1,
'VACC' => 0,//ATM
'ReturnURL' => $ReturnURL, //支付完成 返回商店網址
'NotifyURL' => $NotifyURL_ccard, //支付通知網址
'CustomerURL' =>$CustomerURL, //商店取號網址
'ClientBackURL' => $ClientBackURL //支付取消 返回商店網址
);
if (isset($_GET['pay']) == 1 && $_GET['pay'] == "y"){
$TradeInfo = create_mpg_aes_encrypt($trade_info_arr, $HashKey, $HashIV);
$SHA256 = strtoupper(hash("sha256", SHA256($HashKey,$TradeInfo,$HashIV)));
echo CheckOut($URL,$MerchantID,$TradeInfo,$SHA256,$VER);
}
?>