V3的接口,POST不行,GET是可以的
签名报错提交申请单签名报错,加密的证书序列号我也设置了,为什么还是这样
2020-06-29请问一下大佬,我也遇到这个问题,应该怎么解决
微信商户开户意愿 -提交申请单API1 图片上传post ok, 签名Ok,返回正常 2 提交申请单api,同样的方法拼装json,返回: {"code":"SIGN_ERROR","detail":{"detail":{"issue":"sign not match"},"field":"signature","location":"authorization","sign_information":{"method":"POST","sign_message_length":78,"truncated_sign_message":"POST\n/v3/apply4subject/applyment\n1584584235\nWQeqUDrJOmM073PJLJhk2T0B0jDmpNze\n\n","url":"/v3/apply4subject/applyment"}},"message":"错误的签名,验签失败"} 方法: public static String getAuthorization(String method, HttpUrl url, String body, PrivateKey yourPrivateKey, String yourMerchantId, String yourCertificateSerialNo) throws Exception { String nonceStr = generateNonceStr(); long timestamp = System.currentTimeMillis() / 1000; String message = buildMessage(method, url, timestamp, nonceStr, body); System.out.println("message===="+message); String signature = sign(message.getBytes("utf-8"),yourPrivateKey); System.out.println("SHA256withRSA签名是:"+signature); return schema+" "+"mchid=\"" + yourMerchantId + "\"," + "nonce_str=\"" + nonceStr + "\"," + "timestamp=\"" + timestamp + "\"," + "serial_no=\"" + yourCertificateSerialNo + "\"," + "signature=\"" + signature + "\""; } private static String buildMessage(String method, HttpUrl url, long timestamp, String nonceStr, String body) { String canonicalUrl = url.encodedPath(); if (url.encodedQuery() != null) { canonicalUrl += "?" + url.encodedQuery(); } return method + "\n" + canonicalUrl + "\n" + timestamp + "\n" + nonceStr + "\n" + body + "\n"; } private static String sign(byte[] message, PrivateKey yourPrivateKey) throws Exception { Signature sign = Signature.getInstance("SHA256withRSA"); sign.initSign(yourPrivateKey); sign.update(message); return Base64.getEncoder().encodeToString(sign.sign()); } message====打印信息为: message====POST /v3/apply4subject/applyment 1584584235 WQeqUDrJOmM073PJLJhk2T0B0jDmpNze {"business_code":"1111111111"} s所以 为什么官方返回的truncated_sign_message 标签 里在,签名是没有body的????!!!
2020-06-28请问一下大佬,我也遇到这个问题,应该怎么解决
商户意愿确认-提交申请单API上送: POST /v3/apply4subject/applyment 1584596389 KD0Lc6sByJxJ69IifmQcnkg4GFzbiHwN {"business_code":"1111111111","contact_info":{"name":"����","mobile":"13312345678","id_card_number":"430422199001236704"},"subject_info":{"subject_type":"SUBJECT_TYPE_ENTERPRISE","business_licence_info":{"licence_number":"914201123033363296","licence_copy":"333","merchant_name":"sss","legal_person":"ss","company_address":"ss","licence_valid_date":"1970-01-01"},"company_prove_copy":"33"},"identification_info":{"identification_type":"IDENTIFICATION_TYPE_IDCARD","identification_name":"ss","identification_number":"430422199001236705","identification_valid_date":"1970 - 01 - 01","identification_front_copy":"11","identification_back_copy":"323"}} 返回:{ "code": "SIGN_ERROR", "detail": { "detail": { "issue": "sign not match" }, "field": "signature", "location": "authorization", "sign_information": { "method": "POST", "sign_message_length": 78, "truncated_sign_message": "POST\n/v3/apply4subject/applyment\n1584596389\nKD0Lc6sByJxJ69IifmQcnkg4GFzbiHwN\n\n", "url": "/v3/apply4subject/applyment" } }, "message": "错误的签名,验签失败" } 请求发起是有body的,为什么微信返回的没有body,是空的,就像是没有上送body一样, 同样的json请求,图片上传是ok的, 参数也完全按照官网文档,编写的json串, 到底是哪出的问题??!!!!!!求解。
2020-06-28jdk版本问题,jdK1.8以后都可以
平台证书解密报没有这种算法jdk1.7在ext下sunjce_provider.jar有这个。使用得是官方文档得方法。用main方法测试。当执行到 Cipher算法得时候。报错。java.security.NoSuchAlgorithmException: No such algorithm: AES/GCM/NoPadding。怎么解决?????[图片]
2020-06-23500 Internal Server Error
查询投诉信息API问题查询投诉信息API的时候offset为1时能够获取到微信的返回数据,为0时报错
2020-06-05