mangopay 3.0.5 → 3.0.6

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
  SHA1:
3
- metadata.gz: c28334dab15cfdac4d4f1453a6fcddb7c7dc8f0c
4
- data.tar.gz: 20ffe961fbf98c8851b2b0d139e020bf30375d23
3
+ metadata.gz: cfb8b66880978cbcc93e559e5861fa04917b54f4
4
+ data.tar.gz: 6f6c199da10002ee3b7c168325fcc293f43e1b63
5
5
  SHA512:
6
- metadata.gz: 76006200d9346883f6fc15a8747a4d1f2e0b6409e54eefeeed3cb9b5672cf9a599a7fab87944b396f1e5961094ed61113bb27822aeab819de580cffc5aef9bb2
7
- data.tar.gz: 649ed785f090b45a3215b6e9d5e9cb4e2b52eb8de3335561be4a9b3eb8d1356e7275ad3eecd53f374155576dc41ab089c0fc0cb9b22f0f5b834c8f1b174fc418
6
+ metadata.gz: 5ae7cf7ee53b617b8f1fc08b14b7e70e55b66d0cd376de6903a0ea29924be58589d6637287bac389f27a4178503d948fa8badaaad17a224624785e48d2c8410f
7
+ data.tar.gz: d6adbc71643bfdb46380b5d097688351e689cb041c2cdbcbe831b36013ad4c0ba730ff63809eaa8919f43342daba2cdd467a64789c424bc45f4bc57759155e97
@@ -1,3 +1,3 @@
1
1
  module MangoPay
2
- VERSION = '3.0.5'
2
+ VERSION = '3.0.6'
3
3
  end
data/mangopay.gemspec CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
18
18
 
19
19
  s.required_ruby_version = '>= 1.9.2'
20
20
 
21
- s.add_dependency('multi_json', '~> 1.7.7')
21
+ s.add_dependency('multi_json', '>= 1.7.7')
22
22
 
23
23
  s.add_development_dependency('rake', '~> 10.1.0')
24
24
  s.add_development_dependency('rspec', '~> 2.14.1')
