@param string|null $id The ID of the customer to which the source belongs.
@param string|null $sourceId The ID of the source to update.
@param array|null $params
@param array|string|null $opts

@return ApiResource
438346
public static function updateSource($id, $sourceId, $params = null, $opts = null)
    {
        return self::_updateNestedResource($id, static::PATH_SOURCES, $sourceId, $params, $opts);
    }
797567
public static function create($user_id, $params, $options = null)
    {
        $url = static::classUrlWithUserId($user_id);
        return static::_directRequest('post', $url, $params, $options);
    }
1039329
public function update($id, $params = array()) {
        $this->checkPermissions('update');
        
        return $this->client->updateData($this->resourceName . '/' . $id, $params);
    }
408528
public function get($id, $optParams = array()) {
      $params = array('id' => $id);
      $params = array_merge($params, $optParams);
      $data = $this->__call('get', array($params));
      if ($this->useObjects()) {
        return new SiteVerificationWebResourceResource($data);
      } else {
        return $data;
      }
    }
466921
public static function update($_id, $_params = null, $_options = null)
    {
        $msg = "Alipay accounts cannot be accessed without a customer ID. " .
               "Call save() on \$customer->sources->retrieve('alipay_account_id') instead.";
        throw new Error\InvalidRequest($msg, null);
    }
1257435
public function remove($id, $optParams = array()) {
      $params = array('id' => $id);
      $params = array_merge($params, $optParams);
      $data = $this->__call('remove', array($params));
      return $data;
    }
841823
public function create($customerId, $parameters = [])
    {
        if (is_array($parameters) && isset($parameters['source'])) {
            $parameters['source']['object'] = 'bank_account';
        } elseif (is_string($parameters)) {
            $parameters = ['source' => $parameters];
        }

        return $this->_post("customers/{$customerId}/sources", $parameters);
    }
203132
public static function retrieveRefund($id, $refundId, $params = null, $opts = null)
    {
        return self::_retrieveNestedResource($id, static::PATH_REFUNDS, $refundId, $params, $opts);
    }
1215606
public static function updateId($id, $data, $params=[], $filter=false) {
        return static::dao()->updateId($id, $data, $params, $filter);
    }
973792
public function get($customerId, array $params = array())
    {
        $endpoint = '/admin/customers/'.$customerId.'.json';;
        $response = $this->request($endpoint, 'GET', $params);
        return $this->createObject(Customer::class, $response['customer']);
    }
90541
public static function deleteExternalAccount($id, $externalAccountId, $params = null, $opts = null)
    {
        return self::_deleteNestedResource($id, static::PATH_EXTERNAL_ACCOUNTS, $externalAccountId, $params, $opts);
    }
560488
public function find($id = null, $params = [])
    {
        if (!$id) {
            throw new InvalidArgumentException('We need an id');
        }

        return $this->gateway->commit('get', $this->gateway->buildUrlFromString('notifications/webhooks/'.$id), [], $params);
    }
1025787
public static function updatePerson($id, $personId, $params = null, $opts = null)
    {
        return self::_updateNestedResource($id, static::PATH_PERSONS, $personId, $params, $opts);
    }
394983
public function request($id, $method, array $params = null)
    {
        return $this->createRequest(RequestInterface::REQUEST, array_filter([
            'jsonrpc' => self::SPEC,
            'method' => $method,
            'params' => $params,
            'id' => $id,
        ]));
    }
636430
public static function cancel($id, $params = null, $options = null)
    {
        $url = static::classUrl().'/'.$id;
        if (empty($params)) {
            $params = ['status' => 'canceled'];
        } else {
            $params = array_merge($params, ['status' => 'canceled']);
        }
        return static::_directRequest('put', $url, $params, $options);
    }
750910
public static function allReversals($id, $params = null, $opts = null)
    {
        return self::_allNestedResources($id, static::PATH_REVERSALS, $params, $opts);
    }
670429
public static function deleteTaxId($id, $taxIdId, $params = null, $opts = null)
    {
        return self::_deleteNestedResource($id, static::PATH_TAX_IDS, $taxIdId, $params, $opts);
    }