【发布时间】:2018-11-27 22:53:59
【问题描述】:
在我的 python 项目中,我必须与 Stripe API 集成以自动化我的付款和发票管理。 我尝试创建这样的发票:
stripe.Invoice.create(
customer=c_stripe.id,
billing='charge_automatically',
tax_percent=22,
charge=sc.id,
description='Test ondemand invoice',
lines=[s_li,]
)
其中 c_stripe.id 是条带中客户的 id,sc.id 是之前创建的费用的 id。 现在我必须将行项目添加到我的发票中,我这样做了:
s_li = stripe.line_item.create(
amount=int(glob_amount*100),
currency='eur',
description='test monthly usage',
type='invoiceitem'
)
但系统对我说“条纹中没有 line_item 方法”。 如何在 Stripe API 中创建包含不同项目行的发票?
提前致谢
【问题讨论】:
标签: python python-3.x stripe-payments