Showing
1 changed file
with
27 additions
and
5 deletions
@@ -13,18 +13,40 @@ import com.alipay.api.response.ZhimaCustomerCertificationQueryResponse; | @@ -13,18 +13,40 @@ import com.alipay.api.response.ZhimaCustomerCertificationQueryResponse; | ||
13 | import org.slf4j.Logger; | 13 | import org.slf4j.Logger; |
14 | import org.slf4j.LoggerFactory; | 14 | import org.slf4j.LoggerFactory; |
15 | 15 | ||
16 | -import static com.alipay.api.AlipayConstants.CHARSET_UTF8; | ||
17 | - | ||
18 | public class ZhiMaCallUtil { | 16 | public class ZhiMaCallUtil { |
19 | private final static Logger logger = LoggerFactory.getLogger(ZhiMaCallUtil.class); | 17 | private final static Logger logger = LoggerFactory.getLogger(ZhiMaCallUtil.class); |
20 | 18 | ||
19 | + /** | ||
21 | private static String APP_ID = "2016092000556291", | 20 | private static String APP_ID = "2016092000556291", |
22 | APP_PRIVATE_KEY = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCFykKVR+xSSapScRNoi//rDLq5CaYLcN04Jzi/ivROFTkb5iYIdjshTio4tAJNpkT6HenCeiRUOrG9v2PPrLQN3utbkPv5XQag0wE2vaIHcfjNybx0xA8BWI9A5lgjJ47xE63qJvvLhlnpHSKq4tTkN7j7gaWWQjrqr5p78dEEp2+Wx/HTPE7wmSsYKN/8HqrKAxsh07dXRTDViGpHjA6RrdKZBCYUn8ncqLz6O5198Oost08BKSaX4qDQQLQD5ysdZBVgXspU0i55YCYdfCVqZ/1vsbptooN4BY501XmWsIpIUxSrUFR4pvvkZMncejyzkvWTbFtyqE3YuGUeVaedAgMBAAECggEAATwtwy0HzHaroNk0YamxMh1K9/xT0RU4pZUPHA2PVc0yWsSUI03cG+GZ2C4pO0hGqLxv9QClpzVngKXsqPUiMGKXb5/2A4ZNUlzATR4RCdqOfm/XUoigztVfdSzrMV/jHOyelWPIvUc/Ozyunj870eOFzKSUv79axeHbHjvMPyu8/kGE560tr0f/NgfmIcKjmeFQTh1R2FA61jwcYJ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F9en8tM0Hq6itZtQFo0/KK7qCDBlZjzz3BB+es33yab2Ts6qFVz+jjm+n8XocEzncNKVCafsuL05q5Myk6aBT8/J16i4uT86PBANtWctWX/uU5s7tassC9TCwTHnthMIZnV1bXV5WS+wqJ+wxv9ojS4Ug+dKo2P8GKgYl5ocezzG8EvGq4Xoha9dyZwM6uWBg3JvX3IGPilPd8wIDAQAB"; |
24 | 23 | ||
25 | private static String url="https://openapi.alipaydev.com/gateway.do";//"https://openapi.alipay.com/gateway.do" | 24 | private static String url="https://openapi.alipaydev.com/gateway.do";//"https://openapi.alipay.com/gateway.do" |
25 | + */ | ||
26 | 26 | ||
27 | + private static String APP_ID = "2013080700000742"; | ||
28 | + private static String APP_PRIVATE_KEY = "MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAOfywqINCNC+IFvg" + | ||
29 | + "zqq3aEYxmh89WamWL59FukMKoKYMDR1NWMgFLNX2ld6aRWWdlJCBUsTzH/8uabEj" + | ||
30 | + "fBOM5BK+N08GfkpCYRmzww2y1H8RZ4P3wtKu95UYdaq3Ir5ucfgKxGy/1ay2qQFZ" + | ||
31 | + "PAkvPtTw+qdkVOgPakvqCWgcFL8LAgMBAAECgYAYeTnmJV/vvo/lgePsiWucNHGh" + | ||
32 | + "qDSEu08NDCtqFX375zufAuFCQaGIdfs8QKTf4u+hC7QzCcAvibMnOKpH2c7apAEc" + | ||
33 | + "RUfTUUcY/UB/yIkvzjkvkMKZSXI6y3lyFn8mNEwQei9u4OdSg1IBVuWqZoyqilCm" + | ||
34 | + "ARMzXyoeAOY55MelSQJBAPP+sEbPadMENkzzkiiHCHuo3Y0OEF5Zv2h3LJmtRx/6" + | ||
35 | + "B60mrfaUSSbU/iNq0uzQSoDQlY2DxXb21l1LYZzgdn8CQQDzXFXNj/qkXIuTLjfK" + | ||
36 | + "YxIhwiNKYXXKeG9C6+MlviY2zVrKruuuHJMcJ8238hzRcPsX+TCwFd3VhHuL61jB" + | ||
37 | + "2+l1AkBhUNTH+VQQ6N4rhP5nkawNfkWXS+O1bgBMzzOHu7fhhhznr8S002H1zf/q" + | ||
38 | + "6mFkOJNum0L65XKtxzeqkDVHl7NLAkEAg/jKvxMZRRC60DH8J1DagFwbbzay/f2Z" + | ||
39 | + "uJzbLZiUeJucZNW/EUiFrnsXYG13m0y9nh6QfK0fA684oIQcOeTcEQJBAIxCxNUP" + | ||
40 | + "jXsvqTV2ypek3ktvutFwSFuvo0zD2sn2HNlMSfh3K6RZV2Q0Q4W7bLELKEEkxmJX" + | ||
41 | + "IMLSK3hQB7jYD0Q="; | ||
42 | + | ||
43 | + private static String ALIPAY_PUBLIC_KEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCnxj/9qwVfgoUh/y2W89L6BkRAFljhNhgPdyPuBV64bfQNN1PjbCzkIM6qRdKBoLPXmKKMiFYnkd6rAoprih3/PrQEB/VsW8OoM8fxn67UDYuyBTqA23MML9q1+ilIZwBC2AQ2UBVOrFXfFl75p6/B5KsiNG9zpgmLCUYuLkxpLQIDAQAB"; | ||
44 | + | ||
45 | + private static String url="https://openapi.alipay.com/gateway.do"; | ||
46 | + | ||
47 | + //固定不变 | ||
27 | private final static String ZHI_MA_PRODUCT_CODE="w1010100000000002978"; | 48 | private final static String ZHI_MA_PRODUCT_CODE="w1010100000000002978"; |
49 | + public static final String input_charset = "utf-8"; | ||
28 | 50 | ||
29 | /** | 51 | /** |
30 | * 芝麻认知,请求biz_no | 52 | * 芝麻认知,请求biz_no |
@@ -37,7 +59,7 @@ public class ZhiMaCallUtil { | @@ -37,7 +59,7 @@ public class ZhiMaCallUtil { | ||
37 | public static String zhiMaCertInit(String transactionId,String certName,String certNo) { | 59 | public static String zhiMaCertInit(String transactionId,String certName,String certNo) { |
38 | try{ | 60 | try{ |
39 | logger.info("zhi ma cert init enter ,transactionId {} ,certName {},certNo {}",transactionId,certName,certNo); | 61 | logger.info("zhi ma cert init enter ,transactionId {} ,certName {},certNo {}",transactionId,certName,certNo); |
40 | - AlipayClient alipayClient = new DefaultAlipayClient(url, APP_ID, APP_PRIVATE_KEY, "json", "utf-8", ALIPAY_PUBLIC_KEY, "RSA2"); | 62 | + AlipayClient alipayClient = new DefaultAlipayClient(url, APP_ID, APP_PRIVATE_KEY, "json", input_charset, ALIPAY_PUBLIC_KEY, "RSA2"); |
41 | ZhimaCustomerCertificationInitializeRequest request = new ZhimaCustomerCertificationInitializeRequest(); | 63 | ZhimaCustomerCertificationInitializeRequest request = new ZhimaCustomerCertificationInitializeRequest(); |
42 | 64 | ||
43 | JSONObject identityParam=new JSONObject(); | 65 | JSONObject identityParam=new JSONObject(); |
@@ -92,7 +114,7 @@ public class ZhiMaCallUtil { | @@ -92,7 +114,7 @@ public class ZhiMaCallUtil { | ||
92 | try{ | 114 | try{ |
93 | // 获取alipay client | 115 | // 获取alipay client |
94 | logger.info("zhi ma cert url enter ,bizNo {} ",bizNo); | 116 | logger.info("zhi ma cert url enter ,bizNo {} ",bizNo); |
95 | - AlipayClient alipayClient = new DefaultAlipayClient(url, APP_ID, APP_PRIVATE_KEY, "json", "utf-8", ALIPAY_PUBLIC_KEY, "RSA2"); | 117 | + AlipayClient alipayClient = new DefaultAlipayClient(url, APP_ID, APP_PRIVATE_KEY, "json", input_charset, ALIPAY_PUBLIC_KEY, "RSA2"); |
96 | 118 | ||
97 | ZhimaCustomerCertificationCertifyRequest request = new ZhimaCustomerCertificationCertifyRequest(); | 119 | ZhimaCustomerCertificationCertifyRequest request = new ZhimaCustomerCertificationCertifyRequest(); |
98 | // 设置业务参数,必须要biz_no | 120 | // 设置业务参数,必须要biz_no |
@@ -132,7 +154,7 @@ public class ZhiMaCallUtil { | @@ -132,7 +154,7 @@ public class ZhiMaCallUtil { | ||
132 | try{ | 154 | try{ |
133 | // 获取alipay client | 155 | // 获取alipay client |
134 | logger.info("zhi ma result enter ,bizNo {} ",bizNo); | 156 | logger.info("zhi ma result enter ,bizNo {} ",bizNo); |
135 | - AlipayClient alipayClient = new DefaultAlipayClient(url, APP_ID, APP_PRIVATE_KEY, "json", "utf-8", ALIPAY_PUBLIC_KEY, "RSA2"); | 157 | + AlipayClient alipayClient = new DefaultAlipayClient(url, APP_ID, APP_PRIVATE_KEY, "json", input_charset, ALIPAY_PUBLIC_KEY, "RSA2"); |
136 | 158 | ||
137 | ZhimaCustomerCertificationQueryRequest request = new ZhimaCustomerCertificationQueryRequest(); | 159 | ZhimaCustomerCertificationQueryRequest request = new ZhimaCustomerCertificationQueryRequest(); |
138 | // 设置业务参数,必须要biz_no | 160 | // 设置业务参数,必须要biz_no |
-
Please register or login to post a comment