mangopay 3.3.0 → 3.4.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 98ce43d5b86c9ebc7d2b4385da9ef113e4cac11ca6cacc3fe339afc2cf0c3197
4
- data.tar.gz: 1879444087321901f562eb4e031a7fa5474fbfb63119908e69964a381bb5d03b
3
+ metadata.gz: f3be9c170462d86c30e551361cb135196086b166a5b4da755002635e6dffa367
4
+ data.tar.gz: f6cba5c6f4a1f3eacaa4fed0ffb484dacbf71e3d8b8f6a8cc16deca7387188ec
5
5
  SHA512:
6
- metadata.gz: 9daff7284d4b7f3720655a7933e0971ca34f80f945de6b8bcbef83b5ab83c46e42ca7bc23d804fcd35e982bfdb8afdf7d936c4a1e93c0f8ae190cc539f0cd9d2
7
- data.tar.gz: edbde0cde8b2308e6d950a730f595cedfe53e50852a30baff92be7cf58869b99cc0817304095d723f0aa48e72812c88c7fdecb83c0bd78c6cc5199986a2f9730
6
+ metadata.gz: 50f20f836d5eb42c7122b2e5865d20dc6a566ad1433915eef235d9cc0dfef4d4cde39f949c050de0bfafa9510c8aa263d6091ebf7df126e77a222160db8250b2
7
+ data.tar.gz: 11a3cc3fb9ed24f8b791c331f2113bf35e388082f18f78063c3c2ded7c74d1d8cffe53016d0a4f4fc5ccb03f2a296b09fb73246801bf45b6a1011a065a78d2a0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,26 @@
1
+ ## [3.4.0] - 2021.05.27
2
+ ## Added
3
+
4
+ ### Instant payment
5
+
6
+ Mangopay introduces the instant payment mode. It allows payouts (transfer from wallet to user bank account) to be processed within 25 seconds, rather than the 48 hours for a standard payout.
7
+
8
+ You can now use this new type of payout with the Ruby SDK.
9
+
10
+ Example :
11
+
12
+ ```ruby
13
+ bankwire = MangoPay::PayOut::BankWire.get_bankwire(payout['Id'])
14
+ # where payout['Id'] is the id of an existing payout
15
+ ```
16
+
17
+ Please note that this feature must be authorized and activated by MANGOPAY. More information [here](https://docs.mangopay.com/guide/instant-payment-payout).
18
+
19
+ ### Accepted PRs
20
+
21
+ - Add support to create refunds for PayIn, Transfer and PayOut transactions.
22
+ - ResponseError object improvement
23
+
1
24
  ## [3.3.0]
2
25
  ## Fixed
3
26
 
@@ -49,12 +49,17 @@ module MangoPay
49
49
  end
50
50
 
51
51
  def type; @details['Type']; end
52
- def errors; @details['errors']; end
52
+ def error; @details['error']; end
53
+ def errors; @details['errors'] || error; end
53
54
 
54
55
  def message;
55
- msg = @details['Message']
56
- msg += errors.sort.map {|k,v| " #{k}: #{v}"}.join if (errors && errors.is_a?(Hash))
57
- msg
56
+ if error
57
+ msg = error
58
+ else
59
+ msg = @details['Message']
60
+ msg += errors.sort.map {|k,v| " #{k}: #{v}"}.join if (errors && errors.is_a?(Hash))
61
+ msg
62
+ end
58
63
  end
59
64
 
60
65
  end
@@ -20,6 +20,11 @@ module MangoPay
20
20
  def self.url(*)
21
21
  "#{MangoPay.api_path}/payouts/bankwire"
22
22
  end
23
+
24
+ def self.get_bankwire(pay_out_id)
25
+ url = self.url() + "/" + pay_out_id
26
+ MangoPay.request(:get, url);
27
+ end
23
28
  end
24
29
  end
25
30
  end
@@ -1,3 +1,3 @@
1
1
  module MangoPay
2
- VERSION = '3.3.0'
2
+ VERSION = '3.4.0'
3
3
  end
Binary file
@@ -6,7 +6,11 @@ describe MangoPay::Configuration do
6
6
  c.client_id = 'test_asd'
7
7
  c.client_apiKey = '00000'
8
8
  MangoPay::User.fetch()
9
- }.to raise_error(MangoPay::ResponseError)
9
+ }.to raise_error { |err|
10
+ expect(err).to be_a MangoPay::ResponseError
11
+ expect(err.code).to eq '401'
12
+ expect(err.message).to eq 'invalid_client'
13
+ }
10
14
  end
11
15
 
12
16
  it 'goes ok when calling with correct client credentials' do
Binary file
Binary file
@@ -40,6 +40,15 @@ describe MangoPay::PayOut::BankWire, type: :feature do
40
40
  end
41
41
  end
42
42
 
43
+ describe 'Get Bankwire' do
44
+ it 'gets a bankwire' do
45
+ created = new_payout_bankwire
46
+ fetched = MangoPay::PayOut::BankWire.get_bankwire(created['Id'])
47
+ expect(fetched['Id']).to eq(created['Id'])
48
+ expect(fetched['CreationDate']).to eq(created['CreationDate'])
49
+ end
50
+ end
51
+
43
52
  describe 'FETCH' do
44
53
  it 'fetches a payout' do
45
54
  created = new_payout_bankwire
@@ -439,7 +439,8 @@ shared_context 'payouts' do
439
439
  Fees: {Currency: 'EUR', Amount: 0},
440
440
  BankAccountId: new_bank_account['Id'],
441
441
  Communication: 'This is a test',
442
- Tag: 'Test PayOut/Bank/Wire'
442
+ Tag: 'Test PayOut/Bank/Wire',
443
+ PayoutModeRequested: 'Standard'
443
444
  )
444
445
  end
445
446
  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.3.0
4
+ version: 3.4.0
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: 2021-05-11 00:00:00.000000000 Z
12
+ date: 2021-05-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: multi_json