1
This commit is contained in:
parent
e63871f960
commit
d6bae02a9c
@ -137,6 +137,83 @@ class ToolsController extends BaseController {
|
||||
));
|
||||
}
|
||||
|
||||
public function outappRecharge()
|
||||
{
|
||||
$orderInfo = null;
|
||||
{
|
||||
$params = array(
|
||||
'c' => 'Shop',
|
||||
'a' => 'outappPurchase',
|
||||
'account_id' => getReqVal('account_id', ''),
|
||||
'session_id' => getReqVal('session_id', ''),
|
||||
'goods_id' => getReqVal('goods_id', ''),
|
||||
'goods_num' => getReqVal('goods_num', ''),
|
||||
'platform' => getReqVal('platform', ''),
|
||||
'network' => getReqVal('network', ''),
|
||||
'crypto' => getReqVal('crypto', ''),
|
||||
'fiat' => getReqVal('fiat', ''),
|
||||
'fiatAmount' => getReqVal('fiatAmount', ''),
|
||||
'payWayCode' => getReqVal('payWayCode', ''),
|
||||
'country' => getReqVal('country', ''),
|
||||
);
|
||||
$url = "https://game2006api-test.kingsome.cn/webapp/index.php?";
|
||||
$response = '';
|
||||
if (!phpcommon\HttpClient::get
|
||||
($url,
|
||||
$params,
|
||||
$response)) {
|
||||
error_log($response);
|
||||
myself()->_rspErr(500, 'server internal error 3, url:' . $url);
|
||||
die();
|
||||
return;
|
||||
}
|
||||
$orderInfo = json_decode($response, true);
|
||||
//echo $response;
|
||||
}
|
||||
{
|
||||
$params = array(
|
||||
'c' => 'Callback',
|
||||
'a' => 'dispatch',
|
||||
'action' => 'outappPurchase',
|
||||
'account_id' => getReqVal('account_id', ''),
|
||||
'order_id' => $orderInfo['order_id'],
|
||||
'status' => 99,
|
||||
'id' => 1,
|
||||
'txhash' => '',
|
||||
);
|
||||
{
|
||||
$signArr = array(
|
||||
'account_id' => $params['account_id'],
|
||||
'order_id' => $params['order_id'],
|
||||
'status' => $params['status'],
|
||||
'id' => $params['id'],
|
||||
'txhash' => $params['txhash']
|
||||
);
|
||||
ksort($signArr);
|
||||
$arrSign = array();
|
||||
foreach($signArr as $key => $val){
|
||||
array_push($arrSign, $key . '=' . $val);
|
||||
}
|
||||
$signStr = implode('&', $arrSign);
|
||||
$sign = hash_hmac('sha256', $signStr, BUY_SERVER_PKEY);
|
||||
error_log($signStr . BUY_SERVER_PKEY . '|!' . $sign);
|
||||
$params['sign'] = $sign;
|
||||
}
|
||||
$url = "https://game2006api-test.kingsome.cn/webapp/index.php?";
|
||||
$response = '';
|
||||
if (!phpcommon\HttpClient::get
|
||||
($url,
|
||||
$params,
|
||||
$response)) {
|
||||
error_log($response);
|
||||
myself()->_rspErr(500, 'server internal error 3, url:' . $url);
|
||||
die();
|
||||
return;
|
||||
}
|
||||
echo $response;
|
||||
}
|
||||
}
|
||||
|
||||
private function writeToFile($fileName, $data)
|
||||
{
|
||||
$fp = fopen($fileName, 'w');
|
||||
|
@ -44,13 +44,13 @@ class OutAppOrder extends BaseModel {
|
||||
public static function markFinished($orderId)
|
||||
{
|
||||
SqlHelper::update(
|
||||
myself()->_get(),
|
||||
myself()->_getMysql(''),
|
||||
't_outapp_order',
|
||||
array(
|
||||
'order_id' => $orderId,
|
||||
),
|
||||
array(
|
||||
'state' => self::FINISHED_STATE,
|
||||
'status' => self::FINISHED_STATE,
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -58,13 +58,13 @@ class OutAppOrder extends BaseModel {
|
||||
public static function markFailed($orderId)
|
||||
{
|
||||
SqlHelper::update(
|
||||
myself()->_get(),
|
||||
myself()->_getMysql(''),
|
||||
't_outapp_order',
|
||||
array(
|
||||
'order_id' => $orderId,
|
||||
),
|
||||
array(
|
||||
'state' => self::FAILED_STATE,
|
||||
'status' => self::FAILED_STATE,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ require_once("ShopAddItemService.php");
|
||||
|
||||
use phpcommon\SqlHelper;
|
||||
|
||||
use mt;
|
||||
use models\ShopBuyRecord;
|
||||
use models\OutAppOrder;
|
||||
use models\FirstTopup;
|
||||
@ -98,7 +99,7 @@ class OutAppPurchase {
|
||||
}
|
||||
}
|
||||
|
||||
$this->_rspOk();
|
||||
myself()->_rspOk();
|
||||
}
|
||||
|
||||
private function verifySign()
|
||||
|
Loading…
x
Reference in New Issue
Block a user