...
|
...
|
@@ -13,18 +13,40 @@ import com.alipay.api.response.ZhimaCustomerCertificationQueryResponse; |
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
|
import static com.alipay.api.AlipayConstants.CHARSET_UTF8;
|
|
|
|
|
|
public class ZhiMaCallUtil {
|
|
|
private final static Logger logger = LoggerFactory.getLogger(ZhiMaCallUtil.class);
|
|
|
|
|
|
/**
|
|
|
private static String APP_ID = "2016092000556291",
|
|
|
APP_PRIVATE_KEY = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCFykKVR+xSSapScRNoi//rDLq5CaYLcN04Jzi/ivROFTkb5iYIdjshTio4tAJNpkT6HenCeiRUOrG9v2PPrLQN3utbkPv5XQag0wE2vaIHcfjNybx0xA8BWI9A5lgjJ47xE63qJvvLhlnpHSKq4tTkN7j7gaWWQjrqr5p78dEEp2+Wx/HTPE7wmSsYKN/8HqrKAxsh07dXRTDViGpHjA6RrdKZBCYUn8ncqLz6O5198Oost08BKSaX4qDQQLQD5ysdZBVgXspU0i55YCYdfCVqZ/1vsbptooN4BY501XmWsIpIUxSrUFR4pvvkZMncejyzkvWTbFtyqE3YuGUeVaedAgMBAAECggEAATwtwy0HzHaroNk0YamxMh1K9/xT0RU4pZUPHA2PVc0yWsSUI03cG+GZ2C4pO0hGqLxv9QClpzVngKXsqPUiMGKXb5/2A4ZNUlzATR4RCdqOfm/XUoigztVfdSzrMV/jHOyelWPIvUc/Ozyunj870eOFzKSUv79axeHbHjvMPyu8/kGE560tr0f/NgfmIcKjmeFQTh1R2FA61jwcYJBu5q5j+/ITsD3T5EPGneiMlAETXT1w80PHrTf4xrxnSoSwqryS+Qjh47DeSnAwK85g+R/Qlne89/XESGZJNJSChwoxHhuIEiLfyn2dFPETOqj129RT5QFST5WSdiQ08BAiLQKBgQDwSI3HGCu04yRDVuxNZqPcAHdxMZ7TjgLXfV6yEquR3uEYzx1RApvx+NnlyYLTGH4am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05q5Myk6aBT8/J16i4uT86PBANtWctWX/uU5s7tassC9TCwTHnthMIZnV1bXV5WS+wqJ+wxv9ojS4Ug+dKo2P8GKgYl5ocezzG8EvGq4Xoha9dyZwM6uWBg3JvX3IGPilPd8wIDAQAB";
|
|
|
|
|
|
private static String url="https://openapi.alipaydev.com/gateway.do";//"https://openapi.alipay.com/gateway.do"
|
|
|
|
|
|
*/
|
|
|
|
|
|
private static String APP_ID = "2013080700000742";
|
|
|
private static String APP_PRIVATE_KEY = "MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAOfywqINCNC+IFvg" +
|
|
|
"zqq3aEYxmh89WamWL59FukMKoKYMDR1NWMgFLNX2ld6aRWWdlJCBUsTzH/8uabEj" +
|
|
|
"fBOM5BK+N08GfkpCYRmzww2y1H8RZ4P3wtKu95UYdaq3Ir5ucfgKxGy/1ay2qQFZ" +
|
|
|
"PAkvPtTw+qdkVOgPakvqCWgcFL8LAgMBAAECgYAYeTnmJV/vvo/lgePsiWucNHGh" +
|
|
|
"qDSEu08NDCtqFX375zufAuFCQaGIdfs8QKTf4u+hC7QzCcAvibMnOKpH2c7apAEc" +
|
|
|
"RUfTUUcY/UB/yIkvzjkvkMKZSXI6y3lyFn8mNEwQei9u4OdSg1IBVuWqZoyqilCm" +
|
|
|
"ARMzXyoeAOY55MelSQJBAPP+sEbPadMENkzzkiiHCHuo3Y0OEF5Zv2h3LJmtRx/6" +
|
|
|
"B60mrfaUSSbU/iNq0uzQSoDQlY2DxXb21l1LYZzgdn8CQQDzXFXNj/qkXIuTLjfK" +
|
|
|
"YxIhwiNKYXXKeG9C6+MlviY2zVrKruuuHJMcJ8238hzRcPsX+TCwFd3VhHuL61jB" +
|
|
|
"2+l1AkBhUNTH+VQQ6N4rhP5nkawNfkWXS+O1bgBMzzOHu7fhhhznr8S002H1zf/q" +
|
|
|
"6mFkOJNum0L65XKtxzeqkDVHl7NLAkEAg/jKvxMZRRC60DH8J1DagFwbbzay/f2Z" +
|
|
|
"uJzbLZiUeJucZNW/EUiFrnsXYG13m0y9nh6QfK0fA684oIQcOeTcEQJBAIxCxNUP" +
|
|
|
"jXsvqTV2ypek3ktvutFwSFuvo0zD2sn2HNlMSfh3K6RZV2Q0Q4W7bLELKEEkxmJX" +
|
|
|
"IMLSK3hQB7jYD0Q=";
|
|
|
|
|
|
private static String ALIPAY_PUBLIC_KEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCnxj/9qwVfgoUh/y2W89L6BkRAFljhNhgPdyPuBV64bfQNN1PjbCzkIM6qRdKBoLPXmKKMiFYnkd6rAoprih3/PrQEB/VsW8OoM8fxn67UDYuyBTqA23MML9q1+ilIZwBC2AQ2UBVOrFXfFl75p6/B5KsiNG9zpgmLCUYuLkxpLQIDAQAB";
|
|
|
|
|
|
private static String url="https://openapi.alipay.com/gateway.do";
|
|
|
|
|
|
//固定不变
|
|
|
private final static String ZHI_MA_PRODUCT_CODE="w1010100000000002978";
|
|
|
public static final String input_charset = "utf-8";
|
|
|
|
|
|
/**
|
|
|
* 芝麻认知,请求biz_no
|
...
|
...
|
@@ -37,7 +59,7 @@ public class ZhiMaCallUtil { |
|
|
public static String zhiMaCertInit(String transactionId,String certName,String certNo) {
|
|
|
try{
|
|
|
logger.info("zhi ma cert init enter ,transactionId {} ,certName {},certNo {}",transactionId,certName,certNo);
|
|
|
AlipayClient alipayClient = new DefaultAlipayClient(url, APP_ID, APP_PRIVATE_KEY, "json", "utf-8", ALIPAY_PUBLIC_KEY, "RSA2");
|
|
|
AlipayClient alipayClient = new DefaultAlipayClient(url, APP_ID, APP_PRIVATE_KEY, "json", input_charset, ALIPAY_PUBLIC_KEY, "RSA2");
|
|
|
ZhimaCustomerCertificationInitializeRequest request = new ZhimaCustomerCertificationInitializeRequest();
|
|
|
|
|
|
JSONObject identityParam=new JSONObject();
|
...
|
...
|
@@ -92,7 +114,7 @@ public class ZhiMaCallUtil { |
|
|
try{
|
|
|
// 获取alipay client
|
|
|
logger.info("zhi ma cert url enter ,bizNo {} ",bizNo);
|
|
|
AlipayClient alipayClient = new DefaultAlipayClient(url, APP_ID, APP_PRIVATE_KEY, "json", "utf-8", ALIPAY_PUBLIC_KEY, "RSA2");
|
|
|
AlipayClient alipayClient = new DefaultAlipayClient(url, APP_ID, APP_PRIVATE_KEY, "json", input_charset, ALIPAY_PUBLIC_KEY, "RSA2");
|
|
|
|
|
|
ZhimaCustomerCertificationCertifyRequest request = new ZhimaCustomerCertificationCertifyRequest();
|
|
|
// 设置业务参数,必须要biz_no
|
...
|
...
|
@@ -132,7 +154,7 @@ public class ZhiMaCallUtil { |
|
|
try{
|
|
|
// 获取alipay client
|
|
|
logger.info("zhi ma result enter ,bizNo {} ",bizNo);
|
|
|
AlipayClient alipayClient = new DefaultAlipayClient(url, APP_ID, APP_PRIVATE_KEY, "json", "utf-8", ALIPAY_PUBLIC_KEY, "RSA2");
|
|
|
AlipayClient alipayClient = new DefaultAlipayClient(url, APP_ID, APP_PRIVATE_KEY, "json", input_charset, ALIPAY_PUBLIC_KEY, "RSA2");
|
|
|
|
|
|
ZhimaCustomerCertificationQueryRequest request = new ZhimaCustomerCertificationQueryRequest();
|
|
|
// 设置业务参数,必须要biz_no
|
...
|
...
|
|