Sha256: d065802fdc1d10925e1b16ca1a95388606a40034f891aa48c3e98a9f28ff0925

Contents?: true

Size: 1000 Bytes

Versions: 7

Compression:

Stored size: 1000 Bytes

Contents

# typed: true
# frozen_string_literal: true

module Mercadopago
  ###
  # This class will allow you to refund payments created through the Payments class.
  # You can refund a payment within 180 days after it was approved.

  # You must have sufficient funds in your account in order to successfully refund the payment amount. Otherwise, you will get a 400 Bad Request error.

  # [Click here for more infos](https://www.mercadopago.com.br/developers/en/guides/manage-account/account/cancellations-and-refunds#bookmark_refunds)

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

    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
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
mercadopago-sdk-2.3.0 lib/mercadopago/resources/refund.rb
mercadopago-sdk-2.2.1 lib/mercadopago/resources/refund.rb
mercadopago-sdk-2.2.0 lib/mercadopago/resources/refund.rb
mercadopago-sdk-2.1.0 lib/mercadopago/resources/refund.rb
mercadopago-sdk-2.0.3 lib/mercadopago/resources/refund.rb
mercadopago-sdk-2.0.2 lib/mercadopago/resources/refund.rb
mercadopago-sdk-2.0.1 lib/mercadopago/resources/refund.rb