Skip to content

付款码支付 WxPayMicropayRequest 中的签名,怎么弄的? #151

Description

@raymondZhong

How do I get a payment code to pay a signature in WxPayMicropayRequest?

Version 4.8.0

String nonceStr = IdUtil.fastSimpleUUID();

WxPayMicropayRequest request = new WxPayMicropayRequest();
request.setAppid(wxPayService.getConfig().getAppId());
request.setMchId(wxPayService.getConfig().getMchId());
request.setNonceStr(nonceStr);
request.setBody(body);
request.setOutTradeNo(outTradeNo);
request.setTotalFee(totalFee);
request.setSpbillCreateIp(ip);
request.setAuthCode(authCode);


HashMap<String,String> map = new HashMap<>();
map.put("appid",wxPayService.getConfig().getAppId());
map.put("mch_id",wxPayService.getConfig().getMchId());
map.put("nonce_str",nonceStr);
map.put("body",body);
map.put("out_trade_no",outTradeNo);
map.put("total_fee",totalFee.toString());
map.put("spbill_create_ip",ip);
map.put("auth_code",authCode);

String[] ignoredParams = new String[]{};
String sign = SignUtils.createSign(map, "", apiV2Key, ignoredParams);

request.setSign(sign); 

WxPayMicropayResult micropayResult = wxPayService.micropay(request);

----报错-----

返回代码:[FAIL],返回信息:[签名错误,请检查后再试],微信返回的原始报文:
<return_code></return_code>
<return_msg></return_msg>

@binarywang 签名部分能给个例子吗?谢谢🙏

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions