Stripe webhook charge回调处理

This commit is contained in:
2025-02-24 10:36:42 +08:00
parent 828a022768
commit e60c3d7aa3

View File

@@ -392,6 +392,10 @@ public class StripeServiceImpl implements StripeService {
Charge charge = (Charge) stripeObject; Charge charge = (Charge) stripeObject;
String orderNo = charge.getDescription().replace("AiDA - ", ""); String orderNo = charge.getDescription().replace("AiDA - ", "");
OrderInfo orderInfo = orderInfoService.getOrderByOrderNo(orderNo); OrderInfo orderInfo = orderInfoService.getOrderByOrderNo(orderNo);
if (Objects.isNull(orderInfo)){
// 说明该回调不是从AiDA订阅获得
response = Boolean.TRUE;
}
if (event.getType().equals("charge.failed")){ if (event.getType().equals("charge.failed")){
// 添加支付信息 && 更新支付信息 // 添加支付信息 && 更新支付信息
// 支付失败时无法通过invoice_id获取支付方式所以使用charge.failed回调添加支付信息 // 支付失败时无法通过invoice_id获取支付方式所以使用charge.failed回调添加支付信息