This commit is contained in:
aozhiwei 2019-08-21 14:48:36 +08:00
parent f5f8c1f256
commit 17a8188a8a

View File

@ -136,76 +136,7 @@ class PayController {
} }
} }
public function scanPay1() private function merchantIn()
{
/*
if (!phpcommon\isValidSessionId(
$_REQUET['account_id'],
$_REQUET['session_id']
)) {
echo json_encode(array(
'errcode' => 100,
'errmsg' => 'session无效',
));
die();
}
*/
$orderid = $this->getOrderId();
if (empty($orderid)) {
die();
}
$nowtime = time();
$advice_url = '';
if (SERVER_ENV != _ONLINE) {
$advice_url = "https://gamepay-test.kingsome.cn/webapp/index.php?c=PayNotify&a=payNotify";
} else {
$advice_url = "https://gamepay.kingsome.cn/webapp/index.php?c=PayNotify&a=payNotify";
}
$advice_url = 'https://gamepay.kingsome.cn/webapp/index.php';
$params = array(
'MerNo' => self::MER_NO,
'BillNo' => $orderid,
'payType' => 'WxJsapi_OffLine',
'Amount' => '0.1',
'OrderTime' => strftime('%Y%m%d%H%M%S', $nowtime),
'AdviceUrl' => htmlentities($advice_url),
'ScanpayMerchantCode' => '',
'SignInfo' => '',
'products' => '',
'remark' => '',
'MerName' => '',
);
$params['SignInfo'] = $this->_reaEncode(
'MerNo=' . $params['MerNo'] . '&' .
'BillNo=' . $params['BillNo'] . '&' .
'Amount=' . $params['Amount'] . '&' .
'OrderTime=' . $params['OrderTime'] . '&' .
'AdviceUrl=' . $advice_url
);
echo $params['SignInfo'];
var_dump(phpcommon\objectToXml($params, '<ScanPayRequest/>'));
$requestDomain = base64_encode(phpcommon\objectToXml($params, '<ScanPayRequest/>'));
$response = '';
if (phpcommon\HttpClient::post(self::SCAN_PAY_API_URL,
'requestDomain='. urlencode($requestDomain),
$response)
) {
/* echo json_encode(array(
'errcode' => 101,
'errmsg' => '交易失败:' . $response,
));
die();*/
}
var_dump($response);
$xmlobj = new \SimpleXMLElement($response);
var_dump($xmlobj->respCode);
if ($xmlobj->respCode == '0000') {
$conn = $this->getMysql($_REQUEST['account_id']);
$ret = $conn->execScript();
}
}
public function merchantIn()
{ {
$orderid = $this->getOrderId(); $orderid = $this->getOrderId();
if (empty($orderid)) { if (empty($orderid)) {
@ -250,7 +181,7 @@ class PayController {
var_dump(base64_decode($response)); var_dump(base64_decode($response));
} }
public function merchantInQuery() private function merchantInQuery()
{ {
$orderid = $this->getOrderId(); $orderid = $this->getOrderId();
if (empty($orderid)) { if (empty($orderid)) {