Class: Mercadopago::Refund

Inherits:
MPBase
  • Object
show all
Defined in:
lib/mercadopago/resources/refund.rb

Overview

Instance Method Summary collapse

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(payment_id, refund_data: nil, request_options: nil) ⇒ Object

Raises:

  • (TypeError)


18
19
20
21
22
# File 'lib/mercadopago/resources/refund.rb', line 18

def create(payment_id, refund_data: nil, request_options: nil)
  raise TypeError, 'Param refund_data must be a Hash' unless refund_data.nil? || refund_data.is_a?(Hash)

  _post(uri: "/v1/payments/#{payment_id}/refunds", data: refund_data, request_options: request_options)
end

#list(payment_id, request_options: nil) ⇒ Object



14
15
16
# File 'lib/mercadopago/resources/refund.rb', line 14

def list(payment_id, request_options: nil)
  _get(uri: "/v1/payments/#{payment_id}/refunds", request_options: request_options)
end