leetchi-wallet-services 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/leetchi/ressource.rb +3 -3
- data/spec/lib/leetchi/card_spec.rb +1 -1
- data/spec/lib/leetchi/immediate_contribution_spec.rb +17 -16
- data/spec/lib/leetchi/strong_authentication_spec.rb +31 -6
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9cda21312c1cdba35005835d50eed4c537a736c9
|
4
|
+
data.tar.gz: 70572b3a012f697ebba5c07d0a94ded826998954
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75cc9b947b8eb9ca55ecb2cb4633084a67cf0094393dac983ec9b750d238b911cf06e937c47b79955edd65d9caaabf97cb84dc4b5dd60f16c0238db2eb8e162b
|
7
|
+
data.tar.gz: 03ebe19bae37fa4487a165f94cbb67c36c9fa70ebf69b47958229f7b92738d46e197d3454da39e36a96c3579a8df01ce9ade9c6dbe408e8b332580901996b1bc
|
data/README.md
CHANGED
data/lib/leetchi/ressource.rb
CHANGED
@@ -22,12 +22,12 @@ module Leetchi
|
|
22
22
|
def self.form_request(upload_url, file_name, file_path)
|
23
23
|
url = URI(upload_url)
|
24
24
|
File.open(file_path) do |file|
|
25
|
-
req = Net::HTTP::Post::Multipart.new(url, :file => UploadIO.new(
|
25
|
+
req = Net::HTTP::Post::Multipart.new(url.request_uri, :file => UploadIO.new(file, file_type(file_path), file_name))
|
26
26
|
res = Net::HTTP.start(url.host, url.port, :use_ssl => url.scheme == 'https') do |http|
|
27
27
|
http.request(req)
|
28
28
|
end
|
29
29
|
res.code == "200" ? true : false
|
30
|
-
end
|
30
|
+
end
|
31
31
|
end
|
32
32
|
|
33
33
|
private
|
@@ -89,7 +89,7 @@ module Leetchi
|
|
89
89
|
'png' => 'image/png',
|
90
90
|
'pdf' => 'image/pdf'
|
91
91
|
}
|
92
|
-
file_types[file_path.
|
92
|
+
file_types[file_path.gsub(/^[^\.]+\./, "")]
|
93
93
|
end
|
94
94
|
end
|
95
95
|
end
|
@@ -23,7 +23,7 @@ describe Leetchi::Card, :type => :feature do
|
|
23
23
|
fill_in('cvv', :with => '123')
|
24
24
|
click_button('paybutton')
|
25
25
|
card = Leetchi::Card.details(card['ID'])
|
26
|
-
while card["
|
26
|
+
while (card["CardNumber"] || []).length != 16 do
|
27
27
|
card = Leetchi::Card.details(card['ID'])
|
28
28
|
end
|
29
29
|
card
|
@@ -12,28 +12,28 @@ describe Leetchi::ImmediateContribution, :type => :feature do
|
|
12
12
|
})
|
13
13
|
}
|
14
14
|
|
15
|
-
let(:
|
16
|
-
|
17
|
-
'Tag' => '
|
18
|
-
'
|
19
|
-
'
|
20
|
-
'Amount' => 10000,
|
21
|
-
'ReturnURL' => 'https://leetchi.com',
|
22
|
-
'RegisterMeanOfPayment' => true
|
15
|
+
let(:new_card) do
|
16
|
+
card = Leetchi::Card.create({
|
17
|
+
'Tag' => 'test-card',
|
18
|
+
'OwnerID' => new_user['ID'],
|
19
|
+
'ReturnURL' => 'http://leetchi.com'
|
23
20
|
})
|
24
|
-
visit(
|
21
|
+
visit(card['RedirectURL'])
|
25
22
|
fill_in('number', :with => '4970100000000154')
|
26
23
|
fill_in('cvv', :with => '123')
|
27
24
|
click_button('paybutton')
|
28
|
-
|
29
|
-
while
|
30
|
-
|
25
|
+
card = Leetchi::Card.details(card['ID'])
|
26
|
+
while (card["CardNumber"] || []).length != 16 do
|
27
|
+
card = Leetchi::Card.details(card['ID'])
|
31
28
|
end
|
32
|
-
|
33
|
-
|
29
|
+
card
|
30
|
+
end
|
31
|
+
|
32
|
+
let(:new_immediate_contribution) do
|
33
|
+
c = Leetchi::ImmediateContribution.create({
|
34
34
|
'Tag' => 'test_contribution',
|
35
35
|
'UserID' => new_user['ID'],
|
36
|
-
'PaymentCardID' =>
|
36
|
+
'PaymentCardID' => new_card['ID'],
|
37
37
|
'WalletID' => 0,
|
38
38
|
'Amount' => 33300
|
39
39
|
})
|
@@ -52,7 +52,7 @@ describe Leetchi::ImmediateContribution, :type => :feature do
|
|
52
52
|
expect(new_immediate_contribution['ID']).not_to be_nil
|
53
53
|
end
|
54
54
|
end
|
55
|
-
|
55
|
+
|
56
56
|
describe "GET" do
|
57
57
|
it "get the immediate contribution" do
|
58
58
|
immediate_contribution = Leetchi::ImmediateContribution.details(new_immediate_contribution['ID'])
|
@@ -69,4 +69,5 @@ describe Leetchi::ImmediateContribution, :type => :feature do
|
|
69
69
|
expect(immediate_contribution_refund['ID']).to eq(new_immediate_contribution_refund['ID'])
|
70
70
|
end
|
71
71
|
end
|
72
|
+
|
72
73
|
end
|
@@ -23,12 +23,18 @@ describe Leetchi::StrongAuthentication do
|
|
23
23
|
})
|
24
24
|
}
|
25
25
|
|
26
|
-
let(:
|
26
|
+
let(:new_strong_beneficiary_authentication) {
|
27
27
|
Leetchi::Beneficiary.create_strong_authentication(new_beneficiary['ID'], {
|
28
28
|
'Tag' => 'test_beneficiary_strong_authentication'
|
29
29
|
})
|
30
30
|
}
|
31
31
|
|
32
|
+
let(:new_strong_user_authentication) {
|
33
|
+
Leetchi::User.create_strong_authentication(new_user['ID'], {
|
34
|
+
'Tag' => 'test_user_strong_authentication'
|
35
|
+
})
|
36
|
+
}
|
37
|
+
|
32
38
|
describe "GET" do
|
33
39
|
it "get the pending strong authentication requests" do
|
34
40
|
strong_authentication = Leetchi::StrongAuthentication.get
|
@@ -36,22 +42,41 @@ describe Leetchi::StrongAuthentication do
|
|
36
42
|
end
|
37
43
|
end
|
38
44
|
|
39
|
-
describe "UPLOAD" do
|
45
|
+
describe "UPLOAD BENEFICIARY" do
|
40
46
|
it "uploads a PDF file to complete a beneficiary strong authentication request" do
|
41
|
-
document_upload = Leetchi::StrongAuthentication.upload(
|
47
|
+
document_upload = Leetchi::StrongAuthentication.upload(new_strong_beneficiary_authentication['UrlRequest'], 'spec/support-files/test_upload.pdf')
|
42
48
|
expect(document_upload).to be_true
|
43
49
|
end
|
44
50
|
it "uploads a JPG file to complete a beneficiary strong authentication request" do
|
45
|
-
document_upload = Leetchi::StrongAuthentication.upload(
|
51
|
+
document_upload = Leetchi::StrongAuthentication.upload(new_strong_beneficiary_authentication['UrlRequest'], 'spec/support-files/test_upload.jpg')
|
46
52
|
expect(document_upload).to be_true
|
47
53
|
end
|
48
54
|
it "uploads a PNG file to complete a beneficiary strong authentication request" do
|
49
|
-
document_upload = Leetchi::StrongAuthentication.upload(
|
55
|
+
document_upload = Leetchi::StrongAuthentication.upload(new_strong_beneficiary_authentication['UrlRequest'], 'spec/support-files/test_upload.png')
|
50
56
|
expect(document_upload).to be_true
|
51
57
|
end
|
52
58
|
it "uploads a GIF file to complete a beneficiary strong authentication request" do
|
53
|
-
document_upload = Leetchi::StrongAuthentication.upload(
|
59
|
+
document_upload = Leetchi::StrongAuthentication.upload(new_strong_beneficiary_authentication['UrlRequest'], 'spec/support-files/test_upload.gif')
|
54
60
|
expect(document_upload).to be_true
|
55
61
|
end
|
56
62
|
end
|
63
|
+
|
64
|
+
describe "UPLOAD USER" do
|
65
|
+
it "uploads a PDF file to complete a user strong authentication request" do
|
66
|
+
document_upload = Leetchi::StrongAuthentication.upload(new_strong_user_authentication['UrlRequest'], 'spec/support-files/test_upload.pdf')
|
67
|
+
expect(document_upload).to be_true
|
68
|
+
end
|
69
|
+
it "uploads a JPG file to complete a user strong authentication request" do
|
70
|
+
document_upload = Leetchi::StrongAuthentication.upload(new_strong_user_authentication['UrlRequest'], 'spec/support-files/test_upload.jpg')
|
71
|
+
expect(document_upload).to be_true
|
72
|
+
end
|
73
|
+
it "uploads a PNG file to complete a user strong authentication request" do
|
74
|
+
document_upload = Leetchi::StrongAuthentication.upload(new_strong_user_authentication['UrlRequest'], 'spec/support-files/test_upload.png')
|
75
|
+
expect(document_upload).to be_true
|
76
|
+
end
|
77
|
+
it "uploads a GIF file to complete a user strong authentication request" do
|
78
|
+
document_upload = Leetchi::StrongAuthentication.upload(new_strong_user_authentication['UrlRequest'], 'spec/support-files/test_upload.gif')
|
79
|
+
expect(document_upload).to be_true
|
80
|
+
end
|
81
|
+
end
|
57
82
|
end
|
metadata
CHANGED
@@ -1,15 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: leetchi-wallet-services
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Geoffroy Lorieux
|
8
8
|
- Vincent Cogne
|
9
|
+
- Eric Larch
|
9
10
|
autorequire:
|
10
11
|
bindir: bin
|
11
12
|
cert_chain: []
|
12
|
-
date: 2013-06-
|
13
|
+
date: 2013-06-24 00:00:00.000000000 Z
|
13
14
|
dependencies:
|
14
15
|
- !ruby/object:Gem::Dependency
|
15
16
|
name: json
|
@@ -194,7 +195,8 @@ files:
|
|
194
195
|
- spec/support-files/test_upload.pdf
|
195
196
|
- spec/support-files/test_upload.png
|
196
197
|
homepage: http://www.mangopay.com/
|
197
|
-
licenses:
|
198
|
+
licenses:
|
199
|
+
- MIT
|
198
200
|
metadata: {}
|
199
201
|
post_install_message:
|
200
202
|
rdoc_options: []
|