我正在使用PaymentIntent API的条纹处理支付在我的网站。CreateIntent方法允许您设置电子邮件,其中收据将通过电子邮件发送。但在那封电子邮件中,他们只发送了多少钱的信息。我想包括产品的信息以及收据电子邮件。
这是我的产品。
p = stripe.Product.create(
name="T-shirt",
type="good",
description="Comfortable cotton t-shirt",
attributes=["size", "gender"],
)我是如何创建PI对象的。
intent = stripe.PaymentIntent.create(
amount=100,
currency='cad',
metadata={'integration_check': 'accept_a_payment' , 'product_id' : p.id},
receipt_email="random@outlook.com",
description="What"
)有人能帮我把产品信息包括在收据电子邮件中吗?我在create方法中做了什么吗?
发布于 2022-06-29 13:46:15
您可以尝试首先创建一个In发发票,将产品作为InvoiceItem,如解释的here所示。
发票定稿后,发票上将有一个paymentIntent。
const finalInvoice = await stripe.invoices.finalizeInvoice(invoiceId) 然后查看结果电子邮件是否包含产品信息,在付款后提交。
https://stackoverflow.com/questions/61980909
复制相似问题