Class: Mercadopago::MerchantOrder
- Defined in:
- lib/mercadopago/resources/merchant_order.rb
Overview
Groups one or more payments into a single merchant order.
Merchant orders are useful for marketplace and multi-payment scenarios where you need to track the fulfilment status of several payments as a unit.
Instance Method Summary collapse
-
#create(merchant_order_data, request_options: nil) ⇒ Hash{Symbol => Object}
Creates a new merchant order.
-
#get(merchant_order_id, request_options: nil) ⇒ Hash{Symbol => Object}
Retrieves a single merchant order by ID.
-
#search(filters: nil, request_options: nil) ⇒ Hash{Symbol => Object}
Searches merchant orders matching the given filters.
-
#update(merchant_order_id, merchant_order_data, request_options: nil) ⇒ Hash{Symbol => Object}
Updates an existing merchant order.
Methods inherited from MPBase
#_check_headers, #_check_request_options, #_delete, #_get, #_post, #_put, #initialize
Constructor Details
This class inherits a constructor from Mercadopago::MPBase
Instance Method Details
#create(merchant_order_data, request_options: nil) ⇒ Hash{Symbol => Object}
Creates a new merchant order.
43 44 45 46 47 |
# File 'lib/mercadopago/resources/merchant_order.rb', line 43 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: ) end |
#get(merchant_order_id, request_options: nil) ⇒ Hash{Symbol => Object}
Retrieves a single merchant order by ID.
32 33 34 |
# File 'lib/mercadopago/resources/merchant_order.rb', line 32 def get(merchant_order_id, request_options: nil) _get(uri: "/merchant_orders/#{merchant_order_id}", request_options: ) end |
#search(filters: nil, request_options: nil) ⇒ Hash{Symbol => Object}
Searches merchant orders matching the given filters.
20 21 22 23 24 |
# File 'lib/mercadopago/resources/merchant_order.rb', line 20 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: ) end |
#update(merchant_order_id, merchant_order_data, request_options: nil) ⇒ Hash{Symbol => Object}
Updates an existing merchant order.
57 58 59 60 61 62 |
# File 'lib/mercadopago/resources/merchant_order.rb', line 57 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: ) end |