songdb 6 年之前
父節點
當前提交
6850b55f91
共有 1 個文件被更改,包括 25 次插入3 次删除
  1. 25 3
      app/Libs/Pay/Merchants/OriginBank.php

+ 25 - 3
app/Libs/Pay/Merchants/OriginBank.php

@@ -40,9 +40,9 @@ class OriginBank
 
         dump('base_data');dump($base_data);
 
-        $response = $this->PayClient->request('POST','mct1/payorder',$base_data)->getBody()->getContents();
-        dd($response);
-        return $this->getPayInfo($response);
+        //$response = $this->PayClient->request('POST','mct1/payorder',$base_data)->getBody()->getContents();
+        dd($this->c($base_data));
+       // return $this->getPayInfo($response);
     }
 
     function getPayInfo($response)
@@ -69,6 +69,28 @@ class OriginBank
 
     }
 
+    public function c($data){
+        //启动一个CURL会话
+        $ch = curl_init();
+        // 设置curl允许执行的最长秒数
+        curl_setopt($ch, CURLOPT_TIMEOUT, 120);
+        //忽略证书
+        curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false);
+        curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,false);
+        // 获取的信息以文件流的形式返回,而不是直接输出。
+        curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
+        curl_setopt($ch, CURLOPT_URL,'https://mixpayuat4.orangebank.com.cn/mct1/payorder');
+        //发送一个常规的POST请求。
+        curl_setopt($ch, CURLOPT_POST, 1);
+        curl_setopt($ch, CURLOPT_POSTFIELDS,$data);
+        curl_setopt($ch, CURLOPT_HEADER,0);//是否需要头部信息(否)
+        // 执行操作
+        $result = curl_exec($ch);
+        #返回数据
+        return $result;
+
+    }
+
     //签名
     public function signs($array){
         $signature = array();