如何在订阅收费中填写Stripe的描述字段?

8
我可以使用以下代码为一次性费用填充Business::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似乎没有提供这样的功能,但是可以通过strie仪表板编辑该字段。
1个回答

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

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

希望这能有所帮助, Larry
附注:我在Stripe的支持团队工作。

谢谢,Larry。现在我知道目前不可能了,我可以停止寻找了 :) - James Morrison
嗨Larry,感谢您的回复。由于您在这里的教程和答案,我非常喜欢Stripe。有一个问题,我们是否仍然需要使用这个解决方案?或者Stripe改变了事情的方式?谢谢。 - Greeso
截至2017年12月,这仍然似乎是正确的方法,因为\Stripe\Subscription::create()不支持任何description参数。 - Fabien Snauwaert
1
@FabienSnauwaert - 是的,我也不幸意识到了这一点 :( 我希望Stripe能够解决这个问题。 - Greeso

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接