1
This commit is contained in:
parent
0b3f582982
commit
f3a91073d5
@ -35,6 +35,10 @@ class UnifiedWeiXin extends BaseSdk {
|
||||
|
||||
public function preOrder()
|
||||
{
|
||||
if (!($_REQUEST['unified_trade_type'])) {
|
||||
phpcommon\sendError(1, '参数错误,unified_trade_type必须为MWEB或JSAPI');
|
||||
return;
|
||||
}
|
||||
$this->gameid = phpcommon\extractGameId($_REQUEST['account_id']);
|
||||
$this->real_channel = phpcommon\extractChannel($_REQUEST['account_id']);
|
||||
$this->loadConfig();
|
||||
@ -65,7 +69,7 @@ class UnifiedWeiXin extends BaseSdk {
|
||||
'total_fee' => '101',
|
||||
'spbill_create_ip' => phpcommon\getIPv4(),
|
||||
'notify_url' => 'https://gamepay.kingsome.cn/webapp/paynotify/unified_weixin.php',
|
||||
'trade_type' => 'MWEB',
|
||||
'trade_type' => $_REQUEST['unified_trade_type'],
|
||||
//'scene_info' => '',
|
||||
);
|
||||
if (SERVER_ENV != _ONLINE) {
|
||||
@ -92,12 +96,22 @@ class UnifiedWeiXin extends BaseSdk {
|
||||
phpcommon\sendError(2, $xml->return_msg);
|
||||
return;
|
||||
}
|
||||
echo json_encode(array(
|
||||
'errcode' => 0,
|
||||
'errmsg' => '',
|
||||
'cp_orderid' => $cp_orderid,
|
||||
'prepayid' => $xml->prepay_id
|
||||
));
|
||||
if ($_REQUEST['unified_trade_type'] == 'MWEB') {
|
||||
echo json_encode(array(
|
||||
'errcode' => 0,
|
||||
'errmsg' => '',
|
||||
'cp_orderid' => $cp_orderid,
|
||||
'prepayid' => '' . $xml->prepay_id,
|
||||
'pay_jump_url' => '' . $xml->mweb_url
|
||||
));
|
||||
} else {
|
||||
echo json_encode(array(
|
||||
'errcode' => 0,
|
||||
'errmsg' => '',
|
||||
'cp_orderid' => $cp_orderid,
|
||||
'prepayid' => '' . $xml->prepay_id
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
public function payNotify()
|
||||
|
Loading…
x
Reference in New Issue
Block a user