Sha256: 57b5c61a9e9c9f1d5fe4e96879301b68b66df26bd92df3cf8c1d1926fc329fa5

Contents?: true

Size: 1.06 KB

Versions: 17

Compression:

Stored size: 1.06 KB

Contents

module MangoPay
  class Transaction < Resource
    class << self
      # Fetches list of transactions belonging to the given +wallet_id+.
      # See also transactions for user: MangoPay::User#transactions
      # 
      # 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}
      # - +Type+: TransactionType {PAYIN, PAYOUT, TRANSFER}
      # - +Nature+: TransactionNature {NORMAL, REFUND, REPUDIATION}
      # - +BeforeDate+ (timestamp): filters transactions with CreationDate _before_ this date
      # - +AfterDate+ (timestamp): filters transactions with CreationDate _after_ this date
      # See https://docs.mangopay.com/api-references/sort-lists/
      def fetch(wallet_id, filters={})
        MangoPay.request(:get, url(wallet_id), {}, filters)
      end

      def url(wallet_id)
        "#{MangoPay.api_path}/wallets/#{CGI.escape(wallet_id.to_s)}/transactions"
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
mangopay-3.2.0 lib/mangopay/transaction.rb
mangopay-3.1.0 lib/mangopay/transaction.rb
mangopay-3.0.38 lib/mangopay/transaction.rb
mangopay-3.0.37 lib/mangopay/transaction.rb
mangopay-3.0.36 lib/mangopay/transaction.rb
mangopay-3.0.35 lib/mangopay/transaction.rb
mangopay-3.0.34 lib/mangopay/transaction.rb
mangopay-3.0.33 lib/mangopay/transaction.rb
mangopay-3.0.32 lib/mangopay/transaction.rb
mangopay-3.0.31 lib/mangopay/transaction.rb
mangopay-3.0.30.1 lib/mangopay/transaction.rb
mangopay-3.0.30 lib/mangopay/transaction.rb
mangopay-3.0.29 lib/mangopay/transaction.rb
mangopay-3.0.28 lib/mangopay/transaction.rb
mangopay-3.0.27 lib/mangopay/transaction.rb
mangopay-3.0.26 lib/mangopay/transaction.rb
mangopay-3.0.25.pre.alpha.pre.20 lib/mangopay/transaction.rb