Class: DeliveryFivePostClient::Resources::API::V1::Partners::Orders

Inherits:
Object
  • Object
show all
Defined in:
lib/delivery_five_post_client/resources/api/v1/partners/orders.rb,
lib/delivery_five_post_client/resources/api/v1/partners/orders/cargo.rb

Defined Under Namespace

Classes: Cargo

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Orders

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Orders.

Parameters:



102
103
104
105
# File 'lib/delivery_five_post_client/resources/api/v1/partners/orders.rb', line 102

def initialize(client:)
  @client = client
  @cargo = DeliveryFivePostClient::Resources::API::V1::Partners::Orders::Cargo.new(client: client)
end

Instance Attribute Details

#cargo ⇒ DeliveryFivePostClient::Resources::API::V1::Partners::Orders::Cargo (readonly)



10
11
12
# File 'lib/delivery_five_post_client/resources/api/v1/partners/orders.rb', line 10

def cargo
  @cargo
end

Instance Method Details

#c2c(cargoes:, cost:, receiver:, receiver_location:, sender:, sender_location:, sender_order_id:, client_order_id: nil, request_options: {}) ⇒ DeliveryFivePostClient::Models::API::V1::Partners::OrderC2cResponse

Создание заказа C2C (от клиента к клиенту) / Create C2C order (customer to customer)

Parameters:

Returns:

See Also:



38
39
40
41
42
43
44
45
46
47
# File 'lib/delivery_five_post_client/resources/api/v1/partners/orders.rb', line 38

def c2c(params)
  parsed, options = DeliveryFivePostClient::API::V1::Partners::OrderC2cParams.dump_request(params)
  @client.request(
    method: :post,
    path: "api/v1/partners/orders/c2c",
    body: parsed,
    model: DeliveryFivePostClient::Models::API::V1::Partners::OrderC2cResponse,
    options: options
  )
end

#update_client_info(order_id, client:, request_options: {}) ⇒ nil

Обновление данных клиента / Update client information

Parameters:

Returns:

  • (nil)

See Also:



62
63
64
65
66
67
68
69
70
71
72
# File 'lib/delivery_five_post_client/resources/api/v1/partners/orders.rb', line 62

def update_client_info(order_id, params)
  parsed, options =
    DeliveryFivePostClient::API::V1::Partners::OrderUpdateClientInfoParams.dump_request(params)
  @client.request(
    method: :put,
    path: ["api/v1/partners/orders/%1$s/client-info", order_id],
    body: parsed,
    model: NilClass,
    options: options
  )
end

#update_payment_value(order_id, payment_value:, request_options: {}) ⇒ nil

Обнуление наложенного платежа / Reset payment value

Parameters:

  • order_id (String) —

    UUID в формате v4 / UUID in v4 format

  • payment_value (Float) —

    Новая сумма наложенного платежа / New payment value

  • request_options (DeliveryFivePostClient::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

  • (nil)

See Also:



87
88
89
90
91
92
93
94
95
96
97
# File 'lib/delivery_five_post_client/resources/api/v1/partners/orders.rb', line 87

def update_payment_value(order_id, params)
  parsed, options =
    DeliveryFivePostClient::API::V1::Partners::OrderUpdatePaymentValueParams.dump_request(params)
  @client.request(
    method: :put,
    path: ["api/v1/partners/orders/%1$s/paymentValue", order_id],
    body: parsed,
    model: NilClass,
    options: options
  )
end