从Stripe获取发票

时间:2015-05-23 10:59:06

标签: php stripe-payments

我正在尝试使用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 library

https://github.com/stripe/stripe-php

1 个答案:

答案 0 :(得分:1)

$response = \Stripe\Invoice::all(array('customer' => 'cus_id'));

您需要为特定客户添加客户ID。

相关问题