|
9 | 9 |
|
10 | 10 |
|
11 | 11 | use Stripe\Request\InvoiceItems\CreateInvoiceItemRequest; |
| 12 | +use Stripe\Request\InvoiceItems\ListInvoiceItemsRequest; |
12 | 13 | use Stripe\Response\DeleteResponse; |
13 | 14 | use Stripe\Response\InvoiceItems\InvoiceItemResponse; |
14 | 15 | use Stripe\Response\InvoiceItems\ListInvoiceItemsResponse; |
@@ -72,30 +73,13 @@ public function deleteInvoiceItem($invoiceItemId) |
72 | 73 | } |
73 | 74 |
|
74 | 75 | /** |
75 | | - * @param int $count |
76 | | - * @param int $offset |
77 | | - * @param string|array $created |
78 | | - * @param string $customerId |
79 | | - * @param string $startingAfter |
| 76 | + * @param ListInvoiceItemsRequest $request |
80 | 77 | * @return ListInvoiceItemsResponse |
81 | 78 | * @link https://stripe.com/docs/api#list_invoiceitems |
82 | 79 | */ |
83 | | - public function listInvoiceItems($count = 10, $offset = 0, $created = null, $customerId = null, $startingAfter = null) |
| 80 | + public function listInvoiceItems(ListInvoiceItemsRequest $request = null) |
84 | 81 | { |
85 | | - $request = array( |
86 | | - 'count' => $count, |
87 | | - 'offset' => $offset |
88 | | - ); |
89 | | - if (!is_null($created)) { |
90 | | - $request['created'] = $created; |
91 | | - } |
92 | | - if (!is_null($customerId)) { |
93 | | - $request['customer'] = $customerId; |
94 | | - } |
95 | | - if (!is_null($startingAfter)) { |
96 | | - $request['starting_after'] = $startingAfter; |
97 | | - } |
98 | | - return $this->client->get($this->buildUrl(), self::LIST_INVOICE_ITEMS_RESPONSE_CLASS, null, $request); |
| 82 | + return $this->client->get($this->buildUrl(), self::LIST_INVOICE_ITEMS_RESPONSE_CLASS, null, $this->listRequestToParams($request)); |
99 | 83 | } |
100 | 84 |
|
101 | 85 | /** |
|
0 commit comments