@param string $id  API resource ID
@param array|string|null $options

@return Withdrawal The canceled withdrawal.
498005
public static function cancel($id, $options = null)
    {
        $url = static::classUrl().'/'.$id;
        $params = array('status' => 'canceled');
        return static::_directRequest('put', $url, $params, $options);
    }
1152613
public function postEvent($id, $event, $options = [ ]) {
        $data = $options;
        $data['id'] = $id;
        $data['event'] = $event;

        $result = $this->apiPost('event', $data);
        return $result;
    }
994748
public function getUserRights($id, array $options = [])
    {
        $data = [
            '_id' => $id
        ];

        $response = $this->kuzzle->query(
            $this->buildQueryArgs('getUserRights'),
            $data,
            $options
        );

        return $response['result']['hits'];
    }
488318
protected function o_action($id, $action, $options = '')
    {
        if ($action !== 'new') {
            $o = &$this->objects[$id];
        }

        switch ($action) {
            case 'new':
                if (is_array($options)) {
                    $this->objects[$id] = array('t' => 'action', 'info' => $options, 'type' => $options['type']);
                } else {
                    // then assume a URI action
                    $this->objects[$id] = array('t' => 'action', 'info' => $options, 'type' => 'URI');
                }
                break;

            case 'out':
                if ($this->encrypted) {
                    $this->encryptInit($id);
                }

                $res = "\n$id 0 obj\n<< /Type /Action";
                switch ($o['type']) {
                    case 'ilink':
                        if (!isset($this->destinations[(string)$o['info']['label']])) {
                            break;
                        }

                        // there will be an 'label' setting, this is the name of the destination
                        $res .= "\n/S /GoTo\n/D " . $this->destinations[(string)$o['info']['label']] . " 0 R";
                        break;

                    case 'URI':
                        $res .= "\n/S /URI\n/URI (";
                        if ($this->encrypted) {
                            $res .= $this->filterText($this->ARC4($o['info']), false, false);
                        } else {
                            $res .= $this->filterText($o['info'], false, false);
                        }

                        $res .= ")";
                        break;
                }

                $res .= "\n>>\nendobj";

                return $res;
        }

        return null;
    }
986931
def get_withdrawal(self, withdrawal_id, **params):
        """"""
        return self.api_client.get_withdrawal(self.id, withdrawal_id, **params)
1022066
public function fetchRole($id, array $options = [])
    {
        $data = [
            '_id' => $id
        ];

        $response = $this->kuzzle->query(
            $this->buildQueryArgs('getRole'),
            $data,
            $options
        );

        return new Role($this, $response['result']['_id'], $response['result']['_source'], $response['result']['_meta']);
    }
1322430
public static function id($id, $options = []) {
		if (is_array($id)) {
			$result = [];
			foreach ($id as $v) {
				$result[] = self::numberToFromNativeLanguage($v . '', $options);
			}
			return implode(self::$symbol_comma . ' ', $result);
		} else {
			return self::numberToFromNativeLanguage($id . '', $options);
		}
	}
126345
public static function allRefunds($id, $params = null, $opts = null)
    {
        return self::_allNestedResources($id, static::PATH_REFUNDS, $params, $opts);
    }
594612
public function findByID($model_or_id, $options=null) {
        $id = $this->extractID($model_or_id);
        return $this->findOne(['id' => $id], null, $options);
    }
16477
public function select($name, $id, $options = [], array $attr = null)
    {
        $basic = $this->merge_attr([ 'id' => $id ], $attr);

        return $this->input($name, [ 'type' => 'select', 'options' => $options, 'attr' => $basic ]);
    }
279038
private function executeAction($id, array $options)
    {
        $action = $this->adapter->post(sprintf('%s/floating_ips/%s/actions', $this->endpoint, $id), $options);

        $action = json_decode($action);

        return new ActionEntity($action->action);
    }
