【发布时间】:2017-07-10 06:01:12
【问题描述】:
我正在使用 PHP 条带 API 来检索特定条带帐户的所有客户的列表。我只需要客户对象的电子邮件地址。
以下函数运行良好,但仅返回 10 个客户。
function getListOfCustomers($stripe){
\Stripe\Stripe::setApiKey($stripe['secret_key']);
$list_of_customers = \Stripe\Customer::all(array());
return $list_of_customers['data'];
}
在阅读here 关于 API 后,它告诉我“限制”参数(即 \Stripe\Customer::all(array("limit" => 3));)是可选的,“默认限制为 10”。
所以我想这就是它只返回 10 个客户的原因。
我想退货不限数量的客户。 我想知道有人知道具体怎么做吗?
我还在same page 上阅读了以下内容:
您可以选择请求响应包括与您的过滤器匹配的所有客户的总数。为此,请指定 在您的请求中包含[]=total_count。
但是它并没有确切地告诉我如何“将其包含在我的请求中”。 我尝试了以下方法,但收到语法错误。
$list_of_customers = \Stripe\Customer::all(array(), include[]=total_count);
我也试过了:
$list_of_customers = \Stripe\Customer::all(array(include[]=total_count));
感谢您的帮助。
【问题讨论】:
标签: php api stripe-payments