Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

微信支付服务商模式支付验证签名失败 #555

Copy link
Copy link
Closed
@TonyLuo

Description

@TonyLuo
Issue body actions

我是以服务商模式发起的支付,统一下单什么都成功了,但是一到调起支付的时候就验证签名失败。
问题应该是出在BaseWxPayServiceImpl.java里的再次加密的代码里。服务商模式应该是用subAppId去加密,而不是用appid去加密。

WxPayMpOrderResult payResult = WxPayMpOrderResult.builder().appId(unifiedOrderResult.getAppid()).timeStamp(timestamp).nonceStr(nonceStr).packageValue("prepay_id=" + prepayId).signType(signType).build();
                payResult.setPaySign(SignUtils.createSign(payResult, signType, this.getConfig().getMchKey(), false));
                return payResult;

参考:
https://pay.weixin.qq.com/wiki/doc/api/wxa/wxa_sl_api.php?chapter=7_7&index=3
image

https://segmentfault.com/q/1010000011493630

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.