mangopay 3.0.30 → 3.0.30.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6c038a492f0096820e24da22def17585dc1b5a13aa58eca6d18820bba16607bb
4
- data.tar.gz: db6237ec1d2c88f544e975d6edc0b13944a5fdb202089e08ce2984a56176f966
3
+ metadata.gz: 6346db992adff682f58586a8435d12bf7bb0ff9811927b4084c476264dc326d0
4
+ data.tar.gz: 9cb2ff496c327154aea0b02f5672efa697f2ee139730ec7710bbe481d068e353
5
5
  SHA512:
6
- metadata.gz: 63fe20ad687cfbb42d4e31f7d7cf0c65b66e87e82487489d0e4bfd45486e30e99360a6c0396dc38ec44f1a7a1652b5bdb8c423b88b586e30c556efb824c5d637
7
- data.tar.gz: c9f7cbe0843ccaf8153b2741d5da3587a3d6bf83f25884f342c1a60233b55101b0ed840c67214ceb3e7a48a4b31ee5bd08f455cf2317031aba63efa6a7c8887f
6
+ metadata.gz: 16c654da6df6533750d9d432139098596e281cd346634a75ff10106dbf90394e700b7d793fc3b48456a1766b616bd0e186a36390deafe4e4553ded25ebb28ae8
7
+ data.tar.gz: c0d2989975569aab32456edba096693bfc8f2f3aa2b376b44a37135686087d3390b083c0fa08a974078d653712f4917763854ffbea2d5cb61c1879510e1a5a30
data/lib/mangopay/user.rb CHANGED
@@ -46,6 +46,13 @@ module MangoPay
46
46
  def emoney(user_id, filters={})
47
47
  MangoPay.request(:get, url(user_id) + '/emoney', {}, filters)
48
48
  end
49
+
50
+ # Fetches list of kyc documents belonging to the given +user_id+.
51
+ # Optional +filters+ is a hash accepting following keys:
52
+ # - +page+, +per_page+, +sort+, +BeforeDate+, +AfterDate+, +Status+: pagination and sorting params (see MangoPay::HTTPCalls::Fetch::ClassMethods#fetch)
53
+ def kyc_documents(user_id, filters={})
54
+ MangoPay.request(:get, url(user_id) + '/KYC/documents', {}, filters)
55
+ end
49
56
  end
50
57
  end
51
58
  end
@@ -1,3 +1,3 @@
1
1
  module MangoPay
2
- VERSION = '3.0.30'
2
+ VERSION = '3.0.30.1'
3
3
  end
@@ -3,6 +3,7 @@ describe MangoPay::User do
3
3
  include_context 'payins'
4
4
  include_context 'payouts'
5
5
  include_context 'wallets'
6
+ include_context 'kyc_documents'
6
7
 
7
8
  describe 'CREATE' do
8
9
  it 'creates a new natural user' do
@@ -156,6 +157,22 @@ describe MangoPay::User do
156
157
  end
157
158
  end
158
159
 
160
+ describe 'FETCH Kyc Document' do
161
+ it 'fetches empty list of kyc documents if no kyc document created' do
162
+ documents = MangoPay::User.kyc_documents(new_natural_user['Id'])
163
+ expect(documents).to be_kind_of(Array)
164
+ expect(documents).to be_empty
165
+ end
166
+
167
+ it 'fetches list with single kyc document after created' do
168
+ document = new_document
169
+ documents = MangoPay::User.kyc_documents(document['UserId'])
170
+ expect(documents).to be_kind_of(Array)
171
+ expect(documents.count).to eq 1
172
+ expect(documents.first['Id']).to eq document['Id']
173
+ end
174
+ end
175
+
159
176
  describe 'CREATE UBO DECLARATION' do
160
177
  it 'creates a UBO declaration' do
161
178
  legal_user = new_legal_user
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mangopay
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.30
4
+ version: 3.0.30.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geoffroy Lorieux
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-12-26 00:00:00.000000000 Z
12
+ date: 2018-01-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: multi_json