【支付模块】
添加 微信native支付
This commit is contained in:
zwy 2022-04-19 17:38:43 +08:00
parent 4a91dcb3bf
commit 29a384989b

View File

@ -38,14 +38,14 @@ public class WXNativePayClient extends AbstractPayClient<WXPayClientConfig> {
private WxPayService client;
public WXNativePayClient(Long channelId, WXPayClientConfig config) {
super(channelId, PayChannelEnum.WX_PUB.getCode(), config, new WXCodeMapping());
super(channelId, PayChannelEnum.WX_NATIVE.getCode(), config, new WXCodeMapping());
}
@Override
protected void doInit() {
WxPayConfig payConfig = new WxPayConfig();
BeanUtil.copyProperties(config, payConfig, "keyContent");
payConfig.setTradeType(WxPayConstants.TradeType.JSAPI); // 设置使用 JS API 支付方式
payConfig.setTradeType(WxPayConstants.TradeType.NATIVE); // 设置使用 native 支付方式
// if (StrUtil.isNotEmpty(config.getKeyContent())) {
// payConfig.setKeyContent(config.getKeyContent().getBytes(StandardCharsets.UTF_8));
// }
@ -97,7 +97,6 @@ public class WXNativePayClient extends AbstractPayClient<WXPayClientConfig> {
.totalFee(reqDTO.getAmount().intValue()) // 单位分
// .timeExpire(DateUtil.format(reqDTO.getExpireTime(), "yyyyMMddHHmmss"))
.spbillCreateIp(reqDTO.getUserIp())
.tradeType(WxPayConstants.TradeType.NATIVE)
.notifyUrl(reqDTO.getNotifyUrl())
.productId(trade_type)
.build();