收藏
回答

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\"}}"}}]


最后一次编辑于  12-04
回答关注问题邀请回答
收藏

1 个回答

  • Memory
    Memory
    12-04

    没有敏感信息,你给个pub_key_id 干啥?给就给呗,你也没给对

    12-04
    有用
    回复 4
    • iii
      iii
      12-04
      不是这个里的吗
      12-04
      回复
    • Memory
      Memory
      12-04回复iii
      给错了才会报系统繁忙
      12-04
      回复
    • iii
      iii
      12-04回复Memory
      麻烦问一下,这里的pub_key_id 不是商户的公钥ID吗?是的话没有给错呀
      12-04
      回复
    • Memory
      Memory
      12-04回复iii
      是商户的平台公钥ID,和商户号对不上就报错这个
      12-04
      回复
登录 后发表内容