mangopay 3.0.14 → 3.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +6 -6
- data/lib/mangopay/kyc_document.rb +9 -6
- data/lib/mangopay/version.rb +1 -1
- data/spec/mangopay/kyc_document_spec.png +0 -0
- data/spec/mangopay/kyc_document_spec.rb +8 -6
- data/spec/mangopay/shared_resources.rb +2 -2
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac1062d37ee591f7ab222dd843d085d1906f0769
|
4
|
+
data.tar.gz: fedb8bffa95b81821d9914204dfd05830da60572
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e48ebdaafab57a94efd1f40d676acb0e5612af28607ab718a444cfb20476fa8029832e172b6b1469a3398abe2c172b67914f11012c008f5baf9c7da3270a9055
|
7
|
+
data.tar.gz: dc0e9578c6b88670d631227ceabcebc436f9ce8d0ce6caaafe05c2c5ad34a0a06561e0e3234cc0710997e1ef0c936c156bf02001c55508ba187b6a1bde89c203
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# Mangopay Ruby SDK
|
2
2
|
|
3
|
-
The gem for interacting with the version 2 of the
|
3
|
+
The gem for interacting with the version 2 of the Mangopay API.
|
4
4
|
See the [API documentation](http://docs.mangopay.com/api-references/)
|
5
5
|
for more details on the API.
|
6
6
|
|
@@ -10,7 +10,7 @@ Tested on the following versions of Ruby: 1.9.2, 1.9.3, 2.0.0
|
|
10
10
|
|
11
11
|
### Version 3.*
|
12
12
|
** BREAKING CHANGES **
|
13
|
-
This version (3.*) of the gem is targeting the
|
13
|
+
This version (3.*) of the gem is targeting the Mangopay API Version 2.
|
14
14
|
It has a brand new structure to make the api calls easier to use
|
15
15
|
and is not backward compatible with 2.* series.
|
16
16
|
|
@@ -21,11 +21,11 @@ and is not backward compatible with 2.* series.
|
|
21
21
|
or by adding it to your Gemfile ```gem 'mangopay'```
|
22
22
|
|
23
23
|
* The Rails users will be happy to know that there is a new generator script
|
24
|
-
that will help you configure your access to the
|
24
|
+
that will help you configure your access to the Mangopay API version 2.
|
25
25
|
Simply run ``rails generate mangopay:install CLIENT_ID CLIENT_NAME CLIENT_EMAIL``
|
26
26
|
where CLIENT_ID is the id you will use to connect to the api
|
27
27
|
and CLIENT_NAME is a full name that will be use to identify all communications
|
28
|
-
between you and the
|
28
|
+
between you and the Mangopay Team.
|
29
29
|
|
30
30
|
* Otherwise, call ```MangoPay.configure``` in your script as shown in the snippet below.
|
31
31
|
|
@@ -86,7 +86,7 @@ end
|
|
86
86
|
Make sure that you have run: ```bundle install```
|
87
87
|
Then you just have to run rspec ```rspec``` to run all the test suite.
|
88
88
|
Feel free to report any test failure by creating an issue
|
89
|
-
on the [Gem's Github](https://github.com/
|
89
|
+
on the [Gem's Github](https://github.com/Mangopay/mangopay2-ruby-sdk/issues)
|
90
90
|
|
91
91
|
## Contributing
|
92
92
|
|
@@ -40,15 +40,18 @@ module MangoPay
|
|
40
40
|
# - You can create as many pages as needed
|
41
41
|
# - Change Status to 'VALIDATION_ASKED' to submit KYC documents
|
42
42
|
#
|
43
|
-
# The
|
44
|
-
# -
|
45
|
-
# - or
|
43
|
+
# The file_content_base64 param may be:
|
44
|
+
# - Base64 encoded file content
|
45
|
+
# - or nil: in this case pass the file path in the next param
|
46
46
|
#
|
47
|
-
def create_page(user_id, document_id,
|
48
|
-
|
47
|
+
def create_page(user_id, document_id, file_content_base64, file_path = nil)
|
48
|
+
if file_content_base64.nil? && !file_path.nil?
|
49
|
+
bts = File.open(file_path, 'rb') { |f| f.read }
|
50
|
+
file_content_base64 = Base64.encode64(bts)
|
51
|
+
end
|
49
52
|
# normally it returns 204 HTTP code on success
|
50
53
|
begin
|
51
|
-
MangoPay.request(:post, url(user_id, document_id) + '/pages', {'File' =>
|
54
|
+
MangoPay.request(:post, url(user_id, document_id) + '/pages', {'File' => file_content_base64})
|
52
55
|
rescue ResponseError => ex
|
53
56
|
raise ex unless ex.code == '204'
|
54
57
|
end
|
data/lib/mangopay/version.rb
CHANGED
Binary file
|
@@ -72,15 +72,17 @@ describe MangoPay::KycDocument do
|
|
72
72
|
MangoPay::KycDocument.create_page(new_natural_user['Id'], new_document['Id'], file)
|
73
73
|
end
|
74
74
|
|
75
|
-
it 'accepts
|
76
|
-
|
77
|
-
|
75
|
+
it 'accepts Base64 encoded file content' do
|
76
|
+
fnm = __FILE__.sub('.rb', '.png')
|
77
|
+
bts = File.open(fnm, 'rb') { |f| f.read }
|
78
|
+
b64 = Base64.encode64(bts)
|
79
|
+
ret = create_page(b64)
|
78
80
|
expect(ret).to be_nil
|
79
81
|
end
|
80
82
|
|
81
|
-
it 'accepts
|
82
|
-
|
83
|
-
ret = create_page(
|
83
|
+
it 'accepts file path' do
|
84
|
+
fnm = __FILE__.sub('.rb', '.png')
|
85
|
+
ret = MangoPay::KycDocument.create_page(new_natural_user['Id'], new_document['Id'], nil, fnm)
|
84
86
|
expect(ret).to be_nil
|
85
87
|
end
|
86
88
|
|
@@ -192,7 +192,7 @@ shared_context 'payins' do
|
|
192
192
|
data: cardreg['PreregistrationData'],
|
193
193
|
accessKeyRef: cardreg['AccessKey'],
|
194
194
|
cardNumber: 4970100000000154,
|
195
|
-
cardExpirationDate:
|
195
|
+
cardExpirationDate: 1218,
|
196
196
|
cardCvx: 123}
|
197
197
|
res = Net::HTTP.post_form(URI(cardreg['CardRegistrationURL']), data)
|
198
198
|
raise Exception, [res, res.body] unless (res.is_a?(Net::HTTPOK) && res.body.start_with?('data='))
|
@@ -307,7 +307,7 @@ shared_context 'transfers' do
|
|
307
307
|
CreditedUserId: to_wallet['Owners'][0],
|
308
308
|
CreditedWalletId: to_wallet['Id'],
|
309
309
|
DebitedFunds: { Currency: 'EUR', Amount: amnt},
|
310
|
-
Fees: { Currency: 'EUR',
|
310
|
+
Fees: { Currency: 'EUR', Amount: 0},
|
311
311
|
Tag: 'Test transfer'
|
312
312
|
})
|
313
313
|
end
|
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.
|
4
|
+
version: 3.0.15
|
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:
|
12
|
+
date: 2015-05-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: multi_json
|
@@ -105,6 +105,7 @@ files:
|
|
105
105
|
- spec/mangopay/event_spec.rb
|
106
106
|
- spec/mangopay/fetch_filters_spec.rb
|
107
107
|
- spec/mangopay/hook_spec.rb
|
108
|
+
- spec/mangopay/kyc_document_spec.png
|
108
109
|
- spec/mangopay/kyc_document_spec.rb
|
109
110
|
- spec/mangopay/payin_bankwire_direct_spec.rb
|
110
111
|
- spec/mangopay/payin_card_direct_spec.rb
|
@@ -155,6 +156,7 @@ test_files:
|
|
155
156
|
- spec/mangopay/event_spec.rb
|
156
157
|
- spec/mangopay/fetch_filters_spec.rb
|
157
158
|
- spec/mangopay/hook_spec.rb
|
159
|
+
- spec/mangopay/kyc_document_spec.png
|
158
160
|
- spec/mangopay/kyc_document_spec.rb
|
159
161
|
- spec/mangopay/payin_bankwire_direct_spec.rb
|
160
162
|
- spec/mangopay/payin_card_direct_spec.rb
|