银行卡三要素核验
银行卡三要素核验2.0版
银行卡三要素核验AES加密版
银行卡三要素核验AES加密2.0版
银行卡三要素核验RSA加密版
银行卡三要素核验RSA加密2.0版
请求Header:
名称 | 值 | |
---|---|---|
Content-Type | application/x-www-form-urlencoded |
请求参数说明:
名称 | 必填 | 类型 | 说明 | |
---|---|---|---|---|
key | 是 | string | 在个人中心->我的数据,接口名称上方查看 | |
realname | 是 | string | 姓名 | |
idcard | 是 | string | 身份证号码 | |
bankcard | 是 | string | 银行卡卡号 | |
isshow | 否 | int | 是否显示匹配信息,0默认不显示,1显示 |
请求代码示例:
curl -k -i "http://v.juhe.cn/verifybankcard3/query?key=key&realname=%E6%9D%8E%E8%81%9A%E5%90%88&idcard=370121xxxxxxxx1040&bankcard=6321xxxxxxxx432&isshow="
<?php
/**
* 724-银行卡三要素核验 - 代码参考(根据实际业务情况修改)
*/
// 基本参数配置
$apiUrl = "http://v.juhe.cn/verifybankcard3/query"; // 接口请求URL
$method = "GET"; // 接口请求方式
$headers = ["Content-Type: application/x-www-form-urlencoded"]; // 接口请求header
$apiKey = "您申请的调用APIkey"; // 在个人中心->我的数据,接口名称上方查看
// 接口请求入参配置
$requestParams = [
'key' => $apiKey,
'realname'=> '李云客',
'idcard'=> '370121xxxxxxxx1040',
'bankcard'=> '6321xxxxxxxx432',
'isshow'=> '',
];
$requestParamsStr = http_build_query($requestParams);
// 发起接口网络请求
$curl = curl_init();
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($curl, CURLOPT_URL, $apiUrl . '?' . $requestParamsStr);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_FAILONERROR, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
if (1 == strpos("$" . $apiUrl, "https://")) {
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
}
$response = curl_exec($curl);
$httpInfo = curl_getinfo($curl);
curl_close($curl);
// 解析响应结果
$responseResult = json_decode($response, true);
if ($responseResult) {
// 网络请求成功。可依据业务逻辑和接口文档说明自行处理。
var_dump($responseResult);
} else {
// 网络异常等因素,解析结果异常。可依据业务逻辑自行处理。
// var_dump($httpInfo);
var_dump("请求异常");
}
import requests
# 724-银行卡三要素核验 - 代码参考(根据实际业务情况修改)
# 基本参数配置
apiUrl = 'http://v.juhe.cn/verifybankcard3/query' # 接口请求URL
apiKey = '您申请的调用APIkey' # 在个人中心->我的数据,接口名称上方查看
# 接口请求入参配置
requestParams = {
'key': apiKey,
'realname': '李云客',
'idcard': '370121xxxxxxxx1040',
'bankcard': '6321xxxxxxxx432',
'isshow': '',
}
# 发起接口网络请求
response = requests.get(apiUrl, params=requestParams)
# 解析响应结果
if response.status_code == 200:
responseResult = response.json()
# 网络请求成功。可依据业务逻辑和接口文档说明自行处理。
print(responseResult)
else:
# 网络异常等因素,解析结果异常。可依据业务逻辑自行处理。
print('请求异常')
package main
import (
"encoding/json"
"fmt"
"net/http"
"net/url"
)
func main() {
// 基本参数配置
apiUrl := "http://v.juhe.cn/verifybankcard3/query"
apiKey := "您申请的调用APIkey"
// 接口请求入参配置
requestParams := url.Values{}
requestParams.Set("key", apiKey)
requestParams.Set("realname", "李云客")
requestParams.Set("idcard", "370121xxxxxxxx1040")
requestParams.Set("bankcard", "6321xxxxxxxx432")
requestParams.Set("isshow", "")
// 发起接口网络请求
resp, err := http.Get(apiUrl + "?" + requestParams.Encode())
if err != nil {
fmt.Println("网络请求异常:", err)
return
}
defer resp.Body.Close()
var responseResult map[string]interface{}
err = json.NewDecoder(resp.Body).Decode(&responseResult)
if err != nil {
fmt.Println("解析响应结果异常:", err)
return
}
fmt.Println(responseResult)
}
using System;
using System.Net;
using Newtonsoft.Json;
using System.Collections.Generic;
using System.Linq;
namespace Common_API_Test.Test_Demo
{
class Csharp_get
{
static void Main(string[] args)
{
string url = "http://v.juhe.cn/verifybankcard3/query";
string apiKey = "您申请的调用APIkey";
Dictionary<string, string> data = new Dictionary<string, string>();
data.Add("key", apiKey);
data.Add( "realname", "李云客");
data.Add( "idcard", "370121xxxxxxxx1040");
data.Add( "bankcard", "6321xxxxxxxx432");
data.Add( "isshow", "");
using (WebClient client = new WebClient())
{
string fullUrl = url + "?" + string.Join("&", data.Select(x => x.Key + "=" + x.Value));
try
{
string responseContent = client.DownloadString(fullUrl);
dynamic responseData = JsonConvert.DeserializeObject(responseContent);
if (responseData != null)
{
Console.WriteLine("Return Code: " + responseData["error_code"]);
Console.WriteLine("Return Message: " + responseData["reason"]);
}
else
{
Console.WriteLine("json解析异常!");
}
}
catch (Exception)
{
Console.WriteLine("请检查其它错误");
}
}
}
}
}
const axios = require('axios'); // npm install axios
// 基本参数配置
const apiUrl = 'http://v.juhe.cn/verifybankcard3/query'; // 接口请求URL
const apiKey = '您申请的调用APIkey'; // 在个人中心->我的数据,接口名称上方查看
// 接口请求入参配置
const requestParams = {
key: apiKey,
realname: '李云客',
idcard: '370121xxxxxxxx1040',
bankcard: '6321xxxxxxxx432',
isshow: '',
};
// 发起接口网络请求
axios.get(apiUrl, {params: requestParams})
.then(response => {
// 解析响应结果
if (response.status === 200) {
const responseResult = response.data;
// 网络请求成功。可依据业务逻辑和接口文档说明自行处理。
console.log(responseResult);
} else {
// 网络异常等因素,解析结果异常。可依据业务逻辑自行处理。
console.log('请求异常');
}
})
.catch(error => {
// 网络请求失败,可以根据实际情况进行处理
console.log('网络请求失败:', error);
});
package cn.juhe.test;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;
import java.util.stream.Collectors;
public class JavaGet {
public static void main(String[] args) throws Exception {
String apiKey = "你申请的key";
String apiUrl = "http://v.juhe.cn/verifybankcard3/query";
HashMap<String, String> map = new HashMap<>();
map.put("key", apiKey);
map.put("realname", "李云客");
map.put("idcard", "370121xxxxxxxx1040");
map.put("bankcard", "6321xxxxxxxx432");
map.put("isshow", "");
URL url = new URL(String.format("%s?%s", apiUrl, params(map)));
BufferedReader in = new BufferedReader(new InputStreamReader((url.openConnection()).getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response);
}
public static String params(Map<String, String> map) {
return map.entrySet().stream()
.map(entry -> {
try {
return entry.getKey() + "=" + URLEncoder.encode(entry.getValue(), StandardCharsets.UTF_8.toString());
} catch (Exception e) {
e.printStackTrace();
return entry.getKey() + "=" + entry.getValue();
}
})
.collect(Collectors.joining("&"));
}
}
// 基本参数配置
NSString *apiUrl = @"http://v.juhe.cn/verifybankcard3/query"; // 接口请求URL
NSString *apiKey = @"您申请的调用APIkey"; // 在个人中心->我的数据,接口名称上方查看
// 接口请求入参配置
NSDictionary *requestParams = @{
@"key": apiKey,
@"realname": @"李云客",
@"idcard": @"370121xxxxxxxx1040",
@"bankcard": @"6321xxxxxxxx432",
@"isshow": @"",
};
// 发起接口网络请求
NSURLComponents *components = [NSURLComponents componentsWithString:apiUrl];
NSMutableArray *queryItems = [NSMutableArray array];
[requestParams enumerateKeysAndObjectsUsingBlock:^(NSString *key, NSString *value, BOOL *stop) {
[queryItems addObject:[NSURLQueryItem queryItemWithName:key value:value]];
}];
components.queryItems = queryItems;
NSURL *url = components.URL;
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *task = [session dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
// 网络请求异常处理
NSLog(@"请求异常");
} else {
NSError *jsonError;
NSDictionary *responseResult = [NSJSONSerialization JSONObjectWithData:data options:0 error:&jsonError];
if (!jsonError) {
// 网络请求成功处理
// NSLog(@"%@", [responseResult objectForKey:@"error_code"]);
NSLog(@"%@", responseResult);
} else {
// 解析结果异常处理
NSLog(@"解析结果异常");
}
}
}];
[task resume];
返回参数说明:
名称 | 类型 | 说明 | |
---|---|---|---|
error_code | int | 返回码 | |
reason | string | 返回码描述 | |
jobid | string | 本次查询流水号 | |
bankcard | string | 银行卡卡号 | |
realname | string | 姓名 | |
idcard | string | 身份证号码 | |
res | int | 匹配结果,1:匹配 2:不匹配 | |
message | string | 只有参数isshow不为空且不为0时显示 |
JSON返回示例:JSON在线格式化工具 >
{
"reason": "成功",
"result": {
"jobid": "JH2071191112162139847181e7",
"bankcard": "*************",
"realname": "***",
"idcard": "***************",
"res": 2,
"message": "认证信息不匹配,银行卡无效"
},
"error_code": 0
}
--------------------------------失败示例-----------------------------------------------
{
"reason": "认证失败,银行卡状态异常,详情请咨询您的发卡行",
"result": {
"jobid": "JH207117111112213988818111"/*本次查询流水号*/
},
"error_code": 220703
}
请求Header:
名称 | 值 | |
---|---|---|
Content-Type | application/x-www-form-urlencoded |
请求参数说明:
名称 | 必填 | 类型 | 说明 | |
---|---|---|---|---|
key | 是 | string | 在个人中心->我的数据,接口名称上方查看 | |
realname | 是 | string | 姓名 | |
idcard | 是 | string | 证件号码 | |
bankcard | 是 | string | 银行卡卡号 | |
idtype | 否 | string | 证件类型,具体见JSON示例。默认:01 | |
isshow | 否 | int | 是否显示匹配信息,0默认不显示,1显示 | |
code | 否 | string | 发起交易商户业务编码, 具体见JSON示例,如:01 | |
customer | 否 | string | 公司名+产品名称+具体使用该服务的步骤。如:**有限公司+**APP/**产品+注册开户 |
请求代码示例:
curl -k -i "http://v.juhe.cn/verifybankcard3/query_v2?key=key&realname=%E6%9D%8E%E8%81%9A%E5%90%88&idcard=370121xxxxxxxx1040&bankcard=6321xxxxxxxx432&idtype=01&isshow=&code=&customer="
<?php
/**
* 1238-银行卡三要素核验2.0版 - 代码参考(根据实际业务情况修改)
*/
// 基本参数配置
$apiUrl = "http://v.juhe.cn/verifybankcard3/query_v2"; // 接口请求URL
$method = "GET"; // 接口请求方式
$headers = ["Content-Type: application/x-www-form-urlencoded"]; // 接口请求header
$apiKey = "您申请的调用APIkey"; // 在个人中心->我的数据,接口名称上方查看
// 接口请求入参配置
$requestParams = [
'key' => $apiKey,
'realname'=> '李云客',
'idcard'=> '370121xxxxxxxx1040',
'bankcard'=> '6321xxxxxxxx432',
'idtype'=> '01',
'isshow'=> '',
'code'=> '',
'customer'=> '',
];
$requestParamsStr = http_build_query($requestParams);
// 发起接口网络请求
$curl = curl_init();
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($curl, CURLOPT_URL, $apiUrl . '?' . $requestParamsStr);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_FAILONERROR, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
if (1 == strpos("$" . $apiUrl, "https://")) {
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
}
$response = curl_exec($curl);
$httpInfo = curl_getinfo($curl);
curl_close($curl);
// 解析响应结果
$responseResult = json_decode($response, true);
if ($responseResult) {
// 网络请求成功。可依据业务逻辑和接口文档说明自行处理。
var_dump($responseResult);
} else {
// 网络异常等因素,解析结果异常。可依据业务逻辑自行处理。
// var_dump($httpInfo);
var_dump("请求异常");
}
import requests
# 1238-银行卡三要素核验2.0版 - 代码参考(根据实际业务情况修改)
# 基本参数配置
apiUrl = 'http://v.juhe.cn/verifybankcard3/query_v2' # 接口请求URL
apiKey = '您申请的调用APIkey' # 在个人中心->我的数据,接口名称上方查看
# 接口请求入参配置
requestParams = {
'key': apiKey,
'realname': '李云客',
'idcard': '370121xxxxxxxx1040',
'bankcard': '6321xxxxxxxx432',
'idtype': '01',
'isshow': '',
'code': '',
'customer': '',
}
# 发起接口网络请求
response = requests.get(apiUrl, params=requestParams)
# 解析响应结果
if response.status_code == 200:
responseResult = response.json()
# 网络请求成功。可依据业务逻辑和接口文档说明自行处理。
print(responseResult)
else:
# 网络异常等因素,解析结果异常。可依据业务逻辑自行处理。
print('请求异常')
package main
import (
"encoding/json"
"fmt"
"net/http"
"net/url"
)
func main() {
// 基本参数配置
apiUrl := "http://v.juhe.cn/verifybankcard3/query_v2"
apiKey := "您申请的调用APIkey"
// 接口请求入参配置
requestParams := url.Values{}
requestParams.Set("key", apiKey)
requestParams.Set("realname", "李云客")
requestParams.Set("idcard", "370121xxxxxxxx1040")
requestParams.Set("bankcard", "6321xxxxxxxx432")
requestParams.Set("idtype", "01")
requestParams.Set("isshow", "")
requestParams.Set("code", "")
requestParams.Set("customer", "")
// 发起接口网络请求
resp, err := http.Get(apiUrl + "?" + requestParams.Encode())
if err != nil {
fmt.Println("网络请求异常:", err)
return
}
defer resp.Body.Close()
var responseResult map[string]interface{}
err = json.NewDecoder(resp.Body).Decode(&responseResult)
if err != nil {
fmt.Println("解析响应结果异常:", err)
return
}
fmt.Println(responseResult)
}
using System;
using System.Net;
using Newtonsoft.Json;
using System.Collections.Generic;
using System.Linq;
namespace Common_API_Test.Test_Demo
{
class Csharp_get
{
static void Main(string[] args)
{
string url = "http://v.juhe.cn/verifybankcard3/query_v2";
string apiKey = "您申请的调用APIkey";
Dictionary<string, string> data = new Dictionary<string, string>();
data.Add("key", apiKey);
data.Add( "realname", "李云客");
data.Add( "idcard", "370121xxxxxxxx1040");
data.Add( "bankcard", "6321xxxxxxxx432");
data.Add( "idtype", "01");
data.Add( "isshow", "");
data.Add( "code", "");
data.Add( "customer", "");
using (WebClient client = new WebClient())
{
string fullUrl = url + "?" + string.Join("&", data.Select(x => x.Key + "=" + x.Value));
try
{
string responseContent = client.DownloadString(fullUrl);
dynamic responseData = JsonConvert.DeserializeObject(responseContent);
if (responseData != null)
{
Console.WriteLine("Return Code: " + responseData["error_code"]);
Console.WriteLine("Return Message: " + responseData["reason"]);
}
else
{
Console.WriteLine("json解析异常!");
}
}
catch (Exception)
{
Console.WriteLine("请检查其它错误");
}
}
}
}
}
const axios = require('axios'); // npm install axios
// 基本参数配置
const apiUrl = 'http://v.juhe.cn/verifybankcard3/query_v2'; // 接口请求URL
const apiKey = '您申请的调用APIkey'; // 在个人中心->我的数据,接口名称上方查看
// 接口请求入参配置
const requestParams = {
key: apiKey,
realname: '李云客',
idcard: '370121xxxxxxxx1040',
bankcard: '6321xxxxxxxx432',
idtype: '01',
isshow: '',
code: '',
customer: '',
};
// 发起接口网络请求
axios.get(apiUrl, {params: requestParams})
.then(response => {
// 解析响应结果
if (response.status === 200) {
const responseResult = response.data;
// 网络请求成功。可依据业务逻辑和接口文档说明自行处理。
console.log(responseResult);
} else {
// 网络异常等因素,解析结果异常。可依据业务逻辑自行处理。
console.log('请求异常');
}
})
.catch(error => {
// 网络请求失败,可以根据实际情况进行处理
console.log('网络请求失败:', error);
});
package cn.juhe.test;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;
import java.util.stream.Collectors;
public class JavaGet {
public static void main(String[] args) throws Exception {
String apiKey = "你申请的key";
String apiUrl = "http://v.juhe.cn/verifybankcard3/query_v2";
HashMap<String, String> map = new HashMap<>();
map.put("key", apiKey);
map.put("realname", "李云客");
map.put("idcard", "370121xxxxxxxx1040");
map.put("bankcard", "6321xxxxxxxx432");
map.put("idtype", "01");
map.put("isshow", "");
map.put("code", "");
map.put("customer", "");
URL url = new URL(String.format("%s?%s", apiUrl, params(map)));
BufferedReader in = new BufferedReader(new InputStreamReader((url.openConnection()).getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response);
}
public static String params(Map<String, String> map) {
return map.entrySet().stream()
.map(entry -> {
try {
return entry.getKey() + "=" + URLEncoder.encode(entry.getValue(), StandardCharsets.UTF_8.toString());
} catch (Exception e) {
e.printStackTrace();
return entry.getKey() + "=" + entry.getValue();
}
})
.collect(Collectors.joining("&"));
}
}
// 基本参数配置
NSString *apiUrl = @"http://v.juhe.cn/verifybankcard3/query_v2"; // 接口请求URL
NSString *apiKey = @"您申请的调用APIkey"; // 在个人中心->我的数据,接口名称上方查看
// 接口请求入参配置
NSDictionary *requestParams = @{
@"key": apiKey,
@"realname": @"李云客",
@"idcard": @"370121xxxxxxxx1040",
@"bankcard": @"6321xxxxxxxx432",
@"idtype": @"01",
@"isshow": @"",
@"code": @"",
@"customer": @"",
};
// 发起接口网络请求
NSURLComponents *components = [NSURLComponents componentsWithString:apiUrl];
NSMutableArray *queryItems = [NSMutableArray array];
[requestParams enumerateKeysAndObjectsUsingBlock:^(NSString *key, NSString *value, BOOL *stop) {
[queryItems addObject:[NSURLQueryItem queryItemWithName:key value:value]];
}];
components.queryItems = queryItems;
NSURL *url = components.URL;
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *task = [session dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
// 网络请求异常处理
NSLog(@"请求异常");
} else {
NSError *jsonError;
NSDictionary *responseResult = [NSJSONSerialization JSONObjectWithData:data options:0 error:&jsonError];
if (!jsonError) {
// 网络请求成功处理
// NSLog(@"%@", [responseResult objectForKey:@"error_code"]);
NSLog(@"%@", responseResult);
} else {
// 解析结果异常处理
NSLog(@"解析结果异常");
}
}
}];
[task resume];
返回参数说明:
名称 | 类型 | 说明 | |
---|---|---|---|
error_code | int | 返回码 | |
reason | string | 返回码描述 | |
jobid | string | 本次查询流水号 | |
bankcard | string | 银行卡卡号 | |
realname | string | 姓名 | |
idcard | string | 证件号码 | |
res | int | 匹配结果,1:匹配 2:不匹配 | |
message | string | 只有参数isshow不为空且不为0时显示 |
JSON返回示例:JSON在线格式化工具 >
/**
code 商户业务编码 | idtype 证件类型
01 直销银行 | 01 身份证
02 消费金融 | 02 护照
03 银行二三类账户开户 | 03 港澳证(内地居民来往港澳通行证)
04 征信 | 04 台胞证
05 保险 | 11 回乡证(港澳居民来往内地通行证)
06 基金 | 18 台湾居民居住证
07 证券 | 19 港澳居民居住证
08 租赁 | 20 外国护照
09 海关申报 |
99 |
*/
{
"reason": "成功",
"result": {
"jobid": "JH2071191112162139847181e7",
"bankcard": "*************",
"realname": "***",
"idcard": "***************",
"res": 2,
"message": "认证信息不匹配,银行卡无效"
},
"error_code": 0
}
请求Header:
名称 | 值 | |
---|---|---|
Content-Type | application/x-www-form-urlencoded |
请求参数说明:
名称 | 必填 | 类型 | 说明 | |
---|---|---|---|---|
key | 是 | string | 在个人中心->我的数据,接口名称上方查看 | |
realname | 是 | string | 姓名加密 | |
idcard | 是 | string | 身份证号码加密 | |
bankcard | 是 | string | 银行卡卡号加密 |
请求代码示例:
curl -k -i "http://v.juhe.cn/verifybankcard3/queryEncry?key=key&realname=257e5ae7xxxxxxxxx9ab8d699&idcard=c9a6bce3xxxxxxxxx9d684cbf&bankcard=ec1a982cxxxxxxxxxc357ee4d"
<?php
/**
* 1431-银行卡三要素核验AES加密版 - 代码参考(根据实际业务情况修改)
*/
// 基本参数配置
$apiUrl = "http://v.juhe.cn/verifybankcard3/queryEncry"; // 接口请求URL
$method = "GET"; // 接口请求方式
$headers = ["Content-Type: application/x-www-form-urlencoded"]; // 接口请求header
$apiKey = "您申请的调用APIkey"; // 在个人中心->我的数据,接口名称上方查看
// 接口请求入参配置
$requestParams = [
'key' => $apiKey,
'realname'=> '257e5ae7xxxxxxxxx9ab8d699',
'idcard'=> 'c9a6bce3xxxxxxxxx9d684cbf',
'bankcard'=> 'ec1a982cxxxxxxxxxc357ee4d',
];
$requestParamsStr = http_build_query($requestParams);
// 发起接口网络请求
$curl = curl_init();
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($curl, CURLOPT_URL, $apiUrl . '?' . $requestParamsStr);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_FAILONERROR, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
if (1 == strpos("$" . $apiUrl, "https://")) {
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
}
$response = curl_exec($curl);
$httpInfo = curl_getinfo($curl);
curl_close($curl);
// 解析响应结果
$responseResult = json_decode($response, true);
if ($responseResult) {
// 网络请求成功。可依据业务逻辑和接口文档说明自行处理。
var_dump($responseResult);
} else {
// 网络异常等因素,解析结果异常。可依据业务逻辑自行处理。
// var_dump($httpInfo);
var_dump("请求异常");
}
import requests
# 1431-银行卡三要素核验AES加密版 - 代码参考(根据实际业务情况修改)
# 基本参数配置
apiUrl = 'http://v.juhe.cn/verifybankcard3/queryEncry' # 接口请求URL
apiKey = '您申请的调用APIkey' # 在个人中心->我的数据,接口名称上方查看
# 接口请求入参配置
requestParams = {
'key': apiKey,
'realname': '257e5ae7xxxxxxxxx9ab8d699',
'idcard': 'c9a6bce3xxxxxxxxx9d684cbf',
'bankcard': 'ec1a982cxxxxxxxxxc357ee4d',
}
# 发起接口网络请求
response = requests.get(apiUrl, params=requestParams)
# 解析响应结果
if response.status_code == 200:
responseResult = response.json()
# 网络请求成功。可依据业务逻辑和接口文档说明自行处理。
print(responseResult)
else:
# 网络异常等因素,解析结果异常。可依据业务逻辑自行处理。
print('请求异常')
package main
import (
"encoding/json"
"fmt"
"net/http"
"net/url"
)
func main() {
// 基本参数配置
apiUrl := "http://v.juhe.cn/verifybankcard3/queryEncry"
apiKey := "您申请的调用APIkey"
// 接口请求入参配置
requestParams := url.Values{}
requestParams.Set("key", apiKey)
requestParams.Set("realname", "257e5ae7xxxxxxxxx9ab8d699")
requestParams.Set("idcard", "c9a6bce3xxxxxxxxx9d684cbf")
requestParams.Set("bankcard", "ec1a982cxxxxxxxxxc357ee4d")
// 发起接口网络请求
resp, err := http.Get(apiUrl + "?" + requestParams.Encode())
if err != nil {
fmt.Println("网络请求异常:", err)
return
}
defer resp.Body.Close()
var responseResult map[string]interface{}
err = json.NewDecoder(resp.Body).Decode(&responseResult)
if err != nil {
fmt.Println("解析响应结果异常:", err)
return
}
fmt.Println(responseResult)
}
using System;
using System.Net;
using Newtonsoft.Json;
using System.Collections.Generic;
using System.Linq;
namespace Common_API_Test.Test_Demo
{
class Csharp_get
{
static void Main(string[] args)
{
string url = "http://v.juhe.cn/verifybankcard3/queryEncry";
string apiKey = "您申请的调用APIkey";
Dictionary<string, string> data = new Dictionary<string, string>();
data.Add("key", apiKey);
data.Add( "realname", "257e5ae7xxxxxxxxx9ab8d699");
data.Add( "idcard", "c9a6bce3xxxxxxxxx9d684cbf");
data.Add( "bankcard", "ec1a982cxxxxxxxxxc357ee4d");
using (WebClient client = new WebClient())
{
string fullUrl = url + "?" + string.Join("&", data.Select(x => x.Key + "=" + x.Value));
try
{
string responseContent = client.DownloadString(fullUrl);
dynamic responseData = JsonConvert.DeserializeObject(responseContent);
if (responseData != null)
{
Console.WriteLine("Return Code: " + responseData["error_code"]);
Console.WriteLine("Return Message: " + responseData["reason"]);
}
else
{
Console.WriteLine("json解析异常!");
}
}
catch (Exception)
{
Console.WriteLine("请检查其它错误");
}
}
}
}
}
const axios = require('axios'); // npm install axios
// 基本参数配置
const apiUrl = 'http://v.juhe.cn/verifybankcard3/queryEncry'; // 接口请求URL
const apiKey = '您申请的调用APIkey'; // 在个人中心->我的数据,接口名称上方查看
// 接口请求入参配置
const requestParams = {
key: apiKey,
realname: '257e5ae7xxxxxxxxx9ab8d699',
idcard: 'c9a6bce3xxxxxxxxx9d684cbf',
bankcard: 'ec1a982cxxxxxxxxxc357ee4d',
};
// 发起接口网络请求
axios.get(apiUrl, {params: requestParams})
.then(response => {
// 解析响应结果
if (response.status === 200) {
const responseResult = response.data;
// 网络请求成功。可依据业务逻辑和接口文档说明自行处理。
console.log(responseResult);
} else {
// 网络异常等因素,解析结果异常。可依据业务逻辑自行处理。
console.log('请求异常');
}
})
.catch(error => {
// 网络请求失败,可以根据实际情况进行处理
console.log('网络请求失败:', error);
});
package cn.juhe.test;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;
import java.util.stream.Collectors;
public class JavaGet {
public static void main(String[] args) throws Exception {
String apiKey = "你申请的key";
String apiUrl = "http://v.juhe.cn/verifybankcard3/queryEncry";
HashMap<String, String> map = new HashMap<>();
map.put("key", apiKey);
map.put("realname", "257e5ae7xxxxxxxxx9ab8d699");
map.put("idcard", "c9a6bce3xxxxxxxxx9d684cbf");
map.put("bankcard", "ec1a982cxxxxxxxxxc357ee4d");
URL url = new URL(String.format("%s?%s", apiUrl, params(map)));
BufferedReader in = new BufferedReader(new InputStreamReader((url.openConnection()).getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response);
}
public static String params(Map<String, String> map) {
return map.entrySet().stream()
.map(entry -> {
try {
return entry.getKey() + "=" + URLEncoder.encode(entry.getValue(), StandardCharsets.UTF_8.toString());
} catch (Exception e) {
e.printStackTrace();
return entry.getKey() + "=" + entry.getValue();
}
})
.collect(Collectors.joining("&"));
}
}
// 基本参数配置
NSString *apiUrl = @"http://v.juhe.cn/verifybankcard3/queryEncry"; // 接口请求URL
NSString *apiKey = @"您申请的调用APIkey"; // 在个人中心->我的数据,接口名称上方查看
// 接口请求入参配置
NSDictionary *requestParams = @{
@"key": apiKey,
@"realname": @"257e5ae7xxxxxxxxx9ab8d699",
@"idcard": @"c9a6bce3xxxxxxxxx9d684cbf",
@"bankcard": @"ec1a982cxxxxxxxxxc357ee4d",
};
// 发起接口网络请求
NSURLComponents *components = [NSURLComponents componentsWithString:apiUrl];
NSMutableArray *queryItems = [NSMutableArray array];
[requestParams enumerateKeysAndObjectsUsingBlock:^(NSString *key, NSString *value, BOOL *stop) {
[queryItems addObject:[NSURLQueryItem queryItemWithName:key value:value]];
}];
components.queryItems = queryItems;
NSURL *url = components.URL;
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *task = [session dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
// 网络请求异常处理
NSLog(@"请求异常");
} else {
NSError *jsonError;
NSDictionary *responseResult = [NSJSONSerialization JSONObjectWithData:data options:0 error:&jsonError];
if (!jsonError) {
// 网络请求成功处理
// NSLog(@"%@", [responseResult objectForKey:@"error_code"]);
NSLog(@"%@", responseResult);
} else {
// 解析结果异常处理
NSLog(@"解析结果异常");
}
}
}];
[task resume];
返回参数说明:
名称 | 类型 | 说明 | |
---|---|---|---|
error_code | int | 返回码 | |
reason | string | 返回码描述 | |
jobid | string | 本次查询流水号 | |
res | int | 匹配结果,1:匹配 2:不匹配 | |
message | string | 只有参数isshow不为空且不为0时显示 |
JSON返回示例:JSON在线格式化工具 >
加密算法:AES/ECB/PKCS5Padding,AES结果无需转小写,经过base64
加密后的数据需要urlencode传入
加密的密钥为:客户个人中心的openid经过md5后结果为小写取前16位
{
"reason": "成功",
"result": {
"jobid": "JH2071191112162139847181e7",
"res": 2,
"message": "认证信息不匹配,银行卡无效"
},
"error_code": 0
}
--------------------------------失败示例-----------------------------------------------
{
"reason": "认证失败,银行卡状态异常,详情请咨询您的发卡行",
"result": {
"jobid": "JH207117111112213988818111"/*本次查询流水号*/
},
"error_code": 220703
}
请求Header:
名称 | 值 | |
---|---|---|
Content-Type | application/x-www-form-urlencoded |
请求参数说明:
名称 | 必填 | 类型 | 说明 | |
---|---|---|---|---|
key | 是 | string | 在个人中心->我的数据,接口名称上方查看 | |
realname | 是 | string | 姓名加密 | |
idcard | 是 | string | 证件号码加密 | |
bankcard | 是 | string | 银行卡卡号加密 | |
idtype | 否 | string | 证件类型,具体见JSON示例。默认:01 | |
code | 否 | string | 发起交易商户业务编码, 具体见JSON示例,如:01 | |
customer | 否 | string | 公司名+产品名称+具体使用该服务的步骤。如:**有限公司+**APP/**产品+注册开户 |
请求代码示例:
curl -k -i "http://v.juhe.cn/verifybankcard3/queryEncry_v2?key=key&realname=257e5ae7xxxxxxxxx9ab8d699&idcard=c9a6bce3xxxxxxxxx9d684cbf&bankcard=ec1a982cxxxxxxxxxc357ee4d&idtype=&code=&customer="
<?php
/**
* 1432-银行卡三要素核验AES加密2.0版 - 代码参考(根据实际业务情况修改)
*/
// 基本参数配置
$apiUrl = "http://v.juhe.cn/verifybankcard3/queryEncry_v2"; // 接口请求URL
$method = "GET"; // 接口请求方式
$headers = ["Content-Type: application/x-www-form-urlencoded"]; // 接口请求header
$apiKey = "您申请的调用APIkey"; // 在个人中心->我的数据,接口名称上方查看
// 接口请求入参配置
$requestParams = [
'key' => $apiKey,
'realname'=> '257e5ae7xxxxxxxxx9ab8d699',
'idcard'=> 'c9a6bce3xxxxxxxxx9d684cbf',
'bankcard'=> 'ec1a982cxxxxxxxxxc357ee4d',
'idtype'=> '',
'code'=> '',
'customer'=> '',
];
$requestParamsStr = http_build_query($requestParams);
// 发起接口网络请求
$curl = curl_init();
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($curl, CURLOPT_URL, $apiUrl . '?' . $requestParamsStr);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_FAILONERROR, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
if (1 == strpos("$" . $apiUrl, "https://")) {
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
}
$response = curl_exec($curl);
$httpInfo = curl_getinfo($curl);
curl_close($curl);
// 解析响应结果
$responseResult = json_decode($response, true);
if ($responseResult) {
// 网络请求成功。可依据业务逻辑和接口文档说明自行处理。
var_dump($responseResult);
} else {
// 网络异常等因素,解析结果异常。可依据业务逻辑自行处理。
// var_dump($httpInfo);
var_dump("请求异常");
}
import requests
# 1432-银行卡三要素核验AES加密2.0版 - 代码参考(根据实际业务情况修改)
# 基本参数配置
apiUrl = 'http://v.juhe.cn/verifybankcard3/queryEncry_v2' # 接口请求URL
apiKey = '您申请的调用APIkey' # 在个人中心->我的数据,接口名称上方查看
# 接口请求入参配置
requestParams = {
'key': apiKey,
'realname': '257e5ae7xxxxxxxxx9ab8d699',
'idcard': 'c9a6bce3xxxxxxxxx9d684cbf',
'bankcard': 'ec1a982cxxxxxxxxxc357ee4d',
'idtype': '',
'code': '',
'customer': '',
}
# 发起接口网络请求
response = requests.get(apiUrl, params=requestParams)
# 解析响应结果
if response.status_code == 200:
responseResult = response.json()
# 网络请求成功。可依据业务逻辑和接口文档说明自行处理。
print(responseResult)
else:
# 网络异常等因素,解析结果异常。可依据业务逻辑自行处理。
print('请求异常')
package main
import (
"encoding/json"
"fmt"
"net/http"
"net/url"
)
func main() {
// 基本参数配置
apiUrl := "http://v.juhe.cn/verifybankcard3/queryEncry_v2"
apiKey := "您申请的调用APIkey"
// 接口请求入参配置
requestParams := url.Values{}
requestParams.Set("key", apiKey)
requestParams.Set("realname", "257e5ae7xxxxxxxxx9ab8d699")
requestParams.Set("idcard", "c9a6bce3xxxxxxxxx9d684cbf")
requestParams.Set("bankcard", "ec1a982cxxxxxxxxxc357ee4d")
requestParams.Set("idtype", "")
requestParams.Set("code", "")
requestParams.Set("customer", "")
// 发起接口网络请求
resp, err := http.Get(apiUrl + "?" + requestParams.Encode())
if err != nil {
fmt.Println("网络请求异常:", err)
return
}
defer resp.Body.Close()
var responseResult map[string]interface{}
err = json.NewDecoder(resp.Body).Decode(&responseResult)
if err != nil {
fmt.Println("解析响应结果异常:", err)
return
}
fmt.Println(responseResult)
}
using System;
using System.Net;
using Newtonsoft.Json;
using System.Collections.Generic;
using System.Linq;
namespace Common_API_Test.Test_Demo
{
class Csharp_get
{
static void Main(string[] args)
{
string url = "http://v.juhe.cn/verifybankcard3/queryEncry_v2";
string apiKey = "您申请的调用APIkey";
Dictionary<string, string> data = new Dictionary<string, string>();
data.Add("key", apiKey);
data.Add( "realname", "257e5ae7xxxxxxxxx9ab8d699");
data.Add( "idcard", "c9a6bce3xxxxxxxxx9d684cbf");
data.Add( "bankcard", "ec1a982cxxxxxxxxxc357ee4d");
data.Add( "idtype", "");
data.Add( "code", "");
data.Add( "customer", "");
using (WebClient client = new WebClient())
{
string fullUrl = url + "?" + string.Join("&", data.Select(x => x.Key + "=" + x.Value));
try
{
string responseContent = client.DownloadString(fullUrl);
dynamic responseData = JsonConvert.DeserializeObject(responseContent);
if (responseData != null)
{
Console.WriteLine("Return Code: " + responseData["error_code"]);
Console.WriteLine("Return Message: " + responseData["reason"]);
}
else
{
Console.WriteLine("json解析异常!");
}
}
catch (Exception)
{
Console.WriteLine("请检查其它错误");
}
}
}
}
}
const axios = require('axios'); // npm install axios
// 基本参数配置
const apiUrl = 'http://v.juhe.cn/verifybankcard3/queryEncry_v2'; // 接口请求URL
const apiKey = '您申请的调用APIkey'; // 在个人中心->我的数据,接口名称上方查看
// 接口请求入参配置
const requestParams = {
key: apiKey,
realname: '257e5ae7xxxxxxxxx9ab8d699',
idcard: 'c9a6bce3xxxxxxxxx9d684cbf',
bankcard: 'ec1a982cxxxxxxxxxc357ee4d',
idtype: '',
code: '',
customer: '',
};
// 发起接口网络请求
axios.get(apiUrl, {params: requestParams})
.then(response => {
// 解析响应结果
if (response.status === 200) {
const responseResult = response.data;
// 网络请求成功。可依据业务逻辑和接口文档说明自行处理。
console.log(responseResult);
} else {
// 网络异常等因素,解析结果异常。可依据业务逻辑自行处理。
console.log('请求异常');
}
})
.catch(error => {
// 网络请求失败,可以根据实际情况进行处理
console.log('网络请求失败:', error);
});
package cn.juhe.test;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;
import java.util.stream.Collectors;
public class JavaGet {
public static void main(String[] args) throws Exception {
String apiKey = "你申请的key";
String apiUrl = "http://v.juhe.cn/verifybankcard3/queryEncry_v2";
HashMap<String, String> map = new HashMap<>();
map.put("key", apiKey);
map.put("realname", "257e5ae7xxxxxxxxx9ab8d699");
map.put("idcard", "c9a6bce3xxxxxxxxx9d684cbf");
map.put("bankcard", "ec1a982cxxxxxxxxxc357ee4d");
map.put("idtype", "");
map.put("code", "");
map.put("customer", "");
URL url = new URL(String.format("%s?%s", apiUrl, params(map)));
BufferedReader in = new BufferedReader(new InputStreamReader((url.openConnection()).getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response);
}
public static String params(Map<String, String> map) {
return map.entrySet().stream()
.map(entry -> {
try {
return entry.getKey() + "=" + URLEncoder.encode(entry.getValue(), StandardCharsets.UTF_8.toString());
} catch (Exception e) {
e.printStackTrace();
return entry.getKey() + "=" + entry.getValue();
}
})
.collect(Collectors.joining("&"));
}
}
// 基本参数配置
NSString *apiUrl = @"http://v.juhe.cn/verifybankcard3/queryEncry_v2"; // 接口请求URL
NSString *apiKey = @"您申请的调用APIkey"; // 在个人中心->我的数据,接口名称上方查看
// 接口请求入参配置
NSDictionary *requestParams = @{
@"key": apiKey,
@"realname": @"257e5ae7xxxxxxxxx9ab8d699",
@"idcard": @"c9a6bce3xxxxxxxxx9d684cbf",
@"bankcard": @"ec1a982cxxxxxxxxxc357ee4d",
@"idtype": @"",
@"code": @"",
@"customer": @"",
};
// 发起接口网络请求
NSURLComponents *components = [NSURLComponents componentsWithString:apiUrl];
NSMutableArray *queryItems = [NSMutableArray array];
[requestParams enumerateKeysAndObjectsUsingBlock:^(NSString *key, NSString *value, BOOL *stop) {
[queryItems addObject:[NSURLQueryItem queryItemWithName:key value:value]];
}];
components.queryItems = queryItems;
NSURL *url = components.URL;
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *task = [session dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
// 网络请求异常处理
NSLog(@"请求异常");
} else {
NSError *jsonError;
NSDictionary *responseResult = [NSJSONSerialization JSONObjectWithData:data options:0 error:&jsonError];
if (!jsonError) {
// 网络请求成功处理
// NSLog(@"%@", [responseResult objectForKey:@"error_code"]);
NSLog(@"%@", responseResult);
} else {
// 解析结果异常处理
NSLog(@"解析结果异常");
}
}
}];
[task resume];
返回参数说明:
名称 | 类型 | 说明 | |
---|---|---|---|
error_code | int | 返回码 | |
reason | string | 返回码描述 | |
jobid | string | 本次查询流水号 | |
res | int | 匹配结果,1:匹配 2:不匹配 | |
message | string | 只有参数isshow不为空且不为0时显示 |
JSON返回示例:JSON在线格式化工具 >
/**
code 商户业务编码 | idtype 证件类型
01 直销银行 | 01 身份证
02 消费金融 | 02 护照
03 银行二三类账户开户 | 03 港澳证(内地居民来往港澳通行证)
04 征信 | 04 台胞证
05 保险 | 11 回乡证(港澳居民来往内地通行证)
06 基金 | 18 台湾居民居住证
07 证券 | 19 港澳居民居住证
08 租赁 | 20 外国护照
09 海关申报 |
99 |
*/
加密算法:AES/ECB/PKCS5Padding,AES结果无需转小写,经过base64
加密后的数据需要urlencode传入
加密的密钥为:客户个人中心的openid经过md5后结果为小写取前16位
[/color]
{
"reason": "成功",
"result": {
"jobid": "JH2071191112162139847181e7",
"res": 2,
"message": "认证信息不匹配,银行卡无效"
},
"error_code": 0
}
请求Header:
名称 | 值 | |
---|---|---|
Content-Type | application/x-www-form-urlencoded |
请求参数说明:
名称 | 必填 | 类型 | 说明 | |
---|---|---|---|---|
key | 是 | string | 在个人中心->我的数据,接口名称上方查看 | |
aesKey | 是 | string | RSA方式加密后的aes秘钥数组再base64(加密前必须为16位) | |
realname | 是 | string | 姓名加密 | |
idcard | 是 | string | 身份证号码加密 | |
bankcard | 是 | string | 银行卡卡号加密 |
请求代码示例:
curl -k -i "http://v.juhe.cn/verifybankcard3/queryEncryInfo?key=key&aesKey=xxx&realname=%E6%9D%8E%E8%81%9A%E5%90%88&idcard=370121xxxxxxxx1040&bankcard=6321xxxxxxxx432"
<?php
/**
* 1677-银行卡三要素核验RSA加密版 - 代码参考(根据实际业务情况修改)
*/
// 基本参数配置
$apiUrl = "http://v.juhe.cn/verifybankcard3/queryEncryInfo"; // 接口请求URL
$method = "GET"; // 接口请求方式
$headers = ["Content-Type: application/x-www-form-urlencoded"]; // 接口请求header
$apiKey = "您申请的调用APIkey"; // 在个人中心->我的数据,接口名称上方查看
// 接口请求入参配置
$requestParams = [
'key' => $apiKey,
'aesKey'=> 'xxx',
'realname'=> '李云客',
'idcard'=> '370121xxxxxxxx1040',
'bankcard'=> '6321xxxxxxxx432',
];
$requestParamsStr = http_build_query($requestParams);
// 发起接口网络请求
$curl = curl_init();
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($curl, CURLOPT_URL, $apiUrl . '?' . $requestParamsStr);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_FAILONERROR, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
if (1 == strpos("$" . $apiUrl, "https://")) {
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
}
$response = curl_exec($curl);
$httpInfo = curl_getinfo($curl);
curl_close($curl);
// 解析响应结果
$responseResult = json_decode($response, true);
if ($responseResult) {
// 网络请求成功。可依据业务逻辑和接口文档说明自行处理。
var_dump($responseResult);
} else {
// 网络异常等因素,解析结果异常。可依据业务逻辑自行处理。
// var_dump($httpInfo);
var_dump("请求异常");
}
import requests
# 1677-银行卡三要素核验RSA加密版 - 代码参考(根据实际业务情况修改)
# 基本参数配置
apiUrl = 'http://v.juhe.cn/verifybankcard3/queryEncryInfo' # 接口请求URL
apiKey = '您申请的调用APIkey' # 在个人中心->我的数据,接口名称上方查看
# 接口请求入参配置
requestParams = {
'key': apiKey,
'aesKey': 'xxx',
'realname': '李云客',
'idcard': '370121xxxxxxxx1040',
'bankcard': '6321xxxxxxxx432',
}
# 发起接口网络请求
response = requests.get(apiUrl, params=requestParams)
# 解析响应结果
if response.status_code == 200:
responseResult = response.json()
# 网络请求成功。可依据业务逻辑和接口文档说明自行处理。
print(responseResult)
else:
# 网络异常等因素,解析结果异常。可依据业务逻辑自行处理。
print('请求异常')
package main
import (
"encoding/json"
"fmt"
"net/http"
"net/url"
)
func main() {
// 基本参数配置
apiUrl := "http://v.juhe.cn/verifybankcard3/queryEncryInfo"
apiKey := "您申请的调用APIkey"
// 接口请求入参配置
requestParams := url.Values{}
requestParams.Set("key", apiKey)
requestParams.Set("aesKey", "xxx")
requestParams.Set("realname", "李云客")
requestParams.Set("idcard", "370121xxxxxxxx1040")
requestParams.Set("bankcard", "6321xxxxxxxx432")
// 发起接口网络请求
resp, err := http.Get(apiUrl + "?" + requestParams.Encode())
if err != nil {
fmt.Println("网络请求异常:", err)
return
}
defer resp.Body.Close()
var responseResult map[string]interface{}
err = json.NewDecoder(resp.Body).Decode(&responseResult)
if err != nil {
fmt.Println("解析响应结果异常:", err)
return
}
fmt.Println(responseResult)
}
using System;
using System.Net;
using Newtonsoft.Json;
using System.Collections.Generic;
using System.Linq;
namespace Common_API_Test.Test_Demo
{
class Csharp_get
{
static void Main(string[] args)
{
string url = "http://v.juhe.cn/verifybankcard3/queryEncryInfo";
string apiKey = "您申请的调用APIkey";
Dictionary<string, string> data = new Dictionary<string, string>();
data.Add("key", apiKey);
data.Add( "aesKey", "xxx");
data.Add( "realname", "李云客");
data.Add( "idcard", "370121xxxxxxxx1040");
data.Add( "bankcard", "6321xxxxxxxx432");
using (WebClient client = new WebClient())
{
string fullUrl = url + "?" + string.Join("&", data.Select(x => x.Key + "=" + x.Value));
try
{
string responseContent = client.DownloadString(fullUrl);
dynamic responseData = JsonConvert.DeserializeObject(responseContent);
if (responseData != null)
{
Console.WriteLine("Return Code: " + responseData["error_code"]);
Console.WriteLine("Return Message: " + responseData["reason"]);
}
else
{
Console.WriteLine("json解析异常!");
}
}
catch (Exception)
{
Console.WriteLine("请检查其它错误");
}
}
}
}
}
const axios = require('axios'); // npm install axios
// 基本参数配置
const apiUrl = 'http://v.juhe.cn/verifybankcard3/queryEncryInfo'; // 接口请求URL
const apiKey = '您申请的调用APIkey'; // 在个人中心->我的数据,接口名称上方查看
// 接口请求入参配置
const requestParams = {
key: apiKey,
aesKey: 'xxx',
realname: '李云客',
idcard: '370121xxxxxxxx1040',
bankcard: '6321xxxxxxxx432',
};
// 发起接口网络请求
axios.get(apiUrl, {params: requestParams})
.then(response => {
// 解析响应结果
if (response.status === 200) {
const responseResult = response.data;
// 网络请求成功。可依据业务逻辑和接口文档说明自行处理。
console.log(responseResult);
} else {
// 网络异常等因素,解析结果异常。可依据业务逻辑自行处理。
console.log('请求异常');
}
})
.catch(error => {
// 网络请求失败,可以根据实际情况进行处理
console.log('网络请求失败:', error);
});
package cn.juhe.test;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;
import java.util.stream.Collectors;
public class JavaGet {
public static void main(String[] args) throws Exception {
String apiKey = "你申请的key";
String apiUrl = "http://v.juhe.cn/verifybankcard3/queryEncryInfo";
HashMap<String, String> map = new HashMap<>();
map.put("key", apiKey);
map.put("aesKey", "xxx");
map.put("realname", "李云客");
map.put("idcard", "370121xxxxxxxx1040");
map.put("bankcard", "6321xxxxxxxx432");
URL url = new URL(String.format("%s?%s", apiUrl, params(map)));
BufferedReader in = new BufferedReader(new InputStreamReader((url.openConnection()).getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response);
}
public static String params(Map<String, String> map) {
return map.entrySet().stream()
.map(entry -> {
try {
return entry.getKey() + "=" + URLEncoder.encode(entry.getValue(), StandardCharsets.UTF_8.toString());
} catch (Exception e) {
e.printStackTrace();
return entry.getKey() + "=" + entry.getValue();
}
})
.collect(Collectors.joining("&"));
}
}
// 基本参数配置
NSString *apiUrl = @"http://v.juhe.cn/verifybankcard3/queryEncryInfo"; // 接口请求URL
NSString *apiKey = @"您申请的调用APIkey"; // 在个人中心->我的数据,接口名称上方查看
// 接口请求入参配置
NSDictionary *requestParams = @{
@"key": apiKey,
@"aesKey": @"xxx",
@"realname": @"李云客",
@"idcard": @"370121xxxxxxxx1040",
@"bankcard": @"6321xxxxxxxx432",
};
// 发起接口网络请求
NSURLComponents *components = [NSURLComponents componentsWithString:apiUrl];
NSMutableArray *queryItems = [NSMutableArray array];
[requestParams enumerateKeysAndObjectsUsingBlock:^(NSString *key, NSString *value, BOOL *stop) {
[queryItems addObject:[NSURLQueryItem queryItemWithName:key value:value]];
}];
components.queryItems = queryItems;
NSURL *url = components.URL;
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *task = [session dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
// 网络请求异常处理
NSLog(@"请求异常");
} else {
NSError *jsonError;
NSDictionary *responseResult = [NSJSONSerialization JSONObjectWithData:data options:0 error:&jsonError];
if (!jsonError) {
// 网络请求成功处理
// NSLog(@"%@", [responseResult objectForKey:@"error_code"]);
NSLog(@"%@", responseResult);
} else {
// 解析结果异常处理
NSLog(@"解析结果异常");
}
}
}];
[task resume];
返回参数说明:
名称 | 类型 | 说明 | |
---|---|---|---|
error_code | int | 返回码 | |
reason | string | 返回码描述 | |
jobid | string | 本次查询流水号 | |
res | int | 匹配结果,1:匹配 2:不匹配 | |
message | string | 信息 |
其他使用说明:
JSON返回示例:JSON在线格式化工具 >
{
"reason": "成功",
"result": {
"jobid": "JH2071191112162139847181e7",
"res": 2,
"message": "认证信息不匹配,银行卡无效"
},
"error_code": 0
}
--------------------------------失败示例-----------------------------------------------
{
"reason": "认证失败,银行卡状态异常,详情请咨询您的发卡行",
"result": {
"jobid": "JH207117111112213988818111"/*本次查询流水号*/
},
"error_code": 220703
}
请求Header:
名称 | 值 | |
---|---|---|
Content-Type | application/x-www-form-urlencoded |
请求参数说明:
名称 | 必填 | 类型 | 说明 | |
---|---|---|---|---|
key | 是 | string | 在个人中心->我的数据,接口名称上方查看 | |
aesKey | 是 | string | RSA方式加密后的aes秘钥数组再base64(加密前必须为16位) | |
realname | 是 | string | 姓名加密 | |
idcard | 是 | string | 证件号码加密 | |
bankcard | 是 | string | 银行卡卡号加密 | |
idtype | 否 | string | 证件类型,具体见JSON示例。默认:01 | |
code | 否 | string | 发起交易商户业务编码, 具体见JSON示例,如:01 | |
customer | 否 | string | 公司名+产品名称+具体使用该服务的步骤。如:**有限公司+**APP/**产品+注册开户 |
请求代码示例:
curl -k -i "http://v.juhe.cn/verifybankcard3/queryEncry_v2Info?key=key&aesKey=xxx&realname=%E6%9D%8E%E8%81%9A%E5%90%88&idcard=370121xxxxxxxx1040&bankcard=6321xxxxxxxx432&idtype=&code=&customer="
<?php
/**
* 1678-银行卡三要素核验RSA加密2.0版 - 代码参考(根据实际业务情况修改)
*/
// 基本参数配置
$apiUrl = "http://v.juhe.cn/verifybankcard3/queryEncry_v2Info"; // 接口请求URL
$method = "GET"; // 接口请求方式
$headers = ["Content-Type: application/x-www-form-urlencoded"]; // 接口请求header
$apiKey = "您申请的调用APIkey"; // 在个人中心->我的数据,接口名称上方查看
// 接口请求入参配置
$requestParams = [
'key' => $apiKey,
'aesKey'=> 'xxx',
'realname'=> '李云客',
'idcard'=> '370121xxxxxxxx1040',
'bankcard'=> '6321xxxxxxxx432',
'idtype'=> '',
'code'=> '',
'customer'=> '',
];
$requestParamsStr = http_build_query($requestParams);
// 发起接口网络请求
$curl = curl_init();
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($curl, CURLOPT_URL, $apiUrl . '?' . $requestParamsStr);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_FAILONERROR, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
if (1 == strpos("$" . $apiUrl, "https://")) {
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
}
$response = curl_exec($curl);
$httpInfo = curl_getinfo($curl);
curl_close($curl);
// 解析响应结果
$responseResult = json_decode($response, true);
if ($responseResult) {
// 网络请求成功。可依据业务逻辑和接口文档说明自行处理。
var_dump($responseResult);
} else {
// 网络异常等因素,解析结果异常。可依据业务逻辑自行处理。
// var_dump($httpInfo);
var_dump("请求异常");
}
import requests
# 1678-银行卡三要素核验RSA加密2.0版 - 代码参考(根据实际业务情况修改)
# 基本参数配置
apiUrl = 'http://v.juhe.cn/verifybankcard3/queryEncry_v2Info' # 接口请求URL
apiKey = '您申请的调用APIkey' # 在个人中心->我的数据,接口名称上方查看
# 接口请求入参配置
requestParams = {
'key': apiKey,
'aesKey': 'xxx',
'realname': '李云客',
'idcard': '370121xxxxxxxx1040',
'bankcard': '6321xxxxxxxx432',
'idtype': '',
'code': '',
'customer': '',
}
# 发起接口网络请求
response = requests.get(apiUrl, params=requestParams)
# 解析响应结果
if response.status_code == 200:
responseResult = response.json()
# 网络请求成功。可依据业务逻辑和接口文档说明自行处理。
print(responseResult)
else:
# 网络异常等因素,解析结果异常。可依据业务逻辑自行处理。
print('请求异常')
package main
import (
"encoding/json"
"fmt"
"net/http"
"net/url"
)
func main() {
// 基本参数配置
apiUrl := "http://v.juhe.cn/verifybankcard3/queryEncry_v2Info"
apiKey := "您申请的调用APIkey"
// 接口请求入参配置
requestParams := url.Values{}
requestParams.Set("key", apiKey)
requestParams.Set("aesKey", "xxx")
requestParams.Set("realname", "李云客")
requestParams.Set("idcard", "370121xxxxxxxx1040")
requestParams.Set("bankcard", "6321xxxxxxxx432")
requestParams.Set("idtype", "")
requestParams.Set("code", "")
requestParams.Set("customer", "")
// 发起接口网络请求
resp, err := http.Get(apiUrl + "?" + requestParams.Encode())
if err != nil {
fmt.Println("网络请求异常:", err)
return
}
defer resp.Body.Close()
var responseResult map[string]interface{}
err = json.NewDecoder(resp.Body).Decode(&responseResult)
if err != nil {
fmt.Println("解析响应结果异常:", err)
return
}
fmt.Println(responseResult)
}
using System;
using System.Net;
using Newtonsoft.Json;
using System.Collections.Generic;
using System.Linq;
namespace Common_API_Test.Test_Demo
{
class Csharp_get
{
static void Main(string[] args)
{
string url = "http://v.juhe.cn/verifybankcard3/queryEncry_v2Info";
string apiKey = "您申请的调用APIkey";
Dictionary<string, string> data = new Dictionary<string, string>();
data.Add("key", apiKey);
data.Add( "aesKey", "xxx");
data.Add( "realname", "李云客");
data.Add( "idcard", "370121xxxxxxxx1040");
data.Add( "bankcard", "6321xxxxxxxx432");
data.Add( "idtype", "");
data.Add( "code", "");
data.Add( "customer", "");
using (WebClient client = new WebClient())
{
string fullUrl = url + "?" + string.Join("&", data.Select(x => x.Key + "=" + x.Value));
try
{
string responseContent = client.DownloadString(fullUrl);
dynamic responseData = JsonConvert.DeserializeObject(responseContent);
if (responseData != null)
{
Console.WriteLine("Return Code: " + responseData["error_code"]);
Console.WriteLine("Return Message: " + responseData["reason"]);
}
else
{
Console.WriteLine("json解析异常!");
}
}
catch (Exception)
{
Console.WriteLine("请检查其它错误");
}
}
}
}
}
const axios = require('axios'); // npm install axios
// 基本参数配置
const apiUrl = 'http://v.juhe.cn/verifybankcard3/queryEncry_v2Info'; // 接口请求URL
const apiKey = '您申请的调用APIkey'; // 在个人中心->我的数据,接口名称上方查看
// 接口请求入参配置
const requestParams = {
key: apiKey,
aesKey: 'xxx',
realname: '李云客',
idcard: '370121xxxxxxxx1040',
bankcard: '6321xxxxxxxx432',
idtype: '',
code: '',
customer: '',
};
// 发起接口网络请求
axios.get(apiUrl, {params: requestParams})
.then(response => {
// 解析响应结果
if (response.status === 200) {
const responseResult = response.data;
// 网络请求成功。可依据业务逻辑和接口文档说明自行处理。
console.log(responseResult);
} else {
// 网络异常等因素,解析结果异常。可依据业务逻辑自行处理。
console.log('请求异常');
}
})
.catch(error => {
// 网络请求失败,可以根据实际情况进行处理
console.log('网络请求失败:', error);
});
package cn.juhe.test;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;
import java.util.stream.Collectors;
public class JavaGet {
public static void main(String[] args) throws Exception {
String apiKey = "你申请的key";
String apiUrl = "http://v.juhe.cn/verifybankcard3/queryEncry_v2Info";
HashMap<String, String> map = new HashMap<>();
map.put("key", apiKey);
map.put("aesKey", "xxx");
map.put("realname", "李云客");
map.put("idcard", "370121xxxxxxxx1040");
map.put("bankcard", "6321xxxxxxxx432");
map.put("idtype", "");
map.put("code", "");
map.put("customer", "");
URL url = new URL(String.format("%s?%s", apiUrl, params(map)));
BufferedReader in = new BufferedReader(new InputStreamReader((url.openConnection()).getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response);
}
public static String params(Map<String, String> map) {
return map.entrySet().stream()
.map(entry -> {
try {
return entry.getKey() + "=" + URLEncoder.encode(entry.getValue(), StandardCharsets.UTF_8.toString());
} catch (Exception e) {
e.printStackTrace();
return entry.getKey() + "=" + entry.getValue();
}
})
.collect(Collectors.joining("&"));
}
}
// 基本参数配置
NSString *apiUrl = @"http://v.juhe.cn/verifybankcard3/queryEncry_v2Info"; // 接口请求URL
NSString *apiKey = @"您申请的调用APIkey"; // 在个人中心->我的数据,接口名称上方查看
// 接口请求入参配置
NSDictionary *requestParams = @{
@"key": apiKey,
@"aesKey": @"xxx",
@"realname": @"李云客",
@"idcard": @"370121xxxxxxxx1040",
@"bankcard": @"6321xxxxxxxx432",
@"idtype": @"",
@"code": @"",
@"customer": @"",
};
// 发起接口网络请求
NSURLComponents *components = [NSURLComponents componentsWithString:apiUrl];
NSMutableArray *queryItems = [NSMutableArray array];
[requestParams enumerateKeysAndObjectsUsingBlock:^(NSString *key, NSString *value, BOOL *stop) {
[queryItems addObject:[NSURLQueryItem queryItemWithName:key value:value]];
}];
components.queryItems = queryItems;
NSURL *url = components.URL;
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *task = [session dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
// 网络请求异常处理
NSLog(@"请求异常");
} else {
NSError *jsonError;
NSDictionary *responseResult = [NSJSONSerialization JSONObjectWithData:data options:0 error:&jsonError];
if (!jsonError) {
// 网络请求成功处理
// NSLog(@"%@", [responseResult objectForKey:@"error_code"]);
NSLog(@"%@", responseResult);
} else {
// 解析结果异常处理
NSLog(@"解析结果异常");
}
}
}];
[task resume];
返回参数说明:
名称 | 类型 | 说明 | |
---|---|---|---|
error_code | int | 返回码 | |
reason | string | 返回码描述 | |
jobid | string | 本次查询流水号 | |
res | int | 匹配结果,1:匹配 2:不匹配 | |
message | string | 信息 |
其他使用说明:
JSON返回示例:JSON在线格式化工具 >
/**
code 商户业务编码 | idtype 证件类型
01 直销银行 | 01 身份证
02 消费金融 | 02 护照
03 银行二三类账户开户 | 03 港澳证(内地居民来往港澳通行证)
04 征信 | 04 台胞证
05 保险 | 11 回乡证(港澳居民来往内地通行证)
06 基金 | 18 台湾居民居住证
07 证券 | 19 港澳居民居住证
08 租赁 | 20 外国护照
09 海关申报 |
99 |
*/
{
"reason": "成功",
"result": {
"jobid": "JH2071191112162139847181e7",
"res": 2,
"message": "认证信息不匹配,银行卡无效"
},
"error_code": 0
}
服务级错误码参照(error_code):
错误码 | 说明 | |
---|---|---|
220701 | 数据源超时 | |
220703 | 认证失败 认证失败 认证失败,该卡当日连续多次认证不通过被限制校验,次日恢复 |
|
220704 | 参数错误 参数错误 参数错误:银行卡号格式不正确 同一银行卡请求过于频繁 |
|
220705 | 参数错误:姓名格式不正确 | |
220706 | 参数错误:身份证格式不正确 |
系统级错误码参照:
错误码 | 说明 | 旧版本(resultcode) | |
---|---|---|---|
10001 | 错误的请求KEY | 101 | |
10002 | 该KEY无请求权限 | 102 | |
10003 | KEY过期 | 103 | |
10004 | 错误的OPENID | 104 | |
10005 | 应用未审核超时,请提交认证 | 105 | |
10007 | 未知的请求源 | 107 | |
10008 | 被禁止的IP | 108 | |
10009 | 被禁止的KEY | 109 | |
10011 | 当前IP请求超过限制 | 111 | |
10012 | 请求超过次数限制 | 112 | |
10013 | 测试KEY超过请求限制 | 113 | |
10014 | 系统内部异常 (调用充值类业务时,请务必联系客服或通过订单查询接口检测订单,避免造成损失) | 114 | |
10020 | 接口维护 | 120 | |
10021 | 接口停用 | 121 |
错误码格式说明(示例:200201):
2 | 002 | 01 | |
---|---|---|---|
服务级错误(1为系统级错误) | 服务模块代码(即数据ID) | 具体错误代码 |
限企业实名用户使用
本接口需提供应用场景审核
个人(基础认证)实名用户无法使用