mangopay 3.0.0 → 3.0.1
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/.gitignore +26 -24
- data/.rspec +2 -2
- data/Gemfile +2 -2
- data/LICENSE +20 -20
- data/README.md +67 -67
- data/bin/mangopay +9 -9
- data/lib/generators/mangopay/install_generator.rb +60 -60
- data/lib/generators/templates/mangopay.rb +5 -5
- data/lib/mangopay.rb +118 -115
- data/lib/mangopay/bank_account.rb +21 -21
- data/lib/mangopay/card.rb +5 -0
- data/lib/mangopay/card_registration.rb +7 -0
- data/lib/mangopay/client.rb +17 -17
- data/lib/mangopay/errors.rb +4 -4
- data/lib/mangopay/http_calls.rb +53 -53
- data/lib/mangopay/json.rb +21 -21
- data/lib/mangopay/legal_user.rb +14 -14
- data/lib/mangopay/natural_user.rb +14 -14
- data/lib/mangopay/payin.rb +27 -17
- data/lib/mangopay/payout.rb +15 -15
- data/lib/mangopay/resource.rb +22 -22
- data/lib/mangopay/transaction.rb +11 -11
- data/lib/mangopay/transfer.rb +7 -7
- data/lib/mangopay/user.rb +7 -7
- data/lib/mangopay/version.rb +3 -3
- data/lib/mangopay/wallet.rb +7 -7
- data/mangopay.gemspec +33 -33
- data/spec/lib/mangopay/bank_account_spec.rb +26 -26
- data/spec/lib/mangopay/card_registration_spec.rb +40 -0
- data/spec/lib/mangopay/card_spec.rb +35 -0
- data/spec/lib/mangopay/client_spec.rb +28 -27
- data/spec/lib/mangopay/payin_spec.rb +34 -31
- data/spec/lib/mangopay/payout_spec.rb +34 -24
- data/spec/lib/mangopay/shared_resources.rb +193 -183
- data/spec/lib/mangopay/transaction_spec.rb +14 -14
- data/spec/lib/mangopay/transfer_spec.rb +35 -32
- data/spec/lib/mangopay/user_spec.rb +58 -58
- data/spec/lib/mangopay/wallet_spec.rb +32 -32
- data/spec/spec_helper.rb +13 -13
- metadata +8 -2
@@ -1,14 +1,14 @@
|
|
1
|
-
require_relative '../../spec_helper'
|
2
|
-
|
3
|
-
describe MangoPay::Transaction do
|
4
|
-
include_context 'users'
|
5
|
-
include_context 'wallets'
|
6
|
-
|
7
|
-
describe 'FETCH' do
|
8
|
-
it 'fetches the an empty list of transactions' do
|
9
|
-
transactions = MangoPay::Transaction.fetch(new_wallet['Id'])
|
10
|
-
expect(transactions).to be_kind_of(Array)
|
11
|
-
expect(transactions).to be_empty
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
1
|
+
require_relative '../../spec_helper'
|
2
|
+
|
3
|
+
describe MangoPay::Transaction do
|
4
|
+
include_context 'users'
|
5
|
+
include_context 'wallets'
|
6
|
+
|
7
|
+
describe 'FETCH' do
|
8
|
+
it 'fetches the an empty list of transactions' do
|
9
|
+
transactions = MangoPay::Transaction.fetch(new_wallet['Id'])
|
10
|
+
expect(transactions).to be_kind_of(Array)
|
11
|
+
expect(transactions).to be_empty
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -1,32 +1,35 @@
|
|
1
|
-
require_relative '../../spec_helper'
|
2
|
-
|
3
|
-
describe MangoPay::Transfer, type: :feature do
|
4
|
-
include_context 'users'
|
5
|
-
include_context 'wallets'
|
6
|
-
include_context 'transfer'
|
7
|
-
|
8
|
-
describe 'CREATE' do
|
9
|
-
it 'creates a new Transfer' do
|
10
|
-
expect(new_transfer['Id']).not_to be_nil
|
11
|
-
expect(new_transfer['Status']).to eq('SUCCEEDED')
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
expect(
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
1
|
+
require_relative '../../spec_helper'
|
2
|
+
|
3
|
+
describe MangoPay::Transfer, type: :feature do
|
4
|
+
include_context 'users'
|
5
|
+
include_context 'wallets'
|
6
|
+
include_context 'transfer'
|
7
|
+
|
8
|
+
describe 'CREATE' do
|
9
|
+
it 'creates a new Transfer' do
|
10
|
+
expect(new_transfer['Id']).not_to be_nil
|
11
|
+
#expect(new_transfer['Status']).to eq('SUCCEEDED') # cannot test yet
|
12
|
+
expect(new_transfer['Status']).to eq('FAILED')
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
describe 'FETCH' do
|
17
|
+
it 'fetches a Transfer' do
|
18
|
+
transfer = MangoPay::Transfer.fetch(new_transfer['Id'])
|
19
|
+
expect(transfer['Id']).to eq(new_transfer['Id'])
|
20
|
+
#expect(new_transfer['Status']).to eq('SUCCEEDED') # cannot test yet
|
21
|
+
expect(new_transfer['Status']).to eq('FAILED')
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
describe 'REFUND' do
|
26
|
+
it 'refunds a transfer' do
|
27
|
+
transfer_refund = MangoPay::Transfer.refund(new_transfer['Id'], {
|
28
|
+
AuthorId: new_transfer['AuthorId']
|
29
|
+
})
|
30
|
+
expect(transfer_refund['Id']).not_to be_nil
|
31
|
+
#expect(transfer_refund['Status']).to eq('SUCCEEDED') # cannot test yet
|
32
|
+
expect(transfer_refund['Status']).to be_nil
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -1,58 +1,58 @@
|
|
1
|
-
require_relative '../../spec_helper'
|
2
|
-
|
3
|
-
describe MangoPay::User do
|
4
|
-
include_context 'users'
|
5
|
-
|
6
|
-
describe 'CREATE' do
|
7
|
-
it 'creates a new natural user' do
|
8
|
-
expect(new_natural_user["FirstName"]).to eq('John')
|
9
|
-
end
|
10
|
-
|
11
|
-
it 'creates a new legal user' do
|
12
|
-
expect(new_legal_user["LegalRepresentativeFirstName"]).to eq('John')
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
describe 'UPDATE' do
|
17
|
-
it 'updates a natural user' do
|
18
|
-
updated_user = MangoPay::NaturalUser.update(new_natural_user['Id'] ,{
|
19
|
-
FirstName: 'Jack'
|
20
|
-
})
|
21
|
-
expect(updated_user['FirstName']).to eq('Jack')
|
22
|
-
end
|
23
|
-
|
24
|
-
it 'updates a legal user' do
|
25
|
-
updated_user = MangoPay::LegalUser.update(new_legal_user['Id'], {
|
26
|
-
LegalRepresentativeFirstName: 'Jack'
|
27
|
-
})
|
28
|
-
expect(updated_user['LegalRepresentativeFirstName']).to eq('Jack')
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
describe 'FETCH' do
|
33
|
-
it 'fetches all the users' do
|
34
|
-
users = MangoPay::User.fetch()
|
35
|
-
expect(users).to be_kind_of(Array)
|
36
|
-
end
|
37
|
-
|
38
|
-
it 'fetches a legal user using the User module' do
|
39
|
-
legal_user = MangoPay::User.fetch(new_legal_user['Id'])
|
40
|
-
expect(legal_user['Id']).to eq(new_legal_user['Id'])
|
41
|
-
end
|
42
|
-
|
43
|
-
it 'fetches a natural user using the User module' do
|
44
|
-
natural_user = MangoPay::User.fetch(new_natural_user['Id'])
|
45
|
-
expect(natural_user['Id']).to eq(new_natural_user['Id'])
|
46
|
-
end
|
47
|
-
|
48
|
-
it 'fetches a legal user' do
|
49
|
-
user = MangoPay::LegalUser.fetch(new_legal_user['Id'])
|
50
|
-
expect(user['Id']).to eq(new_legal_user['Id'])
|
51
|
-
end
|
52
|
-
|
53
|
-
it 'fetches a natural user' do
|
54
|
-
user = MangoPay::NaturalUser.fetch(new_natural_user['Id'])
|
55
|
-
expect(user['Id']).to eq(new_natural_user['Id'])
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
1
|
+
require_relative '../../spec_helper'
|
2
|
+
|
3
|
+
describe MangoPay::User do
|
4
|
+
include_context 'users'
|
5
|
+
|
6
|
+
describe 'CREATE' do
|
7
|
+
it 'creates a new natural user' do
|
8
|
+
expect(new_natural_user["FirstName"]).to eq('John')
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'creates a new legal user' do
|
12
|
+
expect(new_legal_user["LegalRepresentativeFirstName"]).to eq('John')
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
describe 'UPDATE' do
|
17
|
+
it 'updates a natural user' do
|
18
|
+
updated_user = MangoPay::NaturalUser.update(new_natural_user['Id'] ,{
|
19
|
+
FirstName: 'Jack'
|
20
|
+
})
|
21
|
+
expect(updated_user['FirstName']).to eq('Jack')
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'updates a legal user' do
|
25
|
+
updated_user = MangoPay::LegalUser.update(new_legal_user['Id'], {
|
26
|
+
LegalRepresentativeFirstName: 'Jack'
|
27
|
+
})
|
28
|
+
expect(updated_user['LegalRepresentativeFirstName']).to eq('Jack')
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
describe 'FETCH' do
|
33
|
+
it 'fetches all the users' do
|
34
|
+
users = MangoPay::User.fetch()
|
35
|
+
expect(users).to be_kind_of(Array)
|
36
|
+
end
|
37
|
+
|
38
|
+
it 'fetches a legal user using the User module' do
|
39
|
+
legal_user = MangoPay::User.fetch(new_legal_user['Id'])
|
40
|
+
expect(legal_user['Id']).to eq(new_legal_user['Id'])
|
41
|
+
end
|
42
|
+
|
43
|
+
it 'fetches a natural user using the User module' do
|
44
|
+
natural_user = MangoPay::User.fetch(new_natural_user['Id'])
|
45
|
+
expect(natural_user['Id']).to eq(new_natural_user['Id'])
|
46
|
+
end
|
47
|
+
|
48
|
+
it 'fetches a legal user' do
|
49
|
+
user = MangoPay::LegalUser.fetch(new_legal_user['Id'])
|
50
|
+
expect(user['Id']).to eq(new_legal_user['Id'])
|
51
|
+
end
|
52
|
+
|
53
|
+
it 'fetches a natural user' do
|
54
|
+
user = MangoPay::NaturalUser.fetch(new_natural_user['Id'])
|
55
|
+
expect(user['Id']).to eq(new_natural_user['Id'])
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
@@ -1,32 +1,32 @@
|
|
1
|
-
require_relative '../../spec_helper'
|
2
|
-
|
3
|
-
describe MangoPay::Wallet do
|
4
|
-
include_context 'users'
|
5
|
-
include_context 'wallets'
|
6
|
-
|
7
|
-
describe 'CREATE' do
|
8
|
-
it 'creates a wallet' do
|
9
|
-
expect(new_wallet['Id']).to_not be_nil
|
10
|
-
expect(new_wallet['Balance']['Currency']).to eq('EUR')
|
11
|
-
expect(new_wallet['Balance']['Amount']).to eq(0)
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
describe 'UPDATE' do
|
16
|
-
it 'updates a wallet' do
|
17
|
-
updated_wallet = MangoPay::Wallet.update(new_wallet['Id'], {
|
18
|
-
Description: 'Updated Description',
|
19
|
-
Tag: 'Updated Tag'
|
20
|
-
})
|
21
|
-
expect(updated_wallet['Description']).to eq('Updated Description')
|
22
|
-
expect(updated_wallet['Tag']).to eq('Updated Tag')
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
describe 'FETCH' do
|
27
|
-
it 'fetches a wallet' do
|
28
|
-
wallet = MangoPay::Wallet.fetch(new_wallet['Id'])
|
29
|
-
expect(wallet['Id']).to eq(new_wallet['Id'])
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
1
|
+
require_relative '../../spec_helper'
|
2
|
+
|
3
|
+
describe MangoPay::Wallet do
|
4
|
+
include_context 'users'
|
5
|
+
include_context 'wallets'
|
6
|
+
|
7
|
+
describe 'CREATE' do
|
8
|
+
it 'creates a wallet' do
|
9
|
+
expect(new_wallet['Id']).to_not be_nil
|
10
|
+
expect(new_wallet['Balance']['Currency']).to eq('EUR')
|
11
|
+
expect(new_wallet['Balance']['Amount']).to eq(0)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
describe 'UPDATE' do
|
16
|
+
it 'updates a wallet' do
|
17
|
+
updated_wallet = MangoPay::Wallet.update(new_wallet['Id'], {
|
18
|
+
Description: 'Updated Description',
|
19
|
+
Tag: 'Updated Tag'
|
20
|
+
})
|
21
|
+
expect(updated_wallet['Description']).to eq('Updated Description')
|
22
|
+
expect(updated_wallet['Tag']).to eq('Updated Tag')
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
describe 'FETCH' do
|
27
|
+
it 'fetches a wallet' do
|
28
|
+
wallet = MangoPay::Wallet.fetch(new_wallet['Id'])
|
29
|
+
expect(wallet['Id']).to eq(new_wallet['Id'])
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,13 +1,13 @@
|
|
1
|
-
require_relative '../lib/mangopay'
|
2
|
-
require_relative './lib/mangopay/shared_resources'
|
3
|
-
|
4
|
-
require 'capybara/rspec'
|
5
|
-
require 'capybara-webkit'
|
6
|
-
|
7
|
-
Capybara.default_driver = :webkit
|
8
|
-
|
9
|
-
MangoPay.configure do |c|
|
10
|
-
c.preproduction = true
|
11
|
-
c.client_id = 'example'
|
12
|
-
c.client_passphrase = 'uyWsmnwMQyTnqKgi8Y35A3eVB7bGhqrebYqA1tL6x2vYNpGPiY'
|
13
|
-
end
|
1
|
+
require_relative '../lib/mangopay'
|
2
|
+
require_relative './lib/mangopay/shared_resources'
|
3
|
+
|
4
|
+
require 'capybara/rspec'
|
5
|
+
require 'capybara-webkit'
|
6
|
+
|
7
|
+
Capybara.default_driver = :webkit
|
8
|
+
|
9
|
+
MangoPay.configure do |c|
|
10
|
+
c.preproduction = true
|
11
|
+
c.client_id = 'example'
|
12
|
+
c.client_passphrase = 'uyWsmnwMQyTnqKgi8Y35A3eVB7bGhqrebYqA1tL6x2vYNpGPiY'
|
13
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Geoffroy Lorieux
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|
@@ -114,6 +114,8 @@ files:
|
|
114
114
|
- lib/generators/templates/mangopay.rb
|
115
115
|
- lib/mangopay.rb
|
116
116
|
- lib/mangopay/bank_account.rb
|
117
|
+
- lib/mangopay/card.rb
|
118
|
+
- lib/mangopay/card_registration.rb
|
117
119
|
- lib/mangopay/client.rb
|
118
120
|
- lib/mangopay/errors.rb
|
119
121
|
- lib/mangopay/http_calls.rb
|
@@ -130,6 +132,8 @@ files:
|
|
130
132
|
- lib/mangopay/wallet.rb
|
131
133
|
- mangopay.gemspec
|
132
134
|
- spec/lib/mangopay/bank_account_spec.rb
|
135
|
+
- spec/lib/mangopay/card_registration_spec.rb
|
136
|
+
- spec/lib/mangopay/card_spec.rb
|
133
137
|
- spec/lib/mangopay/client_spec.rb
|
134
138
|
- spec/lib/mangopay/payin_spec.rb
|
135
139
|
- spec/lib/mangopay/payout_spec.rb
|
@@ -165,6 +169,8 @@ specification_version: 4
|
|
165
169
|
summary: Ruby bindings for the version 2 of the MangoPay API
|
166
170
|
test_files:
|
167
171
|
- spec/lib/mangopay/bank_account_spec.rb
|
172
|
+
- spec/lib/mangopay/card_registration_spec.rb
|
173
|
+
- spec/lib/mangopay/card_spec.rb
|
168
174
|
- spec/lib/mangopay/client_spec.rb
|
169
175
|
- spec/lib/mangopay/payin_spec.rb
|
170
176
|
- spec/lib/mangopay/payout_spec.rb
|