stripe 一次订阅 bug修复
This commit is contained in:
@@ -39,7 +39,7 @@ import java.math.RoundingMode;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneOffset;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -557,17 +557,20 @@ public class StripeServiceImpl implements StripeService {
|
||||
&& amount.equals(ProductEnum.DailySubscription.getPrice() * 100)){
|
||||
interval = "day";
|
||||
// 获取一天后的时间戳(秒级)
|
||||
currentPeriodEnd = Instant.now().plus(1, ChronoUnit.DAYS).getEpochSecond();
|
||||
ZonedDateTime now = ZonedDateTime.now();
|
||||
currentPeriodEnd = now.plusDays(1).toEpochSecond();
|
||||
}else if (description.equals(ProductEnum.MonthlySubscription.getName())
|
||||
&& amount.equals(ProductEnum.MonthlySubscription.getPrice() * 100)){
|
||||
interval = "month";
|
||||
// 获取一天后的时间戳(秒级)
|
||||
currentPeriodEnd = Instant.now().plus(1, ChronoUnit.MONTHS).getEpochSecond();
|
||||
ZonedDateTime now = ZonedDateTime.now();
|
||||
currentPeriodEnd = now.plusMonths(1).toEpochSecond();
|
||||
}else if (description.equals(ProductEnum.AnnualSubscription.getName())
|
||||
&& amount.equals(ProductEnum.AnnualSubscription.getPrice() * 100)){
|
||||
interval = "year";
|
||||
// 获取一天后的时间戳(秒级)
|
||||
currentPeriodEnd = Instant.now().plus(1, ChronoUnit.YEARS).getEpochSecond();
|
||||
ZonedDateTime now = ZonedDateTime.now();
|
||||
currentPeriodEnd = now.plusYears(1).toEpochSecond();
|
||||
}else {
|
||||
log.error("未知订阅类型");
|
||||
return false;
|
||||
@@ -956,7 +959,7 @@ public class StripeServiceImpl implements StripeService {
|
||||
qwSI.eq("order_no", orderNo);
|
||||
subscriptionInfo = subscriptionInfoMapper.selectOne(qwSI);
|
||||
if (Objects.isNull(subscriptionInfo)){
|
||||
log.info("根据order_no:{},查询到的subscriptionInfo为空", orderNo);
|
||||
log.info("不发送邮件,原因:【根据order_no:{},查询到的subscriptionInfo为空】", orderNo);
|
||||
return false;
|
||||
}
|
||||
}else {
|
||||
|
||||
Reference in New Issue
Block a user