@@ -1,70 +1,70 @@
1
- require_relative '../../spec_helper'
2
-
3
- describe MangoPay::PayIn::Card::Direct, type: :feature do
4
- include_context 'wallets'
5
- include_context 'payins'
6
-
7
- def check_type_and_status(payin)
8
- expect(payin['Type']).to eq('PAYIN')
9
- expect(payin['Nature']).to eq('REGULAR')
10
- expect(payin['PaymentType']).to eq('CARD')
11
- expect(payin['ExecutionType']).to eq('DIRECT')
12
-
13
- # SUCCEEDED
14
- expect(payin['Status']).to eq('SUCCEEDED')
15
- expect(payin['ResultCode']).to eq('000000')
16
- expect(payin['ResultMessage']).to eq('Success')
17
- expect(payin['ExecutionDate']).to be > 0
18
- end
19
-
20
- describe 'CREATE' do
21
- it 'creates a card direct payin' do
22
- created = new_payin_card_direct
23
- expect(created['Id']).not_to be_nil
24
- check_type_and_status(created)
25
- end
26
- end
27
-
28
- describe 'FETCH' do
29
- it 'fetches a payin' do
30
- created = new_payin_card_direct
31
- fetched = MangoPay::PayIn.fetch(created['Id'])
32
- expect(fetched['Id']).to eq(created['Id'])
33
- expect(fetched['CreationDate']).to eq(created['CreationDate'])
34
- expect(fetched['CreditedFunds']).to eq(created['CreditedFunds'])
35
- expect(fetched['CreditedWalletId']).to eq(created['CreditedWalletId'])
36
- check_type_and_status(created)
37
- check_type_and_status(fetched)
38
- end
39
- end
40
-
41
- describe 'REFUND' do
42
- it 'refunds a payin' do
43
- payin = new_payin_card_direct
44
- refund = MangoPay::PayIn.refund(payin['Id'], {AuthorId: payin['AuthorId']})
45
- expect(refund['Id']).not_to be_nil
46
- expect(refund['Status']).to eq('SUCCEEDED')
47
- expect(refund['Type']).to eq('PAYOUT')
48
- expect(refund['Nature']).to eq('REFUND')
49
- expect(refund['InitialTransactionType']).to eq('PAYIN')
50
- expect(refund['InitialTransactionId']).to eq(payin['Id'])
51
- expect(refund['DebitedWalletId']).to eq(payin['CreditedWalletId'])
52
- end
53
- end
54
-
55
- describe 'CASH FLOW' do
56
- it 'changes balances correctly' do
57
- wlt = new_wallet
58
- wallets_check_amounts(wlt, 0)
59
-
60
- # payin: feed wlt1 with money
61
- payin = create_new_payin_card_direct(wlt, 1000)
62
- wallets_reload_and_check_amounts(wlt, 1000)
63
-
64
- # refund the payin
65
- refund = MangoPay::PayIn.refund(payin['Id'], {AuthorId: payin['AuthorId']})
66
- wallets_reload_and_check_amounts(wlt, 0)
67
- end
68
- end
69
-
70
- end
1
+ require_relative '../../spec_helper'
2
+
3
+ describe MangoPay::PayIn::Card::Direct, type: :feature do
4
+ include_context 'wallets'
5
+ include_context 'payins'
6
+
7
+ def check_type_and_status(payin)
8
+ expect(payin['Type']).to eq('PAYIN')
9
+ expect(payin['Nature']).to eq('REGULAR')
10
+ expect(payin['PaymentType']).to eq('CARD')
11
+ expect(payin['ExecutionType']).to eq('DIRECT')
12
+
13
+ # SUCCEEDED
14
+ expect(payin['Status']).to eq('SUCCEEDED')
15
+ expect(payin['ResultCode']).to eq('000000')
16
+ expect(payin['ResultMessage']).to eq('Success')
17
+ expect(payin['ExecutionDate']).to be > 0
18
+ end
19
+
20
+ describe 'CREATE' do
21
+ it 'creates a card direct payin' do
22
+ created = new_payin_card_direct
23
+ expect(created['Id']).not_to be_nil
24
+ check_type_and_status(created)
25
+ end
26
+ end
27
+
28
+ describe 'FETCH' do
29
+ it 'fetches a payin' do
30
+ created = new_payin_card_direct
31
+ fetched = MangoPay::PayIn.fetch(created['Id'])
32
+ expect(fetched['Id']).to eq(created['Id'])
33
+ expect(fetched['CreationDate']).to eq(created['CreationDate'])
34
+ expect(fetched['CreditedFunds']).to eq(created['CreditedFunds'])
35
+ expect(fetched['CreditedWalletId']).to eq(created['CreditedWalletId'])
36
+ check_type_and_status(created)
37
+ check_type_and_status(fetched)
38
+ end
39
+ end
40
+
41
+ describe 'REFUND' do
42
+ it 'refunds a payin' do
43
+ payin = new_payin_card_direct
44
+ refund = MangoPay::PayIn.refund(payin['Id'], {AuthorId: payin['AuthorId']})
45
+ expect(refund['Id']).not_to be_nil
46
+ expect(refund['Status']).to eq('SUCCEEDED')
47
+ expect(refund['Type']).to eq('PAYOUT')
48
+ expect(refund['Nature']).to eq('REFUND')
49
+ expect(refund['InitialTransactionType']).to eq('PAYIN')
50
+ expect(refund['InitialTransactionId']).to eq(payin['Id'])
51
+ expect(refund['DebitedWalletId']).to eq(payin['CreditedWalletId'])
52
+ end
53
+ end
54
+
55
+ describe 'CASH FLOW' do
56
+ it 'changes balances correctly' do
57
+ wlt = new_wallet
58
+ wallets_check_amounts(wlt, 0)
59
+
60
+ # payin: feed wlt1 with money
61
+ payin = create_new_payin_card_direct(wlt, 1000)
62
+ wallets_reload_and_check_amounts(wlt, 1000)
63
+
64
+ # refund the payin
65
+ refund = MangoPay::PayIn.refund(payin['Id'], {AuthorId: payin['AuthorId']})
66
+ wallets_reload_and_check_amounts(wlt, 0)
67
+ end
68
+ end
69
+
70
+ 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.5
4
+ version: 3.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geoffroy Lorieux
@@ -9,20 +9,20 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-11-20 00:00:00.000000000 Z
12
+ date: 2013-11-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: multi_json
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ~>
18
+ - - '>='
19
19
  - !ruby/object:Gem::Version
20
20
  version: 1.7.7
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - ~>
25
+ - - '>='
26
26
  - !ruby/object:Gem::Version
27
27
  version: 1.7.7
28
28
  - !ruby/object:Gem::Dependency