fix: 更新alinPay充值逻辑及Pcapi控制器
This commit is contained in:
@@ -10,6 +10,6 @@ ALTER TABLE `cg_user_withdraw`
|
||||
INSERT INTO `cg_pay_channel` (`name`, `key`, `value`, `status`) VALUES (
|
||||
'越南AlinPay',
|
||||
'ALIN_VN',
|
||||
'{"app_id":"276a857ff36814028b772724","secret":"请从三方后台获取并替换","collection_product_id":11,"payment_product_id":14}',
|
||||
'{"app_id":"276a857ff36814028b772724","secret":"660a4EB682d3787b5b43DC424Ab46e6348F5f4dB","collection_product_id":11,"payment_product_id":14}',
|
||||
1
|
||||
);
|
||||
|
||||
@@ -4091,7 +4091,8 @@ class Pcapi extends Controller{
|
||||
];
|
||||
}
|
||||
}
|
||||
return json(array('Success' => 1, 'Data' => $list));
|
||||
$data = encrypt_data(['status' => 1, 'data' => $list]);
|
||||
return json(array('Success' => 1, 'Data' => $data));
|
||||
}
|
||||
|
||||
// 取消提现
|
||||
|
||||
@@ -17,10 +17,19 @@ trait alinPay
|
||||
*/
|
||||
public function alin_online_order()
|
||||
{
|
||||
$user_id = intval(Request::instance()->post('user_id'));
|
||||
$money = intval(Request::instance()->post('price'));
|
||||
$client = intval(Request::instance()->post('client'));
|
||||
$username = trim(Request::instance()->post('username'));
|
||||
// 兼容加密请求(Pcapi)和明文请求(Order)
|
||||
$post = Request::instance()->post();
|
||||
if (isset($post['encryptData'])) {
|
||||
$post = decrypt_data($post);
|
||||
if (!$post) {
|
||||
return json(['status' => 0, 'message' => '数据解密失败']);
|
||||
}
|
||||
}
|
||||
|
||||
$user_id = intval($post['user_id'] ?? 0);
|
||||
$money = intval($post['price'] ?? 0);
|
||||
$client = intval($post['client'] ?? 0);
|
||||
$username = trim($post['username'] ?? '');
|
||||
|
||||
$user = Db::name('user')->where([
|
||||
'id' => $user_id,
|
||||
|
||||
Reference in New Issue
Block a user