分销支付
This commit is contained in:
parent
c3612b0f8c
commit
36a2b19d4f
@ -23,7 +23,7 @@ include_once "../vendor/icbc-api-sdk-cop-php/UiIcbcClient.php";
|
||||
|
||||
class Gh extends Api
|
||||
{
|
||||
public $like_not_need_login = ['pay'];
|
||||
public $like_not_need_login = ['pay','checkReturn'];
|
||||
private $APP_ID = '11000000000000026359';
|
||||
private $url = 'https://gw.open.icbc.com.cn/api/mybank/enterprise/pay/payent/V1';
|
||||
private $PRI_KEY = "MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC9Soh5U2wx4YQJUaXn80cuHzmZl8p+07yUwl5jawuS88zy6lyPav32ZrsTfQQZv4uqfYCA4oT+BIQE6Segd5yd90FcGHH/vYb9b7JLZxslUGiuXuD6u9ULPt3Upgy9IROq8ghyhBFas3rfNl48Hh0L5WKADYb3Ywi/CqbSKUe4hVJ22GbrGz1eMwZxMD2yveHsmFrsNTYTiy3u+kASk479iYkVxOoobwMMv+1BsnmrAqs5uJt+LVcR2qmLJE0Gyog+CvRI2MORIcYvu8yzwkJu2gsZTVr6yl3WyKv5Mh+79dloimP6YHJWvlmpu77BUsBSofCttPAkEsWG57Rfrft3AgMBAAECggEASpxePrRLKT4itSmho1OY8u0L3yadgnAjHN+gJL/EyB+g4P7PjRg3EjBb/MqCG0QM4R6m0CZ5FUbiYq0kGXQMH5eeA5b/GDa0RqEIPgBeCs8u88wiEbKHvu8AsRjiXIn1HqRYAAtea8ni3KipbDjSaiX4NVEfqdM3V1Xze1MaGfiFgs2artnUw3ZgiUeEIJxpuqwplXsUeZBKm88XNo7mfBfBvP3VFq9HF4O6Lo01SfCn+DWQfEpiRoS7xHfPhxnkggNdr4OMzUg7DV1xTJpX5FeeakuVO4CkyRBrjIR1W6Eq7HeAsoNoPK1OdoBN4zP77H0zW7RT0D8EImfkJKgpwQKBgQDZHH+zD6gvrlReN8DBt0wUksaQ3vAIlXrBIpshPDMvFpqBMQ2SIuMWx9CGiTX4iMAtdQR7cHG2lDwnyv6wjE4lejAZ0E3eHiQJsvA41pbZzenbiilLTv92Ea2PgR8V/qXxIyafedD3Xec7BilmOm+h33ZIo4v8MFjy83FT3H9vswKBgQDfMluU5K49rdtJpRlpCFywqPac7KOpcVT2T6UYmPO1fxek+3lnhB2qFMiJWBYI30mHRglERFRWWoHdEir2eUhXY5u/kN6ncVsMHCVqslJKmBBEeHJRFl41IbwByBHAPqKIcXI5lLyQdNxmgnG3tZDBDTQPz2pdbjARMb9o3wbDLQKBgQDX7bwjvoKrSVqnihOvljmYjJHoK5HXN7OqulxHJbRSNMzdiIfSu9fXJEuEQprm4Dsh+qvGiQLPb4aUnRPJSwG9zFRimAWZz6hP7SN1pBbL8DuSGUsQlzUDnHldrDHakjVAKpGTMnheTYpX7bzm619zQuhFPkNPQlZ06yHfIgGseQKBgQCXi4enNwYflvY3sMPqDuVwhai8r+gH2o2HmFhOtTt0VlDlkmHCKXBC1U28A3UinQk9sg4ErihdYaKfSgClzX+S5m0PyvuC0XKybEHzihRZ1ZnmA6oK6JcamEchJoj28RBGeFDIS/ckVlR3vcYcqEka6y4YNgrQWUqFwjNmr1fWGQKBgQDGFD2O3/2MH068DMTskQWWoJWV1Isvst+oXBgERKkh5A/BYAAaw9kb+tKke/czulajRizv+nhstPQ2d/701QmdLCK6rK05SEChctaq7Cxk2QRRWHznYPqmJHPkuUXqg5LaOa81UDlGKDK1ylljppZOONlLtm00k6s5fLOe1SRfJg==";
|
||||
@ -142,12 +142,52 @@ class Gh extends Api
|
||||
$r['nonceStr'] = $r['noncestr'];
|
||||
$r['timeStamp'] = $r['timestamp'];
|
||||
$r['paySign'] = $r['sign'];
|
||||
$r['order_num'] = $order_num;
|
||||
return JsonServer::success('查询成功',$r);
|
||||
|
||||
}
|
||||
public function getMsgId(){
|
||||
return substr(md5("donglonghui".time().mt_rand(1,1000000)),8,13);
|
||||
}
|
||||
// 查询回调记录
|
||||
public function checkReturn($money=1,$type=""){
|
||||
Log::write('test_msg', 'info');die;
|
||||
$user_id = $this->user_id;
|
||||
$merchant = 70; //商户获取金额比例
|
||||
$our = 5; //服务费
|
||||
$other = 3; // 其他分销推广人员费用
|
||||
$user_billions = 22; // 其他+服务费
|
||||
$user_msg = UserAuth::where("user_id",$user_id)->find();
|
||||
$out = "dlh1731383512979";
|
||||
$basic = $this->basic($user_id,$out,$money,$our,$user_msg,$type);
|
||||
$general1 = $this->general1($user_id,$out,$money,$other,$user_msg,$type);
|
||||
$general2 = $this->general2($user_id,$out,$money,$user_billions,$user_msg,$type);
|
||||
// $basic['']
|
||||
$order_submit_act_input = array($basic,$general1,$general2);
|
||||
if($type != 0){
|
||||
$userAccount = $this->userAccount($user_id,$out,$money,$merchant,$user_msg);
|
||||
$order_num = 4;
|
||||
$order_submit_act_input = array($userAccount,$basic,$general1,$general2);
|
||||
}
|
||||
|
||||
$request = [
|
||||
'serviceUrl' => 'https://gw.open.icbc.com.cn/api/cardbusiness/aggregatepay/b2c/online/consumepurchase/V2',
|
||||
'method' => 'POST',
|
||||
'isNeedEncrypt'=>false,
|
||||
'biz_content' => array(
|
||||
"return_code"=>"0",
|
||||
"return_msg"=>"success",
|
||||
"order_submit_act_input"=>$order_submit_act_input
|
||||
),
|
||||
'extraParams'=>[]
|
||||
];
|
||||
print_r("<pre>");
|
||||
var_dump($request);
|
||||
$msg_id = $this->getMsgId();
|
||||
$res = $this->apiClient->execute($request,$msg_id,"");
|
||||
$result = json_decode($res,true);
|
||||
var_dump($result);
|
||||
}
|
||||
// 用户账户
|
||||
public function userAccount($user_id,$out,$money,$merchant,$user_msg){
|
||||
$out1 = "dlh".time().$user_id."1";
|
||||
@ -180,7 +220,8 @@ class Gh extends Api
|
||||
|
||||
// 基本户
|
||||
public function basic($user_id,$out,$money,$our,$user_msg,$type){
|
||||
$out2 = "dlh".time().$user_id."2";
|
||||
$out2 = "dlh17314648899792";
|
||||
// $out2 = "dlh".time().$user_id."2";
|
||||
$data2['rec_num'] = "1";
|
||||
$data2['seq_no'] = $out;
|
||||
$data2['sub_order_id'] = $out2;
|
||||
@ -213,7 +254,8 @@ class Gh extends Api
|
||||
|
||||
// 一般户1
|
||||
public function general1($user_id,$out,$money,$other,$user_msg,$type){
|
||||
$out3 = "dlh".time().$user_id."3";
|
||||
$out3 = "dlh17314648899793";
|
||||
// $out3 = "dlh".time().$user_id."3";
|
||||
$data3['rec_num'] = "2";
|
||||
$data3['seq_no'] = $out;
|
||||
$data3['sub_order_id'] = $out3;
|
||||
@ -245,7 +287,8 @@ class Gh extends Api
|
||||
}
|
||||
// 一般户2
|
||||
public function general2($user_id,$out,$money,$user_billions,$user_msg){
|
||||
$out4 = "dlh".time().$user_id."4";
|
||||
// $out4 = "dlh".time().$user_id."4";
|
||||
$out4 = "dlh17314648899794";
|
||||
$data4['rec_num'] = "3";
|
||||
$data4['seq_no'] = $out;
|
||||
$data4['sub_order_id'] = $out4;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user