【发布时间】:2019-10-16 11:08:08
【问题描述】:
我有一个监听 invoice.payment_succces webhook 事件的 api 端点。每当我收到发票时,我都会通过电子邮件将指向它的链接发送给它的用户。
到目前为止,这对订阅有效,订阅会自动创建发票,但对订单似乎不一样。
每当我提交订单时(像这样)......
const order = await stripe.orders.create({
customer: user.stripeCustomerId as string,
currency: "usd",
coupon: couponCode,
items: [{
type: "sku",
parent: product.sku,
}],
});
return stripe.orders.pay(order.id, {});
...订单已记录,付款发生,但从未生成发票。
如何让stripe在提交订单时创建发票?
【问题讨论】:
-
订单不使用发票,如下所述。您可能想看看Checkout,它取代了旧的基于订单的版本,但现在使用单一付款或订阅。