我正在我的 Express 应用程序中退还用户支付的金额。
const paymentIntent = await stripe.paymentIntents.retrieve(p_id);
const refund = await stripe.refunds.create({
payment_intent: p_id,
amount: Math.round(refundAmount * 100), // Convert refund amount to cents
});
这工作正常
但是我需要根据退款事件更新记录。
我有这两个未处理的事件:
Unhandled event type charge.refunded
Unhandled event type charge.refund.updated
我确实启用了卡付款功能,将来我将添加谷歌支付和苹果..
这两个事件仅与卡支付相关吗?
假设我已在管理面板中退还了 google pay 或 apple pay 付款,我会收到相同的两个事件吗?
根据 Stripe 对 Charge 对象的描述 (https://docs.stripe.com/api/charges/object),Charge 抽象适用于所有支付方式。
如果您通过面板对 Apple 或 Google Pay 进行退款,您也会收到相同的事件。要亲自检查,您可以创建测试付款并在测试模式下从仪表板退款,以查看费用退款事件对象是什么样子。