我正在尝试使用 PHP 从 Stripe 获取特定客户的发票列表。
以下是我正在使用的代码。
\Stripe\Stripe::setApiKey('STRIPE_SECRET_KEY');
$response = \Stripe\Invoice::all(array('customer' => 'CUSTOMER_TOKEN'));
但这会返回空数组。
相反,CURL 命令返回结果
curl https://api.stripe.com/v1/invoices?customer=CUSTOMER_TOKEN -u STRIPE_SECRET_KEY
有什么想法吗?
我正在使用 Github 提供的 Stripe PHP 库
。
最佳答案
$response = \Stripe\Invoice::all(array('customer' => 'cus_id'));
您需要为特定客户添加客户 ID。
关于php - 从 Stripe 获取发票,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30411882/