commit | author | age
|
3e083b
|
1 |
<?php |
B |
2 |
|
|
3 |
/** |
|
4 |
* 网银在线自动对账接口 |
|
5 |
*/ |
|
6 |
|
|
7 |
define('IN_ECS', true); |
|
8 |
|
|
9 |
require(dirname(__FILE__) . '/includes/init.php'); |
|
10 |
require(ROOT_PATH . 'includes/lib_payment.php'); |
|
11 |
require(ROOT_PATH . 'includes/lib_order.php'); |
|
12 |
|
|
13 |
$key = ''; |
|
14 |
|
|
15 |
$payment = $db->getOne("SELECT pay_config FROM " . $ecs->table('payment') . " WHERE pay_code = 'chinabank' AND enabled = 1"); |
|
16 |
if (!empty($payment)) |
|
17 |
{ |
|
18 |
$payment = unserialize($payment); |
|
19 |
foreach($payment as $k=>$v) |
|
20 |
{ |
|
21 |
if ($v['name'] == 'chinabank_key') |
|
22 |
{ |
|
23 |
$key = $v['value']; |
|
24 |
} |
|
25 |
} |
|
26 |
} |
|
27 |
else |
|
28 |
{ |
|
29 |
die('error'); |
|
30 |
} |
|
31 |
|
|
32 |
$v_oid =trim($_POST['v_oid']); |
|
33 |
$v_pmode =trim($_POST['v_pmode']); |
|
34 |
$v_pstatus =trim($_POST['v_pstatus']); |
|
35 |
$v_pstring =trim($_POST['v_pstring']); |
|
36 |
$v_amount =trim($_POST['v_amount']); |
|
37 |
$v_moneytype =trim($_POST['v_moneytype']); |
|
38 |
$remark1 =trim($_POST['remark1' ]); |
|
39 |
$remark2 =trim($_POST['remark2' ]); |
|
40 |
$v_md5str =trim($_POST['v_md5str' ]); |
|
41 |
|
|
42 |
$md5string = strtoupper(md5($v_oid.$v_pstatus.$v_amount.$v_moneytype.$key)); |
|
43 |
if ($v_md5str == $md5string) |
|
44 |
{ |
|
45 |
if($v_pstatus == '20') |
|
46 |
{ |
|
47 |
if ($remark1 == 'voucher') |
|
48 |
{ |
|
49 |
$v_oid = get_order_id_by_sn($v_oid, "true"); |
|
50 |
} |
|
51 |
else |
|
52 |
{ |
|
53 |
$v_oid = get_order_id_by_sn($v_oid); |
|
54 |
} |
|
55 |
order_paid($v_oid); |
|
56 |
} |
|
57 |
echo 'ok'; |
|
58 |
}else{ |
|
59 |
echo 'error'; |
|
60 |
} |
|
61 |
?> |