Class: MangoPay::User

Inherits:
Resource show all
Includes:
HTTPCalls::Create, HTTPCalls::Fetch, HTTPCalls::Update
Defined in:
lib/mangopay/user.rb

Overview

See docs.mangopay.com/api-references/users/ See also children classes:

  • MangoPay::NaturalUser

  • MangoPay::LegalUser

  • MangoPay::NaturalUserSca

  • MangoPay::LegalUserSca

Direct Known Subclasses

LegalUser, LegalUserSca, NaturalUser, NaturalUserSca

Class Method Summary collapse

Methods included from HTTPCalls::Fetch

included, parse_id_or_filters

Methods included from HTTPCalls::Update

included

Methods included from HTTPCalls::Create

included

Methods inherited from Resource

class_name, url

Class Method Details

.bank_accounts(user_id, filters = {}) ⇒ Object

Fetches list of bank accounts belonging to the given user_id. Optional filters is a hash accepting following keys:

  • page, per_page, sort: pagination and sorting params

(see MangoPay::HTTPCalls::Fetch::ClassMethods#fetch)



31
32
33
# File 'lib/mangopay/user.rb', line 31

def bank_accounts(user_id, filters = {})
  MangoPay.request(:get, url(user_id) + '/bankaccounts', {}, filters)
end

.block_status(user_id, filters = {}) ⇒ Object

Fetches User Block Status



77
78
79
# File 'lib/mangopay/user.rb', line 77

def block_status(user_id, filters = {})
  MangoPay.request(:get, url(user_id) + '/blockStatus', {}, filters)
end

.cards(user_id, filters = {}) ⇒ Object

Fetches list of cards belonging to the given user_id. Optional filters is a hash accepting following keys:

  • page, per_page, sort: pagination and sorting params (see MangoPay::HTTPCalls::Fetch::ClassMethods#fetch)



38
39
40
# File 'lib/mangopay/user.rb', line 38

def cards(user_id, filters = {})
  MangoPay.request(:get, url(user_id) + '/cards', {}, filters)
end

.emoney(user_id, year, month = nil, filters = {}) ⇒ Object

View EMoney belonging to the given user_id. Optional filters is a hash accepting following keys:

  • page, per_page, sort: pagination and sorting params (see MangoPay::HTTPCalls::Fetch::ClassMethods#fetch)

  • other keys specific for transactions filtering (see MangoPay::Transaction#fetch)



54
55
56
57
58
59
60
# File 'lib/mangopay/user.rb', line 54

def emoney(user_id, year, month = nil, filters = {})
  if month
    MangoPay.request(:get, url(user_id) + "/emoney/#{year}/#{month}", {}, filters)
  else
    MangoPay.request(:get, url(user_id) + "/emoney/#{year}", {}, filters)
  end
end

.enroll_sca(user_id) ⇒ Object



14
15
16
17
# File 'lib/mangopay/user.rb', line 14

def enroll_sca(user_id)
  url = "#{MangoPay.api_path}/sca/users/#{user_id}/enrollment"
  MangoPay.request(:post, url, {}, {})
end

.fetch_sca(user_id) ⇒ Object



86
87
88
89
# File 'lib/mangopay/user.rb', line 86

def fetch_sca(user_id)
  url = "#{MangoPay.api_path}/sca/users/#{user_id}"
  MangoPay.request(:get, url, {}, {})
end

.kyc_documents(user_id, filters = {}) ⇒ Object

Fetches list of kyc documents belonging to the given user_id. Optional filters is a hash accepting following keys:

  • page, per_page, sort, BeforeDate, AfterDate, Status: pagination and sorting params (see MangoPay::HTTPCalls::Fetch::ClassMethods#fetch)



65
66
67
# File 'lib/mangopay/user.rb', line 65

def kyc_documents(user_id, filters = {})
  MangoPay.request(:get, url(user_id) + '/KYC/documents', {}, filters)
end

.pre_authorizations(user_id, filters = {}) ⇒ Object

Fetches list of pre-authorizations belonging to the given user_id. Optional filters is a hash accepting the following keys:

  • page, per_page, sort, Status, ResultCode, PaymentStatus: pagination and sorting/filtering params (see MangoPay::HTTPCalls::Fetch::ClassMethods#fetch)



72
73
74
# File 'lib/mangopay/user.rb', line 72

def pre_authorizations(user_id, filters = {})
  MangoPay.request(:get, url(user_id) + '/preauthorizations', {}, filters)
end

.regulatory(user_id, filters = {}) ⇒ Object

Fetches User Regulatory



82
83
84
# File 'lib/mangopay/user.rb', line 82

def regulatory(user_id, filters = {})
  MangoPay.request(:get, url(user_id) + '/Regulatory', {}, filters)
end

.transactions(user_id, filters = {}) ⇒ Object

Fetches list of transactions belonging to the given user_id. Optional filters is a hash accepting following keys:

  • page, per_page, sort: pagination and sorting params (see MangoPay::HTTPCalls::Fetch::ClassMethods#fetch)

  • other keys specific for transactions filtering (see MangoPay::Transaction#fetch)



46
47
48
# File 'lib/mangopay/user.rb', line 46

def transactions(user_id, filters = {})
  MangoPay.request(:get, url(user_id) + '/transactions', {}, filters)
end

.validate_data_format(params, idempotency_key = nil) ⇒ Object



91
92
93
# File 'lib/mangopay/user.rb', line 91

def validate_data_format(params, idempotency_key = nil)
  MangoPay.request(:post, "#{MangoPay.api_path}/users/data-formats/validation", params, {}, idempotency_key)
end

.wallets(user_id, filters = {}) ⇒ Object

Fetches list of wallets belonging to the given user_id. Optional filters is a hash accepting following keys:

  • page, per_page, sort: pagination and sorting params (see MangoPay::HTTPCalls::Fetch::ClassMethods#fetch)



23
24
25
# File 'lib/mangopay/user.rb', line 23

def wallets(user_id, filters = {})
  MangoPay.request(:get, url(user_id) + '/wallets', {}, filters)
end