Class: Mercadopago::DisbursementRefund
- Defined in:
- lib/mercadopago/resources/disbursement_refund.rb
Overview
Manages refunds on individual disbursements within an AdvancedPayment.
In marketplace split-payment scenarios each seller receives a separate disbursement. This resource allows refunding one specific disbursement (full or partial) or all disbursements at once.
Instance Method Summary collapse
-
#create(advanced_payment_id, disbursement_id, amount: nil, request_options: nil) ⇒ Hash{Symbol => Object}
Refunds a single disbursement (full or partial).
-
#create_all(advanced_payment_id, request_options: nil) ⇒ Hash{Symbol => Object}
Refunds all disbursements of an advanced payment at once.
-
#list(advanced_payment_id, request_options: nil) ⇒ Hash{Symbol => Object}
Lists all refunds for an advanced payment.
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(advanced_payment_id, disbursement_id, amount: nil, request_options: nil) ⇒ Hash{Symbol => Object}
Refunds a single disbursement (full or partial).
Omit amount for a full refund of the disbursement, or pass a specific amount for a partial refund.
39 40 41 42 43 44 |
# File 'lib/mercadopago/resources/disbursement_refund.rb', line 39 def create(advanced_payment_id, disbursement_id, amount: nil, request_options: nil) disbursement_refund_data = amount.nil? ? nil : { amount: amount } _post(uri: "/v1/advanced_payments/#{advanced_payment_id}/disbursements/#{disbursement_id}/refunds", data: disbursement_refund_data, request_options: ) end |
#create_all(advanced_payment_id, request_options: nil) ⇒ Hash{Symbol => Object}
Refunds all disbursements of an advanced payment at once.
25 26 27 |
# File 'lib/mercadopago/resources/disbursement_refund.rb', line 25 def create_all(advanced_payment_id, request_options: nil) _post(uri: "/v1/advanced_payments/#{advanced_payment_id}/refunds", request_options: ) end |
#list(advanced_payment_id, request_options: nil) ⇒ Hash{Symbol => Object}
Lists all refunds for an advanced payment.
16 17 18 |
# File 'lib/mercadopago/resources/disbursement_refund.rb', line 16 def list(advanced_payment_id, request_options: nil) _get(uri: "/v1/advanced_payments/#{advanced_payment_id}/refunds", request_options: nil) end |