public function invoiceItems($params = null) { if (!$params) { $params = array(); } $params['customer'] = $this->id; $iis = Stripe_InvoiceItem::all($params, $this->_apiKey); return $iis; }
/** * Get all invoice items * * @param mixed $cus_attr * @param string $invoice_id * @param string $limit Number of invoiceitems to retrieve * @param string $ending_before ID of the first element in the previous list * @param string $starting_after ID of the last element in the previous list * @param mixed $created * @return array|false */ public function getInvoiceItems($cus_attr = null, $invoice_id = null, $limit = 10, $ending_before = null, $starting_after = null, $created = null) { try { $params = array_filter(array('limit' => $limit, 'ending_before' => $ending_before, 'starting_after' => $starting_after)); if ($invoice_id) { $invoice = $this->getInvoice($invoice_id); if (!$invoice) { return false; } return $invoice->lines->all(array_filter($params)); } else { $customer = new StripeCustomer($cus_attr); $params['customer'] = $customer->getCustomerAccount()->id; $params['created'] = $created; return Stripe_InvoiceItem::all(array_filter($params), $this->access_token); } } catch (Exception $ex) { $this->log($ex); return false; } }