|
@@ -42,13 +42,13 @@ class CTCard implements IOpenCard
|
|
|
"reqTime"=>$reqTime,
|
|
|
"method"=>$method,
|
|
|
"version"=>"1",
|
|
|
- "attach"=>"fraud_check",
|
|
|
+ "attach"=>"hello",
|
|
|
"sign"=>$sign
|
|
|
];
|
|
|
}
|
|
|
|
|
|
|
|
|
- private function request($head_method,$biz,&$net_errno)
|
|
|
+ private function request($head_method,$biz,&$net_errno) : array
|
|
|
{
|
|
|
$params['head'] = $this->head($head_method);
|
|
|
$params['biz'] = $biz;
|
|
@@ -76,143 +76,43 @@ class CTCard implements IOpenCard
|
|
|
}
|
|
|
|
|
|
|
|
|
- public function fraud_check($biz) : array
|
|
|
+ public function fraud_check($biz) : void
|
|
|
{
|
|
|
[$succ, $head, $biz] = $this->request('fraudCheck', $biz, $net_errno);
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
|
|
|
- public function number_list($biz, &$net_errno = 0) : array
|
|
|
+ public function number_list($biz) : void
|
|
|
{
|
|
|
- $params['head'] = $this->head("qryNbrList");
|
|
|
- $params['biz'] = $biz;
|
|
|
- $requestParameters = json_encode($params, JSON_UNESCAPED_UNICODE);
|
|
|
- $resp = http_post_data(config::production_env['DcoosExternalNetwork'], $requestParameters , config::HeaderProduction, $net_errno);
|
|
|
- return $resp;
|
|
|
+ [$succ, $head, $biz] = $this->request('qryNbrList', $biz, $net_errno);
|
|
|
}
|
|
|
|
|
|
- public function address_delivery($biz, &$net_errno = 0) : array
|
|
|
+ public function address_delivery($biz) : void
|
|
|
{
|
|
|
- $callBack = function ($resp)
|
|
|
- {
|
|
|
- $resp = json_decode($resp, true);
|
|
|
- $err = $resp["head"]["err"];
|
|
|
- $code = $resp["head"]["code"];
|
|
|
- if(empty($resp["biz"])){
|
|
|
- return [$err, $code, []];
|
|
|
- }
|
|
|
- return [$err, $code, $resp];
|
|
|
- };
|
|
|
-
|
|
|
- $params['head'] = $this->head("qryReceiveAddr");
|
|
|
- $params['biz'] = $biz;
|
|
|
- $requestParameters = json_encode($params, JSON_UNESCAPED_UNICODE);
|
|
|
- $resp = http_post_data(config::production_env['DcoosExternalNetwork'], $requestParameters , config::HeaderProduction, $net_errno);
|
|
|
- if (empty($resp)) {
|
|
|
- return [false, '网络错误'];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- list($err, $code, $response) = $callBack($resp);
|
|
|
- if ($code == 0){ // 成功
|
|
|
- return [true, "成功", $response];
|
|
|
- }else { // 失败
|
|
|
- return [false, $err];
|
|
|
- }
|
|
|
- }
|
|
|
+ [$succ, $head, $biz] = $this->request('qryReceiveAddr', $biz, $net_errno);
|
|
|
}
|
|
|
|
|
|
- public function broadband_address_list($biz, &$net_errno = 0) : array
|
|
|
+ public function broadband_address_list($biz) : void
|
|
|
{
|
|
|
- $callBack = function ($resp)
|
|
|
- {
|
|
|
- $resp = json_decode($resp, true);
|
|
|
- $err = $resp["head"]["err"];
|
|
|
- $code = $resp["head"]["code"];
|
|
|
- if(empty($resp["biz"])){
|
|
|
- return [$err, $code, []];
|
|
|
- }
|
|
|
- return [$err, $code, $resp];
|
|
|
- };
|
|
|
-
|
|
|
- $params['head'] = $this->head("qryAddressInfo");
|
|
|
- $params['biz'] = $biz;
|
|
|
- $requestParameters = json_encode($params, JSON_UNESCAPED_UNICODE);
|
|
|
- $resp = http_post_data(config::production_env['DcoosExternalNetwork'], $requestParameters , config::HeaderProduction, $net_errno);
|
|
|
- if (empty($resp)) {
|
|
|
- return [false, '网络错误'];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- list($err, $code, $response) = $callBack($resp);
|
|
|
- if ($code == 0){ // 成功
|
|
|
- return [true, "成功", $response];
|
|
|
- }else { // 失败
|
|
|
- return [false, $err];
|
|
|
- }
|
|
|
- }
|
|
|
+ [$succ, $head, $biz] = $this->request('qryAddressInfo', $biz, $net_errno);
|
|
|
}
|
|
|
|
|
|
- public function broadband_address_resource_query($biz, &$net_errno = 0) : array
|
|
|
+ public function broadband_address_resource_query($biz) : void
|
|
|
{
|
|
|
- $callBack = function ($resp)
|
|
|
- {
|
|
|
- $resp = json_decode($resp, true);
|
|
|
- $err = $resp["head"]["err"];
|
|
|
- $code = $resp["head"]["code"];
|
|
|
- if(empty($resp["biz"])){
|
|
|
- return [$err, $code, []];
|
|
|
- }
|
|
|
- return [$err, $code, $resp];
|
|
|
- };
|
|
|
+ [$succ, $head, $biz] = $this->request('getAddressCover', $biz, $net_errno);
|
|
|
+ }
|
|
|
|
|
|
- $params['head'] = $this->head("getAddressCover");
|
|
|
- $params['biz'] = $biz;
|
|
|
- $requestParameters = json_encode($params, JSON_UNESCAPED_UNICODE);
|
|
|
- $resp = http_post_data(config::production_env['DcoosExternalNetwork'], $requestParameters , config::HeaderProduction, $net_errno);
|
|
|
- if (empty($resp)) {
|
|
|
- return [false, '网络错误'];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- list($err, $code, $response) = $callBack($resp);
|
|
|
- if ($code == 0){ // 成功
|
|
|
- return [true, "成功", $response];
|
|
|
- }else { // 失败
|
|
|
- return [false, $err];
|
|
|
- }
|
|
|
- }
|
|
|
+ public function logistics_path_query($biz) : void
|
|
|
+ {
|
|
|
+ [$succ, $head, $biz] = $this->request('getLogisticsTrajectory', $biz, $net_errno);
|
|
|
}
|
|
|
|
|
|
- public function logistics_path_query($biz, &$net_errno = 0) : array
|
|
|
+ public function add_order($biz) : void
|
|
|
{
|
|
|
- $callBack = function ($resp)
|
|
|
- {
|
|
|
- $resp = json_decode($resp, true);
|
|
|
- $err = $resp["head"]["err"];
|
|
|
- $code = $resp["head"]["code"];
|
|
|
- if(empty($resp["biz"])){
|
|
|
- return [$err, $code, []];
|
|
|
- }
|
|
|
- return [$err, $code, $resp];
|
|
|
- };
|
|
|
+ [$succ, $head, $biz] = $this->request('synOrderInfo', $biz, $net_errno);
|
|
|
+ }
|
|
|
|
|
|
- $params['head'] = $this->head("getAddressCover");
|
|
|
- $params['biz'] = $biz;
|
|
|
- $requestParameters = json_encode($params, JSON_UNESCAPED_UNICODE);
|
|
|
- $resp = http_post_data(config::production_env['DcoosExternalNetwork'], $requestParameters , config::HeaderProduction, $net_errno);
|
|
|
- if (empty($resp)) {
|
|
|
- return [false, '网络错误'];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- list($err, $code, $response) = $callBack($resp);
|
|
|
- if ($code == 0){ // 成功
|
|
|
- return [true, "成功", $response];
|
|
|
- }else { // 失败
|
|
|
- return [false, $err];
|
|
|
- }
|
|
|
- }
|
|
|
+ public function order_information_query($biz) : void
|
|
|
+ {
|
|
|
+ [$succ, $head, $biz] = $this->request('queryOrderInfo', $biz, $net_errno);
|
|
|
}
|
|
|
}
|