收藏
回答

接入微信支付java sdk初始化报错

接入微信支付sdk初始化报错 mchId, privateKeyPath, merchantSerialNumber, apiV3Key这些参数都以配置无误org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext, AbstractApplicationContext.java, 599, refresh Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'paymentController': Unsatisfied dependency expressed through field 'jsapiService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'weChatJsapiService' defined in class path resource [com/tingbon/icon/config/WxPayConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.wechat.pay.java.service.payments.jsapi.JsapiService]: Factory method 'weChatJsapiService' threw exception; nested exception is com.wechat.pay.java.core.exception.ServiceException: Wrong HttpStatusCode[404]

httpResponseBody[{"code":"RESOURCE_NOT_EXISTS","message":"无可用的平台证书,请在商户平台-API安全申请使用微信支付公钥。可查看指引https://pay.weixin.qq.com/docs/merchant/products/platform-certificate/wxp-pub-key-guide.html"}]

回答关注问题邀请回答
收藏

1 个回答

  • Memory
    Memory
    03-06

    没有平台证书签发的需要用平台公钥进行初始化

    03-06
    有用
    回复 6
    • 对不起我是警察
      对不起我是警察
      03-07
      请问是JsapiService这个要用平台公钥初始化嘛?有具体的文档链接嘛 没找到公钥初始化的地方
      03-07
      回复
    • Memory
      Memory
      03-07回复对不起我是警察
      你用的哪个sdk?
      03-07
      回复
    • 对不起我是警察
      对不起我是警察
      03-07回复Memory
      <dependency>
                  <groupId>com.github.wechatpay-apiv3</groupId>
                  <artifactId>wechatpay-java</artifactId>
                  <version>0.2.16</version>
              </dependency>
      03-07
      回复
    • 对不起我是警察
      对不起我是警察
      03-07
      用的上面这个版本
      03-07
      回复
    • Memory
      Memory
      03-07回复对不起我是警察
      03-07
      回复
    查看更多(1)
登录 后发表内容