-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnative.php
50 lines (47 loc) · 1.5 KB
/
native.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
/**
* [WeEngine System] Copyright (c) 2014 WE7.CC
* WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
*/
define('IN_MOBILE', true);
require '../../framework/bootstrap.inc.php';
load()->classs('pay');
$pay = Pay::create();
$input= file_get_contents('php://input');
$input = $pay->parseResult($input);
if(is_error($input)) {
$pay->replyErrorNotify($input['message']);
exit();
}
$result = $pay->buildNativePrepayid($input['product_id']);
if(is_error($result)) {
$pay->replyErrorNotify($result['message']);
exit();
}
echo array2xml($result);
echo 90;
$log = pdo_get('core_paylog', array('plid' => $input['product_id']));
$site = WeUtility::createModuleSite($log['module']);
if(!is_error($site)) {
$method = 'scanResult';
if (method_exists($site, $method)) {
$ret = array();
$ret['weid'] = $log['weid'];
$ret['uniacid'] = $log['uniacid'];
$ret['acid'] = $log['acid'];
$ret['result'] = 'success';
$ret['type'] = $log['type'];
$ret['from'] = 'notify';
$ret['tid'] = $log['tid'];
$ret['uniontid'] = $log['uniontid'];
$ret['openid'] = empty($input['openid']) ? $log['openid'] : $input['openid'];
$ret['is_follow'] = $input['is_subscribe'] == 'Y' ? 1 : 0;
$ret['fee'] = $log['fee'];
$ret['tag'] = $log['tag'];
$ret['is_usecard'] = $log['is_usecard'];
$ret['card_type'] = $log['card_type'];
$ret['card_fee'] = $log['card_fee'];
$ret['card_id'] = $log['card_id'];
$site->$method($ret);
}
}