<?php
 namespace Stripe; class Customer extends ApiResource { const OBJECT_NAME = 'customer'; use ApiOperations\All; use ApiOperations\Create; use ApiOperations\Delete; use ApiOperations\NestedResource; use ApiOperations\Retrieve; use ApiOperations\Search; use ApiOperations\Update; const TAX_EXEMPT_EXEMPT = 'exempt'; const TAX_EXEMPT_NONE = 'none'; const TAX_EXEMPT_REVERSE = 'reverse'; public static function getSavedNestedResources() { static $savedNestedResources = null; if (null === $savedNestedResources) { $savedNestedResources = new Util\Set([ 'source', ]); } return $savedNestedResources; } public function deleteDiscount($params = null, $opts = null) { $url = $this->instanceUrl() . '/discount'; list($response, $opts) = $this->_request('delete', $url, $params, $opts); $this->refreshFrom(['discount' => null], $opts, true); return $this; } public static function allPaymentMethods($id, $params = null, $opts = null) { $url = static::resourceUrl($id) . '/payment_methods'; list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; } public function retrievePaymentMethod($payment_method, $params = null, $opts = null) { $url = $this->instanceUrl() . '/payment_methods/' . $payment_method; list($response, $opts) = $this->_request('get', $url, $params, $opts); $obj = \Stripe\Util\Util::convertToStripeObject($response, $opts); $obj->setLastResponse($response); return $obj; } public static function search($params = null, $opts = null) { $url = '/v1/customers/search'; return self::_searchResource($url, $params, $opts); } const PATH_CASH_BALANCE = '/cash_balance'; public static function retrieveCashBalance($id, $cashBalanceId, $params = null, $opts = null) { return self::_retrieveNestedResource($id, static::PATH_CASH_BALANCE, $params, $opts); } public static function updateCashBalance($id, $cashBalanceId, $params = null, $opts = null) { return self::_updateNestedResource($id, static::PATH_CASH_BALANCE, $params, $opts); } const PATH_BALANCE_TRANSACTIONS = '/balance_transactions'; public static function allBalanceTransactions($id, $params = null, $opts = null) { return self::_allNestedResources($id, static::PATH_BALANCE_TRANSACTIONS, $params, $opts); } public static function createBalanceTransaction($id, $params = null, $opts = null) { return self::_createNestedResource($id, static::PATH_BALANCE_TRANSACTIONS, $params, $opts); } public static function retrieveBalanceTransaction($id, $balanceTransactionId, $params = null, $opts = null) { return self::_retrieveNestedResource($id, static::PATH_BALANCE_TRANSACTIONS, $balanceTransactionId, $params, $opts); } public static function updateBalanceTransaction($id, $balanceTransactionId, $params = null, $opts = null) { return self::_updateNestedResource($id, static::PATH_BALANCE_TRANSACTIONS, $balanceTransactionId, $params, $opts); } const PATH_SOURCES = '/sources'; public static function allSources($id, $params = null, $opts = null) { return self::_allNestedResources($id, static::PATH_SOURCES, $params, $opts); } public static function createSource($id, $params = null, $opts = null) { return self::_createNestedResource($id, static::PATH_SOURCES, $params, $opts); } public static function deleteSource($id, $sourceId, $params = null, $opts = null) { return self::_deleteNestedResource($id, static::PATH_SOURCES, $sourceId, $params, $opts); } public static function retrieveSource($id, $sourceId, $params = null, $opts = null) { return self::_retrieveNestedResource($id, static::PATH_SOURCES, $sourceId, $params, $opts); } public static function updateSource($id, $sourceId, $params = null, $opts = null) { return self::_updateNestedResource($id, static::PATH_SOURCES, $sourceId, $params, $opts); } const PATH_TAX_IDS = '/tax_ids'; public static function allTaxIds($id, $params = null, $opts = null) { return self::_allNestedResources($id, static::PATH_TAX_IDS, $params, $opts); } public static function createTaxId($id, $params = null, $opts = null) { return self::_createNestedResource($id, static::PATH_TAX_IDS, $params, $opts); } public static function deleteTaxId($id, $taxIdId, $params = null, $opts = null) { return self::_deleteNestedResource($id, static::PATH_TAX_IDS, $taxIdId, $params, $opts); } public static function retrieveTaxId($id, $taxIdId, $params = null, $opts = null) { return self::_retrieveNestedResource($id, static::PATH_TAX_IDS, $taxIdId, $params, $opts); } } 