-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAutoReceive.php
More file actions
36 lines (31 loc) · 1.38 KB
/
Copy pathAutoReceive.php
File metadata and controls
36 lines (31 loc) · 1.38 KB
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
35
36
<?
//**************************************** //MD5密钥要跟订单提交页相同,如Send.asp里的 key = "test" ,修改""号内 test 为您的密钥
//如果您还没有设置MD5密钥请登陆我们为您提供商户后台,地址:https://merchant3.chinabank.com.cn/
$key='test'; //登陆后在上面的导航栏里可能找到“B2C”,在二级导航栏里有“MD5密钥设置”
//建议您设置一个16位以上的密钥或更高,密钥最多64位,但设置16位已经足够了
//****************************************
$v_oid =trim($_POST['v_oid']);
$v_pmode =trim($_POST['v_pmode']);
$v_pstatus =trim($_POST['v_pstatus']);
$v_pstring =trim($_POST['v_pstring']);
$v_amount =trim($_POST['v_amount']);
$v_moneytype =trim($_POST['v_moneytype']);
$remark1 =trim($_POST['remark1' ]);
$remark2 =trim($_POST['remark2' ]);
$v_md5str =trim($_POST['v_md5str' ]);
/**
* 重新计算md5的值
*/
$md5string=strtoupper(md5($v_oid.$v_pstatus.$v_amount.$v_moneytype.$key)); //拼凑加密串
if ($v_md5str==$md5string)
{
if($v_pstatus=="20")
{
//支付成功
//商户系统的逻辑处理(例如判断金额,判断支付状态(20成功,30失败),更新订单状态等等)......
}
echo "ok";
}else{
echo "error";
}
?>