jsApi通过SDK 下单返回" SYSTEM_ERROR",未知错误?
代码 config = new RSAPublicKeyConfig.Builder()
.merchantId(mchId)
.privateKeyFromPath(filePath)
.publicKeyId(publicKeyId)
.publicKeyFromPath(publicFilePath)
.merchantSerialNumber(merchantSerialNumber)
.apiV3Key(apiV3Key)
.build();
Config config = wxpayProperties.getConfig();
JsapiServiceExtension service = new JsapiServiceExtension.Builder().config(config)..build();
PrepayWithRequestPaymentResponse requestPaymentResponse = new PrepayWithRequestPaymentResponse();
PrepayRequest prepayRequest = new PrepayRequest();
prepayRequest.setAppid(wxpayProperties.getAppId());
prepayRequest.setMchid(wxpayProperties.getMchId());
prepayRequest.setDescription(subject);
prepayRequest.setOutTradeNo(orderNo);
prepayRequest.setNotifyUrl(wxpayProperties.getV3PayNotifyUrl());
Amount mount = new Amount();
mount.setCurrency("CNY");
BigDecimal multiply = amount.multiply(new BigDecimal(100));
mount.setTotal(multiply.setScale(0, RoundingMode.HALF_UP).intValue());
prepayRequest.setAmount(mount);
Payer payer = new Payer();
payer.setOpenid(openId);
prepayRequest.setPayer(payer);
log.info("微信预下单,请求参数:{}", JSONUtil.toJsonStr(prepayRequest));
requestPaymentResponse = service.prepayWithRequestPayment(prepayRequest);
返回信息,部分数据使用了*代替 Wrong HttpStatusCode[500] httpResponseBody[{"code":"SYSTEM_ERROR","message":"未知错误"} ] HttpRequest[{"http_method":"POST","url":"https://api.mch.weixin.qq.com/v3/pay/transactions/jsapi","uri":"https://api.mch.weixin.qq.com/v3/pay/transactions/jsapi","headers":{"headers":{"Authorization":"WECHATPAY2-SHA256-RSA2048 mchid=\"1700******0\",nonce_str=\"6GfW0Esv2FYyyYE095jiPMVhTCSse1Pk\",timestamp=\"1733290965\",serial_no=\"4925C486C56D110794D00FBE23B6C9B8BC1D9FD5\",signature=\"jDJBN1ZHvjGUGPtnxD27Aw0/HJFBagVGhDGenolTTj363p3MLNAaEI0RllConWzGBk6IG6amGFVsmtnZuvBtKN2S4JMEPTA0g2X2l7iIx5AZKy4PPgOoJAjCPvfP4SyMmXtlF0vEp4DmQNt1FGu1eeahEhIUBbAvSZJ6YJoMXEnGKIGYo6HGu3EWGc7 8WBA6SE5B3C8dalT7jmwPeLBJDeLrmRUEPaOJ8Clp1e2GJIzq0sdZpqUHazwNqPNYBIMLcKhj6WEAjX lVdKJaMFTswACxGpeTJZN9jRaVjgMnRIHTv 5XEADgeodXCZ7qK/1gPEo9bgb0vRalINqNc3rw==\"","Accept":"application/json","User-Agent":"WechatPay-Java/0.2.15 (Windows 11/10.0) Java/21.0.2 Credential/WechatPay2Credential Validator/WechatPay2Validator okhttp3/null","Content-Type":"application/json","Wechatpay-Serial":"PUB_KEY_ID_01170008*********300558100000280;"}},"body":{"body":"{\"appid\":\"wxb45*******6\",\"mchid\":\"1700******0\",\"description\":\"第D9999期D级教练员培训-河北省秦皇岛市\",\"out_trade_no\":\"1864183526775812096\",\"notify_url\":\"http://5****n/wxpay/pay_notify\",\"amount\":{\"total\":1,\"currency\":\"CNY\"},\"payer\":{\"openid\":\"oqI*******M\"}}"}}]