Commit 802a7b0a30b0327f446700df4a1dfaf04aabc064
1 parent
29a38498
【支付模块】 修改时间 格式 yyyyMMddHHmmss 为 yyyy-MM-dd'T'HHssXXX
Showing
2 changed files
with
5 additions
and
9 deletions
yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/wx/WXNativePayClient.java
| @@ -28,11 +28,7 @@ import static cn.iocoder.yudao.framework.common.util.json.JsonUtils.toJsonString | @@ -28,11 +28,7 @@ import static cn.iocoder.yudao.framework.common.util.json.JsonUtils.toJsonString | ||
| 28 | import static cn.iocoder.yudao.framework.pay.core.client.impl.wx.WXCodeMapping.CODE_SUCCESS; | 28 | import static cn.iocoder.yudao.framework.pay.core.client.impl.wx.WXCodeMapping.CODE_SUCCESS; |
| 29 | import static cn.iocoder.yudao.framework.pay.core.client.impl.wx.WXCodeMapping.MESSAGE_SUCCESS; | 29 | import static cn.iocoder.yudao.framework.pay.core.client.impl.wx.WXCodeMapping.MESSAGE_SUCCESS; |
| 30 | 30 | ||
| 31 | -/** | ||
| 32 | - * @Description: Native支付 | ||
| 33 | - * @author: zwy | ||
| 34 | - * @date: 2022年04月18日 17:00 | ||
| 35 | - */ | 31 | + |
| 36 | @Slf4j | 32 | @Slf4j |
| 37 | public class WXNativePayClient extends AbstractPayClient<WXPayClientConfig> { | 33 | public class WXNativePayClient extends AbstractPayClient<WXPayClientConfig> { |
| 38 | private WxPayService client; | 34 | private WxPayService client; |
| @@ -95,7 +91,7 @@ public class WXNativePayClient extends AbstractPayClient<WXPayClientConfig> { | @@ -95,7 +91,7 @@ public class WXNativePayClient extends AbstractPayClient<WXPayClientConfig> { | ||
| 95 | .outTradeNo(reqDTO.getMerchantOrderId()) | 91 | .outTradeNo(reqDTO.getMerchantOrderId()) |
| 96 | .body(reqDTO.getBody()) | 92 | .body(reqDTO.getBody()) |
| 97 | .totalFee(reqDTO.getAmount().intValue()) // 单位分 | 93 | .totalFee(reqDTO.getAmount().intValue()) // 单位分 |
| 98 | -// .timeExpire(DateUtil.format(reqDTO.getExpireTime(), "yyyyMMddHHmmss")) | 94 | + .timeExpire(DateUtil.format(reqDTO.getExpireTime(), "yyyy-MM-dd'T'HH:mm:ssXXX")) |
| 99 | .spbillCreateIp(reqDTO.getUserIp()) | 95 | .spbillCreateIp(reqDTO.getUserIp()) |
| 100 | .notifyUrl(reqDTO.getNotifyUrl()) | 96 | .notifyUrl(reqDTO.getNotifyUrl()) |
| 101 | .productId(trade_type) | 97 | .productId(trade_type) |
| @@ -126,7 +122,7 @@ public class WXNativePayClient extends AbstractPayClient<WXPayClientConfig> { | @@ -126,7 +122,7 @@ public class WXNativePayClient extends AbstractPayClient<WXPayClientConfig> { | ||
| 126 | // 转换结果 | 122 | // 转换结果 |
| 127 | return PayOrderNotifyRespDTO.builder().orderExtensionNo(notifyResult.getOutTradeNo()) | 123 | return PayOrderNotifyRespDTO.builder().orderExtensionNo(notifyResult.getOutTradeNo()) |
| 128 | .channelOrderNo(notifyResult.getTransactionId()).channelUserId(notifyResult.getOpenid()) | 124 | .channelOrderNo(notifyResult.getTransactionId()).channelUserId(notifyResult.getOpenid()) |
| 129 | - .successTime(DateUtil.parse(notifyResult.getTimeEnd(), "yyyyMMddHHmmss")) | 125 | + .successTime(DateUtil.parse(notifyResult.getTimeEnd(), "yyyy-MM-dd'T'HH:mm:ssXXX")) |
| 130 | .data(data.getBody()).build(); | 126 | .data(data.getBody()).build(); |
| 131 | } | 127 | } |
| 132 | 128 |
yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/wx/WXPubPayClient.java
| @@ -98,7 +98,7 @@ public class WXPubPayClient extends AbstractPayClient<WXPayClientConfig> { | @@ -98,7 +98,7 @@ public class WXPubPayClient extends AbstractPayClient<WXPayClientConfig> { | ||
| 98 | // TODO 芋艿:貌似没 title? | 98 | // TODO 芋艿:貌似没 title? |
| 99 | .body(reqDTO.getBody()) | 99 | .body(reqDTO.getBody()) |
| 100 | .totalFee(reqDTO.getAmount().intValue()) // 单位分 | 100 | .totalFee(reqDTO.getAmount().intValue()) // 单位分 |
| 101 | - .timeExpire(DateUtil.format(reqDTO.getExpireTime(), "yyyyMMddHHmmss")) | 101 | + .timeExpire(DateUtil.format(reqDTO.getExpireTime(), "yyyy-MM-dd'T'HH:mm:ssXXX")) |
| 102 | .spbillCreateIp(reqDTO.getUserIp()) | 102 | .spbillCreateIp(reqDTO.getUserIp()) |
| 103 | .openid(getOpenid(reqDTO)) | 103 | .openid(getOpenid(reqDTO)) |
| 104 | .notifyUrl(reqDTO.getNotifyUrl()) | 104 | .notifyUrl(reqDTO.getNotifyUrl()) |
| @@ -114,7 +114,7 @@ public class WXPubPayClient extends AbstractPayClient<WXPayClientConfig> { | @@ -114,7 +114,7 @@ public class WXPubPayClient extends AbstractPayClient<WXPayClientConfig> { | ||
| 114 | // TODO 芋艿:貌似没 title? | 114 | // TODO 芋艿:貌似没 title? |
| 115 | request.setDescription(reqDTO.getBody()); | 115 | request.setDescription(reqDTO.getBody()); |
| 116 | request.setAmount(new WxPayUnifiedOrderV3Request.Amount().setTotal(reqDTO.getAmount().intValue())); // 单位分 | 116 | request.setAmount(new WxPayUnifiedOrderV3Request.Amount().setTotal(reqDTO.getAmount().intValue())); // 单位分 |
| 117 | - request.setTimeExpire(DateUtil.format(reqDTO.getExpireTime(), "yyyyMMddHHmmss")); | 117 | + request.setTimeExpire(DateUtil.format(reqDTO.getExpireTime(), "yyyy-MM-dd'T'HH:mm:ssXXX")); |
| 118 | request.setPayer(new WxPayUnifiedOrderV3Request.Payer().setOpenid(getOpenid(reqDTO))); | 118 | request.setPayer(new WxPayUnifiedOrderV3Request.Payer().setOpenid(getOpenid(reqDTO))); |
| 119 | request.setSceneInfo(new WxPayUnifiedOrderV3Request.SceneInfo().setPayerClientIp(reqDTO.getUserIp())); | 119 | request.setSceneInfo(new WxPayUnifiedOrderV3Request.SceneInfo().setPayerClientIp(reqDTO.getUserIp())); |
| 120 | request.setNotifyUrl(reqDTO.getNotifyUrl()); | 120 | request.setNotifyUrl(reqDTO.getNotifyUrl()); |