Commit 29a384989b4dea2d52564a9a20098f96e4cd5754
1 parent
4a91dcb3
【支付模块】 添加 微信native支付
Showing
1 changed file
with
2 additions
and
3 deletions
yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/wx/WXNativePayClient.java
| @@ -38,14 +38,14 @@ public class WXNativePayClient extends AbstractPayClient<WXPayClientConfig> { | @@ -38,14 +38,14 @@ public class WXNativePayClient extends AbstractPayClient<WXPayClientConfig> { | ||
| 38 | private WxPayService client; | 38 | private WxPayService client; |
| 39 | 39 | ||
| 40 | public WXNativePayClient(Long channelId, WXPayClientConfig config) { | 40 | public WXNativePayClient(Long channelId, WXPayClientConfig config) { |
| 41 | - super(channelId, PayChannelEnum.WX_PUB.getCode(), config, new WXCodeMapping()); | 41 | + super(channelId, PayChannelEnum.WX_NATIVE.getCode(), config, new WXCodeMapping()); |
| 42 | } | 42 | } |
| 43 | 43 | ||
| 44 | @Override | 44 | @Override |
| 45 | protected void doInit() { | 45 | protected void doInit() { |
| 46 | WxPayConfig payConfig = new WxPayConfig(); | 46 | WxPayConfig payConfig = new WxPayConfig(); |
| 47 | BeanUtil.copyProperties(config, payConfig, "keyContent"); | 47 | BeanUtil.copyProperties(config, payConfig, "keyContent"); |
| 48 | - payConfig.setTradeType(WxPayConstants.TradeType.JSAPI); // 设置使用 JS API 支付方式 | 48 | + payConfig.setTradeType(WxPayConstants.TradeType.NATIVE); // 设置使用 native 支付方式 |
| 49 | // if (StrUtil.isNotEmpty(config.getKeyContent())) { | 49 | // if (StrUtil.isNotEmpty(config.getKeyContent())) { |
| 50 | // payConfig.setKeyContent(config.getKeyContent().getBytes(StandardCharsets.UTF_8)); | 50 | // payConfig.setKeyContent(config.getKeyContent().getBytes(StandardCharsets.UTF_8)); |
| 51 | // } | 51 | // } |
| @@ -97,7 +97,6 @@ public class WXNativePayClient extends AbstractPayClient<WXPayClientConfig> { | @@ -97,7 +97,6 @@ public class WXNativePayClient extends AbstractPayClient<WXPayClientConfig> { | ||
| 97 | .totalFee(reqDTO.getAmount().intValue()) // 单位分 | 97 | .totalFee(reqDTO.getAmount().intValue()) // 单位分 |
| 98 | // .timeExpire(DateUtil.format(reqDTO.getExpireTime(), "yyyyMMddHHmmss")) | 98 | // .timeExpire(DateUtil.format(reqDTO.getExpireTime(), "yyyyMMddHHmmss")) |
| 99 | .spbillCreateIp(reqDTO.getUserIp()) | 99 | .spbillCreateIp(reqDTO.getUserIp()) |
| 100 | - .tradeType(WxPayConstants.TradeType.NATIVE) | ||
| 101 | .notifyUrl(reqDTO.getNotifyUrl()) | 100 | .notifyUrl(reqDTO.getNotifyUrl()) |
| 102 | .productId(trade_type) | 101 | .productId(trade_type) |
| 103 | .build(); | 102 | .build(); |