838915
public function find($id, array $options = [])
    {
        $event = Arr::get($options, 'event');

        if (!$event) {
            throw new InvalidArgumentException("You must specify the 'event' key in the options array");
        }

        $endpoint = null;

        switch ($event) {
            case 'charge.created':
            case 'charge.succeeded':
            case 'charge.refunded':
            case 'charge.cancelled':
            case 'charge.failed':
            case 'charge.rescored.to.decline':
                $endpoint = 'charges'; break;

            case 'chargeback.created':
            case 'chargeback.accepted':
            case 'chargeback.rejected':
                $endpoint = 'charges'; break;

            case 'fee.refund.succeeded':
            case 'fee.succeeded':
                $endpoint = 'charges'; break;

            case 'order.activated':
            case 'order.cancelled':
            case 'order.completed':
            case 'order.created':
            case 'order.expired':
            case 'order.payment.cancelled':
            case 'order.payment.received':
                $endpoint = 'charges'; break;

            case 'payout.created':
            case 'payout.failed':
            case 'payout.succeeded':
                $endpoint = 'charges'; break;

            case 'spei.received':
                $endpoint = 'charges'; break;

            case 'subscription.charge.failed':
                $endpoint = 'charges'; break;

            case 'transfer.succeeded':
                $endpoint = 'charges'; break;
        }

        if (!$endpoint) {
            throw new InvalidArgumentException(sprintf("The specified event '%s' is not valid", $event));
        }

        /* @var \Shoperti\PayMe\Response $response */
        $response = $this->gateway->commit('get', $this->gateway->buildUrlFromString("{$endpoint}/{$id}"));
        $response->type = $event;

        return $response;
    }
266284
public function get($uri, array $options = null)
    {
        return $this->request(self::REQUEST_METHOD_GET, $uri, null, $options);
    }
177230
public function find($id, array $options = [])
    {
        $topic = Arr::get($options, 'topic');

        if ($topic == 'payment') {
            $response = $this->gateway->commit('get', $this->gateway->buildUrlFromString('collections/notifications').'/'.$id);

            if (!$response->success()) {
                return $response;
            }

            $responseData = $response->data();

            $id = Arr::get($responseData, 'merchant_order_id');
        }

        return $this->gateway->commit('get', $this->gateway->buildUrlFromString('merchant_orders').'/'.$id, [], $options);
    }
888138
public static function couponsList($id, $params = null, $options = null)
    {
        $url = static::classUrl() . '/' . $id . '/coupons';
        return static::_directRequest('get', $url, $params, $options);
    }
915103
public static function find($id = null, array $options = array())
	{
		// deal with null valued PK's
		if (is_null($id))
		{
			// if no options are present, simply return null. a PK with a null value can exist
			return func_num_args() === 2 ? static::query($options) : null;
		}

		// Return all that match $options array
		elseif ($id === 'all')
		{
			return static::query($options)->get();
		}

		// Return first or last row that matches $options array
		elseif ($id === 'first' or $id === 'last')
		{
			$query = static::query($options);

			foreach(static::primary_key() as $pk)
			{
				$query->order_by($pk, $id == 'first' ? 'ASC' : 'DESC');
			}

			return $query->get_one();
		}

		// Return specific request row by ID
		else
		{
			$cache_pk = $where = array();
			$id = (array) $id;
			foreach (static::primary_key() as $pk)
			{
				$where[] = array($pk, '=', current($id));
				$cache_pk[$pk] = current($id);
				next($id);
			}

			if (array_key_exists(get_called_class(), static::$_cached_objects)
			    and array_key_exists(static::implode_pk($cache_pk), static::$_cached_objects[get_called_class()])
			    and (! isset($options['from_cache']) or $options['from_cache'] == true))
			{
				return static::$_cached_objects[get_called_class()][static::implode_pk($cache_pk)];
			}

			array_key_exists('where', $options) and $where = array_merge($options['where'], $where);
			$options['where'] = $where;
			return static::query($options)->get_one();
		}
	}
289033
public function void($identification, $options = array())
  {
      $options = array_merge($options, array('authorization' => $identification));
      $this->build_xml(0, 'Cancel', null, $options);

      return $this->commit();
  }