微信支付回调日期格式化
This commit is contained in:
@@ -5,6 +5,9 @@ import com.czg.PayCst;
|
||||
import com.czg.pay.PayNotifyRespDTO;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.ZonedDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
||||
/**
|
||||
* @author yjjie
|
||||
* @date 2025/12/23 22:21
|
||||
@@ -119,13 +122,16 @@ public class WechatPayNotifyDataDto {
|
||||
}
|
||||
|
||||
public PayNotifyRespDTO convertToPayNotifyRespDTO() {
|
||||
ZonedDateTime zonedDateTime = ZonedDateTime.parse(successTime);
|
||||
DateTimeFormatter outputFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
String time = zonedDateTime.format(outputFormatter);
|
||||
PayNotifyRespDTO respDTO = new PayNotifyRespDTO()
|
||||
.setMchOrderNo(outTradeNo)
|
||||
.setThirdOrderNo(transactionId)
|
||||
.setAmount(getPayAmount())
|
||||
.setPlatform(PayCst.Platform.WECHAT)
|
||||
.setExtData(attach)
|
||||
.setPaySuccessTime(successTime)
|
||||
.setPaySuccessTime(time)
|
||||
.setErrorMsg(tradeStateDesc);
|
||||
|
||||
switch (tradeState) {
|
||||
|
||||
Reference in New Issue
Block a user