我用下面的代碼獲取由指定的客戶創建發票:條紋檢索發票爲所有客戶 - 而不是一個指定
customer.invoices.all
但不管是哪個客戶創建它們它檢索所有發票。我也試過以下幾種:
Stripe::Invoice.all(customer: CUSTOMER_ID)
它的行爲方式也是一樣的。我做錯了什麼或者這是一個錯誤?
我用下面的代碼獲取由指定的客戶創建發票:條紋檢索發票爲所有客戶 - 而不是一個指定
customer.invoices.all
但不管是哪個客戶創建它們它檢索所有發票。我也試過以下幾種:
Stripe::Invoice.all(customer: CUSTOMER_ID)
它的行爲方式也是一樣的。我做錯了什麼或者這是一個錯誤?
試試這個:
Stripe::Invoice.all(:customer => "CUSTOMER_ID")
從API:https://stripe.com/docs/api?lang=ruby#list_customer_invoices
看起來就像調用發票all
覆蓋以前的查詢它獲取發票的客戶。
下檢索所有發票:
customer.invoices.all
下檢索所有發票只有客戶:
customer.invoices
你可以嘗試這樣做
customer = Stripe::Customer.retrieve("cus_6C09m0rCIx3Ld8")
invoices = Stripe::Invoice.all(:customer => customer.id)
按照原來的問題,我已經試過了。 –