Class: Mercadopago::MerchantOrder
- Inherits:
-
MPBase
- Object
- MPBase
- Mercadopago::MerchantOrder
show all
- Defined in:
- lib/mercadopago/resources/merchant_order.rb
Overview
This class will allow you to create and manage your orders. You can attach one or more payments in your merchant order.
Instance Method Summary
collapse
Methods inherited from MPBase
#_check_headers, #_check_request_options, #_delete, #_get, #_post, #_put, #initialize
Instance Method Details
#create(merchant_order_data, request_options: nil) ⇒ Object
19
20
21
22
23
|
# File 'lib/mercadopago/resources/merchant_order.rb', line 19
def create(merchant_order_data, request_options: nil)
raise TypeError, 'Param merchant_orders_object must be a Hash' unless merchant_order_data.is_a?(Hash)
_post(uri: '/merchant_orders', data: merchant_order_data, request_options: request_options)
end
|
#get(merchant_order_id, request_options: nil) ⇒ Object
15
16
17
|
# File 'lib/mercadopago/resources/merchant_order.rb', line 15
def get(merchant_order_id, request_options: nil)
_get(uri: "/merchant_orders/#{merchant_order_id}", request_options: request_options)
end
|
#search(filters: nil, request_options: nil) ⇒ Object
9
10
11
12
13
|
# File 'lib/mercadopago/resources/merchant_order.rb', line 9
def search(filters: nil, request_options: nil)
raise TypeError, 'Param filters must be a Hash' unless filters.nil? || filters.is_a?(Hash)
_get(uri: '/merchant_orders/search', filters: filters, request_options: request_options)
end
|
#update(merchant_order_id, merchant_order_data, request_options: nil) ⇒ Object
25
26
27
28
29
30
|
# File 'lib/mercadopago/resources/merchant_order.rb', line 25
def update(merchant_order_id, merchant_order_data, request_options: nil)
raise TypeError, 'Param merchant_orders_object must be a Hash' unless merchant_order_data.is_a?(Hash)
_put(uri: "/merchant_orders/#{merchant_order_id}", data: merchant_order_data,
request_options: request_options)
end
|