2014-10-05 79 views
5

我可以填充Business::Stripe的描述字段为一次性使用下面的代码费用:如何在订阅费用中填充Stripe的描述字段?

use Business::Stripe; # Version 0.4 

# Create Customer 
my $customer = $stripe->api('post', 'customers', 
    card  => $stripeToken, 
    description => $username, 
); 

# Charge 
my $charge = $stripe->api('post', 'charges', 
    customer => $customer, 
    currency => $currency, 
    description => 'my description here no probs', 
    amount  => $amount, 
); 

但是,当我创建一个客户一个客户,并将它们分配到订阅计划,我不能看到如何填充每个计费周期的费用描述。

# Create Customer and subscribe to a plan 
my $customer = $stripe->api('post', 'customers', 
    card  => $stripeToken, 
    description => 'description here is for the customer not the monthly charge', 
    plan  => $plan 
); 

我希望能够为每个结算周期发生的费用添加说明。

该API似乎没有显示出方式,但该字段可通过专用仪表板进行编辑。

回答

6

条纹正在考虑自动填充发票上的费用描述,但这不是一个存在的功能。与此同时,一旦发生事件invoice.payment_succeeded,您可以从该事件数据中获取费用ID。然后,你可以通过API更新费用的描述:

https://stripe.com/docs/api#update_charge

希望帮助, 拉里

PS我在条纹上的支持工作。

+0

谢谢拉里。现在我知道它现在不可能,我现在可以停止寻找:) – 2014-10-07 17:38:46

+0

嗨拉里,谢谢你的回应。由于你的教程和答案在这里,我很喜欢Stripe。有一个问题,我们是否仍然需要使用这个解决方案?或者Stripe改变了事情的方式?谢谢。 – Greeso 2016-12-16 19:01:09

+0

@Greeso:截至2017年12月,这似乎仍然是实现它的方式,看起来'\ Stripe \ Subscription :: create()'不支持任何'description'参数。 – 2017-12-09 15:42:43