public function getCustomerLastBilledInvoice($code = null) {
		$invoices = $this->getCustomerInvoices($code);
		foreach ($invoices as $key => $i) {
			if (
				!empty($i['billingDatetime']) // it has a billing datetime (not an "unscheduled" invoice)
				&& strtotime($i['billingDatetime']) <= time() // it's billing datetime is before this moment
			) {
				return $i;
			}
		}
		return array();
	}
public function getCustomerLastBilledInvoice($code = null) {
		$invoices = $this->getCustomerInvoices($code);
		foreach ($invoices as $key => $i) {
			if (
				!empty($i['billingDatetime']) // it has a billing datetime (not an "unscheduled" invoice)
				&& strtotime($i['billingDatetime']) <= time() // it's billing datetime is before this moment
			) {
				return $i;
			}
		}
		return array();
	}
public function getCustomerLastBilledInvoice ( $ code = null ) { $ invoices = $ this -> getCustomerInvoices ( $ code ) ; foreach ( $ invoices as $ key => $ i ) { if ( ! empty ( $ i [ 'billingDatetime' ] ) // it has a billing datetime (not an "unscheduled" invoice) && strtotime ( $ i [ 'billingDatetime' ] ) <= time ( ) // it's billing datetime is before this moment ) { return $ i ; } } return array ( ) ; }
Get an array representation of a single customer's last billed invoice

Returns the most recent subscription invoice that is billable before now.  This could be a successfully billed invoice, one that has been transacted *unsuccessfully*, or one that has not yet been transacted at all.  Includes all invoice types ('one-time' and 'subscription')

@param $code string your code for the customer - required if more than one customer is in the response
@throws CheddarGetter_Response_Exception if the response type is incompatible or if a $code is not provided and the response contains more than one customer
@return array
Get an array representation of a single customer s last billed invoice