1
This commit is contained in:
parent
8f6fb4adf7
commit
c808eb2249
@ -35,7 +35,7 @@ class UnifiedWeiXin extends BaseSdk {
|
||||
|
||||
public function preOrder()
|
||||
{
|
||||
if (!($_REQUEST['unified_trade_type'])) {
|
||||
if (!($_REQUEST['unified_trade_type'] == 'MWEB' || $_REQUEST['unified_trade_type'] == 'JSAPI')) {
|
||||
phpcommon\sendError(1, '参数错误,unified_trade_type必须为MWEB或JSAPI');
|
||||
return;
|
||||
}
|
||||
@ -60,6 +60,7 @@ class UnifiedWeiXin extends BaseSdk {
|
||||
);
|
||||
}
|
||||
|
||||
$openid = phpcommon\extractOpenId($_REQUEST['account_id']);
|
||||
$params = array(
|
||||
'appid' => $this->conf_appid,
|
||||
'mch_id' => $this->conf_mch_id,
|
||||
@ -72,6 +73,9 @@ class UnifiedWeiXin extends BaseSdk {
|
||||
'trade_type' => $_REQUEST['unified_trade_type'],
|
||||
//'scene_info' => '',
|
||||
);
|
||||
if ($_REQUEST['unified_trade_type'] == 'JSAPI') {
|
||||
$params['openid'] = $openid;
|
||||
}
|
||||
if (SERVER_ENV != _ONLINE) {
|
||||
$params['notify_url'] = 'https://gamepay-test.kingsome.cn/webapp/paynotify/unified_weixin.php';
|
||||
}
|
||||
@ -90,7 +94,7 @@ class UnifiedWeiXin extends BaseSdk {
|
||||
phpcommon\sendError(1, '服务器内部错误');
|
||||
return;
|
||||
}
|
||||
echo $response;
|
||||
error_log($response);
|
||||
$xml = new \SimpleXMLElement($response);
|
||||
if ($xml->return_code != 'SUCCESS') {
|
||||
phpcommon\sendError(2, $xml->return_msg);
|
||||
|
Loading…
x
Reference in New Issue
Block a user