diff --git a/Application/Sdk/Controller/PayH5Controller.class.php b/Application/Sdk/Controller/PayH5Controller.class.php index de50dd5..2ac3486 100644 --- a/Application/Sdk/Controller/PayH5Controller.class.php +++ b/Application/Sdk/Controller/PayH5Controller.class.php @@ -226,7 +226,33 @@ class PayH5Controller extends BaseController{ $orderno = $request['pay_order_number']; } else { echo json_encode(['code'=>1001,'msg'=> "请求发起失败【{$response->getMsg()}】,请选择其他支付方式或联系客服"]);exit; - } + } + } elseif ($pay_info['channel'] == 11) { // 外部支付宝 + $request['pay_way'] = 41; + $request['pay_status'] = 0; + $request['spend_ip'] = get_client_ip(); + + $this->add_deposit($request, 1); + + $notifyUrl = C('PAY_DOMAIN')."/callback.php/Notify/kd_callback"; + $backUrl = C('PAY_DOMAIN')."sdk.php/Spend/paycallback/orderno/{$request['pay_order_number']}/user_token/".$this->userToken."/paytype/weixinpay/game_id/{$game_id}"; + + $userInfo = get_user_entity($request['user_id']); + $response = AlipayApi::pay($request, $userInfo, $notifyUrl, $backUrl); + + if($response['code'] == '0000'){ + // 存入pay_url 继续支付 + M("deposit", "tab_")->where([ + 'extend' => $request['extend'], + 'game_id' => $request['game_id'], + 'pay_order_number' => $request["pay_order_number"] + ])->save([ + 'pay_url' => $response['data']['pay_url'] + ]); + $orderno = $request['pay_order_number']; + } else { + echo json_encode(['code'=>1001,'msg'=> "请求发起失败【{$response['message']}】,请选择其他支付方式或联系客服"]);exit; + } } else{ // 支付宝第三方 if( empty(C('goldpig.partner'))||empty(C('goldpig.wooolid'))){ // $this->set_message(1009, "fail", "支付参数未配置"); diff --git a/ThinkPHP/Library/Org/OuterPay/AlipayApi.class.php b/ThinkPHP/Library/Org/OuterPay/AlipayApi.class.php index f8fc401..206a342 100644 --- a/ThinkPHP/Library/Org/OuterPay/AlipayApi.class.php +++ b/ThinkPHP/Library/Org/OuterPay/AlipayApi.class.php @@ -60,5 +60,6 @@ class AlipayApi $response = curl_exec($curl); curl_close($curl); return $response; + var_dump(urldecode('https://openapi.alipay.com/gateway.do?app_id=2021004129619376&biz_content=%7B%22subject%22%3A%22%E6%B6%88%E8%B4%B9_SP_20231212143602pGYx%22%2C%22out_trade_no%22%3A%22SP_20231212143602pGYx%22%2C%22total_amount%22%3A%226E%2B00%22%2C%22product_code%22%3A%22%22%7D&charset=utf-8&format=JSON&method=alipay.trade.wap.pay¬ify_url=http%3A%2F%2Fpay.hexidongkeji.top%2Fnotify&return_url=http%3A%2F%2Fpay.hexidongkeji.top%2Freturn&sign=H44Ll1KLmiE8ogbypyHb1cw7kHTmefLgN6vOOcTS1yxSRMaKHIpdT8e%2F030Bok2bQQiueVXzymEVeMUFs5NS9bvc7m6%2FoyaWpmmIUwNuqYJDgx8hof6qFVEsifWEhRTBgPbzVU9NPuwzP84FTqsVtahfSEaPVkdIcaBao8RC7pgoXCwcNGCG4JK6J0ZQNgIwWdccpKWWmMlXVNaXCJoAdnYTb3VUucBL3o7osRShFP3Z8UTFBW1Uo1jQ2wIuF%2BREQwj3til3CWCU6PEvkIbq4NPRmMxy4sEJGWE8gdjV0Y5pSsXOp1xwq125YqS%2BcGufgtmx7P5%2FlKL99drZEy%2FC7Q%3D%3D&sign_type=RSA2×tamp=2023-12-12+14%3A36%3A03&version=1.0')); } } \ No newline at end of file