Sha256: d0be03a35d34970ab3363d59298b83895a1ad8a537cda73f1078b8fbce34a3f2

Contents?: true

Size: 1001 Bytes

Versions: 5

Compression:

Stored size: 1001 Bytes

Contents

module MangoPay
  class PayOut < Resource
    include HTTPCalls::Fetch

    # Fetches list of refunds belonging to the given +pay_out_id+.
    #
    # Optional +filters+ is a hash accepting following keys:
    # - +page+, +per_page+, +sort+: pagination and sorting params (see MangoPay::HTTPCalls::Fetch::ClassMethods#fetch)
    # - +Status+: TransactionStatus {CREATED, SUCCEEDED, FAILED}
    # - +ResultCode+: string representing the transaction result
    def self.refunds(pay_out_id, filters = {}, idempotency_key = nil)
      url = url(pay_out_id) + '/refunds'
      MangoPay.request(:get, url, {}, filters, idempotency_key)
    end

    # See http://docs.mangopay.com/api-references/pay-out-bank-wire/
    class BankWire < Resource
      include HTTPCalls::Create

      def self.url(*)
        "#{MangoPay.api_path}/payouts/bankwire"
      end

      def self.get_bankwire(pay_out_id)
        url = self.url() + "/" + pay_out_id
        MangoPay.request(:get, url);
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
mangopay-3.8.0 lib/mangopay/pay_out.rb
mangopay-3.7.0 lib/mangopay/pay_out.rb
mangopay-3.6.0 lib/mangopay/pay_out.rb
mangopay-3.5.0 lib/mangopay/pay_out.rb
mangopay-3.4.0 lib/mangopay/pay_out.rb