2014-10-05 52 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