stripe 一次订阅 添加日志打印
This commit is contained in:
@@ -357,7 +357,8 @@ public class StripeServiceImpl implements StripeService {
|
||||
case "manual":
|
||||
boolean b = invoice.getLines().getData().get(0).getDescription().endsWith("Subscription");
|
||||
if (b) {
|
||||
response = sendEmail(invoice.getSubscription(), "new", null);
|
||||
// 非自动续订式订阅,Stripe不会创建Subscription,所以invoice中不会有subscriptionId
|
||||
response = sendEmail(null, "new", paymentInfo.getOrderNo());
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -449,6 +450,7 @@ public class StripeServiceImpl implements StripeService {
|
||||
InvoiceLineItem invoiceLineItem = invoice.getLines().getData().get(0);
|
||||
String description = invoiceLineItem.getDescription();
|
||||
Long amount = invoiceLineItem.getAmount();
|
||||
log.info("单次订阅 description : {}, amount: {}", description, amount);
|
||||
boolean b = createSubscriptionAndUpdateAccount(orderNo, orderByOrderNo.getAccountId(), description, amount);
|
||||
// 邮件通知用户
|
||||
if (b){
|
||||
@@ -581,7 +583,7 @@ public class StripeServiceImpl implements StripeService {
|
||||
|
||||
subscriptionInfoMapper.insertIgnore(subscriptionInfo);
|
||||
|
||||
log.info("创建订阅更新账号信息");
|
||||
log.info("创建订阅, 更新账号信息");
|
||||
// 更新账号到期时间
|
||||
boolean b = accountService.updateAccountValidity(subscriptionInfo.getAccountId(), subscriptionInfo.getCurrentPeriodEnd());
|
||||
// 更新账号身份和积分
|
||||
@@ -953,6 +955,10 @@ public class StripeServiceImpl implements StripeService {
|
||||
}else if (!StringUtil.isNullOrEmpty(orderNo)) {
|
||||
qwSI.eq("order_no", orderNo);
|
||||
subscriptionInfo = subscriptionInfoMapper.selectOne(qwSI);
|
||||
if (Objects.isNull(subscriptionInfo)){
|
||||
log.info("根据order_no:{},查询到的subscriptionInfo为空", orderNo);
|
||||
return false;
|
||||
}
|
||||
}else {
|
||||
log.info("不发送邮件,原因:【入参中的subscriptionId,orderNo均为空】");
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user