支付 文件

master
tpingzhang 5 years ago
parent d2a6dfcc98
commit e630a82ad7

@ -90,8 +90,7 @@ class AppleController extends BaseController{
public function apple_alipay_pay($user_id,$game_id){
#获取SDK上POST方式传过来的数据 然后base64解密 然后将json字符串转化成数组
//echo json_encode(['code'=>0,'msg'=> $user_id."game:".$game_id]);exit;
$request = $this->get_sdk_request($game_id, $user_id);
$request['pay_order_number'] = "SP_".date('Ymd').date('His').sp_random_string(4);
$request = $this->get_sdk_request($game_id, "SP_".date('Ymd').date('His').sp_random_string(4), $user_id);
$request['pay_status'] = 0;
$request['pay_way'] = C("PAY_WAY.ALIPAY");
$request['spend_ip'] = get_client_ip();
@ -360,8 +359,7 @@ class AppleController extends BaseController{
*/
public function apple_weixin_pay($user_id,$game_id)
{
$request = $this->get_sdk_request($game_id, $user_id);
$request['pay_order_number'] = "SP_".date('Ymd').date('His').sp_random_string(4);
$request = $this->get_sdk_request($game_id, "SP_".date('Ymd').date('His').sp_random_string(4), $user_id);
$request['pay_status'] = 0;
$request['pay_way'] = C("PAY_WAY.WEIXIN");
$request['spend_ip'] = get_client_ip();
@ -647,8 +645,8 @@ class AppleController extends BaseController{
/* $file=file_get_contents("./Application/Sdk/OrderNo/".$user_id."-".$game_id.".txt");
$request = json_decode(think_decrypt($file),true); */
$request = $this->get_sdk_request($game_id, $user_id);
$request['pay_order_number'] = "SP_".date('Ymd').date('His').sp_random_string(4);
$out_trade_no = "PF_" . date('Ymd') . date('His') . sp_random_string(4);
$request = $this->get_sdk_request($game_id, $out_trade_no, $user_id);
$request['pay_status'] = 0;
// $request['pay_way'] = C("PAY_WAY.ALIPAY");
$request['spend_ip'] = get_client_ip();
@ -681,7 +679,6 @@ class AppleController extends BaseController{
// $this->set_message(1089,"fail","订单号重复,请关闭支付页面重新支付");
redirect(U('Spend/notice_v1',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>'订单号重复,请关闭支付页面重新支付')));exit;
}
$out_trade_no = "PF_" . date('Ymd') . date('His') . sp_random_string(4);
$request['order_number'] = $out_trade_no;
$request['pay_order_number'] = $out_trade_no;
$request['out_trade_no'] = $out_trade_no;

@ -874,7 +874,7 @@ class BaseController extends RestController{
/**
* 获取cp传过来的订单号等信息在exchange接口
*/
public function get_sdk_request($game_id, $user_id=0) {
public function get_sdk_request($game_id, $order_id, $user_id=0) {
if (!$user_id) {
if (!$this->userId) {
return ;
@ -888,9 +888,16 @@ class BaseController extends RestController{
if (!$payInfo || !$payInfo['info']) {
return ;
}
$request = json_decode($payInfo['info'], true);
return $request;
$info = json_decode($payInfo['info'], true);
$info['pay_order_number'] = $order_id;
M("pay_info", "tab_")->where([
'id' => $payInfo['id']
])->save([
'order_id' => $order_id,
'info' => json_encode($info)
]);
return $info;
}

@ -274,8 +274,7 @@ class PayH5Controller extends BaseController{
*/
public function ali_pay($user_id,$game_id){
#获取SDK上POST方式传过来的数据 然后base64解密 然后将json字符串转化成数组
$request = $this->get_sdk_request($game_id);
$request['pay_order_number'] = "SP_".date('Ymd').date('His').sp_random_string(4);
$request = $this->get_sdk_request($game_id, "SP_".date('Ymd').date('His').sp_random_string(4));
$request['pay_status'] = 0;
$request['pay_way'] = C("PAY_WAY.ALIPAY");
$request['spend_ip'] = get_client_ip();
@ -1219,8 +1218,8 @@ ADD COLUMN `pay_url` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL AFTER
/* $file=file_get_contents("./Application/Sdk/OrderNo/".$user_id."-".$game_id.".txt");
$request = json_decode(think_decrypt($file),true); */
$request = $this->get_sdk_request($game_id);
$request['pay_order_number'] = "SP_".date('Ymd').date('His').sp_random_string(4);
$request = $this->get_sdk_request($game_id, "SP_".date('Ymd').date('His').sp_random_string(4));
// $request['pay_order_number'] = "SP_".date('Ymd').date('His').sp_random_string(4);
$request['pay_status'] = 0;
$request['pay_way'] = C("PAY_WAY.WEIXIN");
$request['spend_ip'] = get_client_ip();

Loading…
Cancel
Save