修正医生处方列表参数错误问题,新增获取处方列表接口
This commit is contained in:
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
|
||||
namespace Extend\VerifyDun;
|
||||
|
||||
use App\Exception\BusinessException;
|
||||
|
||||
/**
|
||||
* 银行卡三/四要素认证
|
||||
*/
|
||||
class BankCard extends Base
|
||||
{
|
||||
public function checkBankCard(array $params){
|
||||
try {
|
||||
// 组合请求地址
|
||||
$api_url = $this->api_url . $this->version . '/bankcard/check';
|
||||
|
||||
$this->params['businessId'] = "98c43b77719e4752b15519fbce011a58";
|
||||
|
||||
$this->params = array_merge($this->params,$params);
|
||||
|
||||
// 获取签名
|
||||
$this->params['signature'] = $this->gen_signature();
|
||||
|
||||
$this->options["form_params"] = $this->params;
|
||||
|
||||
$result = $this->httpRuest->postRequest($api_url,$this->options);
|
||||
|
||||
if (empty($result)){
|
||||
return "银行卡认证失败";
|
||||
}
|
||||
|
||||
if ($result['code'] != "200"){
|
||||
throw new BusinessException("银行卡认证失败");
|
||||
}
|
||||
|
||||
if (empty($result['result'])){
|
||||
return "银行卡认证失败";
|
||||
}
|
||||
|
||||
// 处理不通过情况
|
||||
if ($result['result']['status'] == 2){
|
||||
switch ($result['result']['reasonType']) {
|
||||
case 2:
|
||||
return "持卡人信息与输入信息不一致";
|
||||
break;
|
||||
case 3:
|
||||
return "查无此银行卡";
|
||||
break;
|
||||
case 4:
|
||||
return "查无此身份证";
|
||||
break;
|
||||
case 5:
|
||||
return "手机号码格式不正确";
|
||||
break;
|
||||
case 6:
|
||||
return "银行卡号不正确";
|
||||
break;
|
||||
case 7:
|
||||
return "其他出错,请联系客服";
|
||||
break;
|
||||
|
||||
default:
|
||||
return "银行卡认证失败";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 处理status为其他情况
|
||||
if ($result['result']['status'] != 1){
|
||||
return "身份证认证失败";
|
||||
}
|
||||
|
||||
return "";
|
||||
} catch (\Exception $e) {
|
||||
throw new BusinessException($e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user