We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
weixin-pay模块能否支持服务商模式呢?目前看统一下单接口的输入没有sub_mch_id字段。
The text was updated successfully, but these errors were encountered:
其实可以fork下项目自己扩展下, 我看了下源码结构很清晰的, 我的思路是在BaseSettings.java 里新增俩字段
BaseSettings.java
@JsonProperty("sub_appid") private String subAppId; //微信分配的子商户公众账号ID @JsonProperty("sub_mch_id") private String subMchId; //微信支付分配的子商户号
然后在Payments 新增方法
Payments
/** * 设置子商户信息 * @param subAppId * @param subMchId * @return */ public Payments subMInfo(String subAppId, String subMchId) { this.subAppId = subAppId; this.subMchId = subMchId; return this; } //在setBaseSettings方法追加 private void setBaseSettings(BaseSettings wrapper) { wrapper.setAppId(paySetting.getAppId()); wrapper.setMchId(paySetting.getMchId()); if(subAppId != null && subAppId.length() > 0) { wrapper.setSubAppId(subAppId); } if(subMchId != null && subMchId.length() > 0) { wrapper.setSubMchId(subMchId); } }
最后调用的时候 Payments.defaultPayments().subMInfo("", "").unifiedOrder(unifiedOrderRequest) (由于子商户号一般是不同商户会变的,所以没写在paySetting)
Payments.defaultPayments().subMInfo("", "").unifiedOrder(unifiedOrderRequest)
我也是刚这样弄的,并没有测试过,我debug的时候Wrapper=>SortedMap后观察请求参数是包含了sub_appid,sub_mch_id字段
仅供参考
Sorry, something went wrong.
No branches or pull requests
weixin-pay模块能否支持服务商模式呢?目前看统一下单接口的输入没有sub_mch_id字段。
The text was updated successfully, but these errors were encountered: