Class: Vk::API::Orders

Inherits:
Schema::Namespace show all
Defined in:
lib/vk/api/methods.rb,
lib/vk/api/objects.rb,
lib/vk/api/responses.rb,
lib/vk/api/orders/order.rb,
lib/vk/api/orders/amount.rb,
lib/vk/api/orders/methods/get.rb,
lib/vk/api/orders/methods/get_by_id.rb,
lib/vk/api/orders/methods/get_amount.rb,
lib/vk/api/orders/methods/change_state.rb,
lib/vk/api/orders/responses/get_response.rb,
lib/vk/api/orders/responses/get_by_id_response.rb,
lib/vk/api/orders/responses/get_amount_response.rb,
lib/vk/api/orders/responses/change_state_response.rb

Defined Under Namespace

Modules: Methods, Responses Classes: Amount, Order

Instance Attribute Summary

Attributes inherited from Schema::Namespace

#client

DSL collapse

Methods inherited from Schema::Namespace

#call, #initialize

Constructor Details

This class inherits a constructor from Vk::Schema::Namespace

Instance Method Details

#change_state(arguments = {}) ⇒ Vk::API::Orders::Responses::ChangeStateResponse

Returns Changes order status.

Parameters:

  • arguments (Hash) (defaults to: {})

Options Hash (arguments):

  • :order_id (Integer)

    order ID.

  • :action (String)

    action to be done with the order. ; ; Available actions:; *cancel — to cancel unconfirmed order.; *charge — to confirm unconfirmed order. Applies only if processing of notification failed.; *refund — to cancel confirmed order.;

  • :app_order_id (Integer)

    internal ID of the order in the application.

  • :test_mode (Boolean)

    if this parameter is set to 1, this method returns a list of test mode orders. By default — 0.

Returns:

See Also:



1741
1742
1743
1744
1745
1746
1747
# File 'lib/vk/api/methods.rb', line 1741

def change_state(arguments = {})
  require "vk/api/orders/methods/change_state"
  method = Methods::ChangeState.new(arguments)
  response = method.call(@client)
  require "vk/api/orders/responses/change_state_response"
  Responses::ChangeStateResponse.new(response.deep_symbolize_keys)
end

#get(arguments = {}) ⇒ Vk::API::Orders::Responses::GetResponse

Returns a list of orders.

Parameters:

  • arguments (Hash) (defaults to: {})

Options Hash (arguments):

  • :count (Integer) — default: 100

    number of returned orders.

  • :test_mode (Boolean)

    if this parameter is set to 1, this method returns a list of test mode orders. By default — 0.

Returns:

See Also:



1714
1715
1716
1717
1718
1719
1720
# File 'lib/vk/api/methods.rb', line 1714

def get(arguments = {})
  require "vk/api/orders/methods/get"
  method = Methods::Get.new(arguments)
  response = method.call(@client)
  require "vk/api/orders/responses/get_response"
  Responses::GetResponse.new(response.deep_symbolize_keys)
end

#get_amount(arguments = {}) ⇒ Vk::API::Orders::Responses::GetAmountResponse



1753
1754
1755
1756
1757
1758
1759
# File 'lib/vk/api/methods.rb', line 1753

def get_amount(arguments = {})
  require "vk/api/orders/methods/get_amount"
  method = Methods::GetAmount.new(arguments)
  response = method.call(@client)
  require "vk/api/orders/responses/get_amount_response"
  Responses::GetAmountResponse.new(response.deep_symbolize_keys)
end

#get_by_id(arguments = {}) ⇒ Vk::API::Orders::Responses::GetByIdResponse

Returns information about orders by their IDs.

Parameters:

  • arguments (Hash) (defaults to: {})

Options Hash (arguments):

  • :order_id (Integer)

    order ID.

  • :order_ids (Array)

    order IDs (when information about several orders is requested).

  • :test_mode (Boolean)

    if this parameter is set to 1, this method returns a list of test mode orders. By default — 0.

Returns:

See Also:



1727
1728
1729
1730
1731
1732
1733
# File 'lib/vk/api/methods.rb', line 1727

def get_by_id(arguments = {})
  require "vk/api/orders/methods/get_by_id"
  method = Methods::GetById.new(arguments)
  response = method.call(@client)
  require "vk/api/orders/responses/get_by_id_response"
  Responses::GetByIdResponse.new(response.deep_symbolize_keys)
end