|
|
package com.yohoufo.user.service.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.alipay.api.AlipayClient;
|
|
|
import com.alipay.api.DefaultAlipayClient;
|
|
|
import com.alipay.api.request.ZhimaCustomerCertificationCertifyRequest;
|
...
|
...
|
@@ -63,6 +61,7 @@ public class ZhiMaCallUtil { |
|
|
AlipayClient alipayClient = new DefaultAlipayClient(url, APP_ID, APP_PRIVATE_KEY, "json", input_charset, ALIPAY_PUBLIC_KEY, signType);
|
|
|
ZhimaCustomerCertificationInitializeRequest request = new ZhimaCustomerCertificationInitializeRequest();
|
|
|
|
|
|
/*
|
|
|
JSONObject identityParam=new JSONObject();
|
|
|
identityParam.put("identity_type","CERT_INFO");
|
|
|
identityParam.put("cert_type","IDENTITY_CARD");
|
...
|
...
|
@@ -75,15 +74,16 @@ public class ZhiMaCallUtil { |
|
|
jo.put("biz_code","SMART_FACE");
|
|
|
jo.put("identity_param",identityParam);
|
|
|
jo.put("ext_biz_param",new JSONObject());
|
|
|
|
|
|
/*String bizContent = "{"
|
|
|
*/
|
|
|
//bizContent 要求严格按照以下顺序
|
|
|
String bizContent = "{"
|
|
|
+ "\"transaction_id\":\""+transactionId+"\","
|
|
|
+ "\"product_code\":\"w1010100000000002978\","
|
|
|
+ "\"product_code\":\""+ZHI_MA_PRODUCT_CODE+"\","
|
|
|
+ "\"biz_code\":\"SMART_FACE\","
|
|
|
+ "\"identity_param\":\"{\\\"identity_type\\\":\\\"CERT_INFO\\\",\\\"cert_type\\\":\\\"IDENTITY_CARD\\\",\\\"cert_name\\\":\\\""+certName+"\\\",\\\"cert_no\\\":\\\""+certNo+"\\\"}\","
|
|
|
+ "\"ext_biz_param\":\"{}\"" + " }";*/
|
|
|
+ "\"ext_biz_param\":\"{}\"" + " }";
|
|
|
|
|
|
String bizContent=JSON.toJSONString(jo);
|
|
|
//String bizContent=JSON.toJSONString(jo);
|
|
|
request.setBizContent(bizContent);
|
|
|
|
|
|
logger.info("zhi ma cert init begin request is {} ",request);
|
...
|
...
|
@@ -119,10 +119,12 @@ public class ZhiMaCallUtil { |
|
|
|
|
|
ZhimaCustomerCertificationCertifyRequest request = new ZhimaCustomerCertificationCertifyRequest();
|
|
|
// 设置业务参数,必须要biz_no
|
|
|
JSONObject jo=new JSONObject();
|
|
|
/* JSONObject jo=new JSONObject();
|
|
|
jo.put("biz_no",bizNo);
|
|
|
String bizContent=JSON.toJSONString(jo);*/
|
|
|
|
|
|
String bizContent=JSON.toJSONString(jo);
|
|
|
// 设置业务参数,必须要biz_no
|
|
|
String bizContent="{\"biz_no\":\""+bizNo+"\"}";
|
|
|
request.setBizContent(bizContent);
|
|
|
|
|
|
// 设置回调地址,必填. 如果需要直接在支付宝APP里面打开回调地址使用alipay协议
|
...
|
...
|
@@ -159,10 +161,11 @@ public class ZhiMaCallUtil { |
|
|
|
|
|
ZhimaCustomerCertificationQueryRequest request = new ZhimaCustomerCertificationQueryRequest();
|
|
|
// 设置业务参数,必须要biz_no
|
|
|
JSONObject jo=new JSONObject();
|
|
|
/*JSONObject jo=new JSONObject();
|
|
|
jo.put("biz_no",bizNo);
|
|
|
|
|
|
String bizContent=JSON.toJSONString(jo);
|
|
|
String bizContent=JSON.toJSONString(jo);*/
|
|
|
String bizContent="{\"biz_no\":\""+bizNo+"\"}";
|
|
|
request.setBizContent(bizContent);
|
|
|
|
|
|
logger.info("zhi ma result begin ,request {} ",request);
|
...
|
...
|
|