Sha256: d47cfc892bdb4236e9d1e9599326e8ecd61c6233158083bf9982bd138aecdcfb

Contents?: true

Size: 1.3 KB

Versions: 2

Compression:

Stored size: 1.3 KB

Contents

module MangoPay
  class User < Resource
    include MangoPay::HTTPCalls::Create
    include MangoPay::HTTPCalls::Update
    include MangoPay::HTTPCalls::Fetch

    # Fetches list of wallets belonging to the given +user_id+.
    # Optional +filters+ is a hash accepting following keys:
    # - +page+, +per_page+: pagination params (see MangoPay::HTTPCalls::Fetch::ClassMethods#fetch)
    # - other keys specific for transactions filtering (see MangoPay::Transaction.fetch)
    def self.wallets(user_id, filters={})
      MangoPay.request(:get, url(user_id) + '/wallets', {}, filters)
    end

    # Fetches list of cards belonging to the given +user_id+.
    # Optional +filters+ is a hash accepting following keys:
    # - +page+, +per_page+: pagination params (see MangoPay::HTTPCalls::Fetch::ClassMethods#fetch)
    def self.cards(user_id, filters={})
      MangoPay.request(:get, url(user_id) + '/cards', {}, filters)
    end

    # Fetches list of transactions belonging to the given +user_id+.
    # Optional +filters+ is a hash accepting following keys:
    # - +page+, +per_page+: pagination params (see MangoPay::HTTPCalls::Fetch::ClassMethods#fetch)
    def self.transactions(user_id, filters={})
      MangoPay.request(:get, url(user_id) + '/transactions', {}, filters)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mangopay-3.0.9 lib/mangopay/user.rb
mangopay-3.0.8 lib/mangopay/user.rb