mangopay 3.10.0 → 3.11.0

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
  SHA256:
3
- metadata.gz: 27372664cdb5c2c9155a08ab3b9a5ebddd31f261f86c154d0b64ae2d346c4e9f
4
- data.tar.gz: ba496e8fff4adb93001b20b69081d7edfb5cb95c80722f1e9cc155bfc342af98
3
+ metadata.gz: f1fdfc923ff995412c8aaf53d8bb4684f35dbae82937532bb5c5682e54888462
4
+ data.tar.gz: 2c7930a03a8e10a5ed13e35bb9bd3834fa1a738ca45232546b81935b5ec29dcb
5
5
  SHA512:
6
- metadata.gz: 7663a69824b9b188227c1a78a9bec1589f368bd84893cb3915b856c53e3df4453416d0593060a49d74a2132bdcf4e624430704619f9189396ebe660ed6d845f4
7
- data.tar.gz: 6e48f2457c2ac4ce3b32a8814b93ccd8e10bb91d689b5d2d5508398ab8c7bb3596500eb104d250a6c1f84dec2f48667c8249774a791bebf4021976ee5a56c861
6
+ metadata.gz: 76ec1a6e0bbeca5e530f1e994501eed2471a4e2af1f6761e538ce9639873172b8a4a0d6278ecd45e146ae7e2b0a459828cb4a2958374e36b369fa756422bf210
7
+ data.tar.gz: bfac13d78271a3dc3466f4f8bba3f3287baef8786528b7794a5af204f5bf7e6d4154a960f3b1dac41ebe4f60a735b4398d91ecdd1f67f22d0cb72b2d97de14f0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,21 @@
1
+ ## [3.11.0] - 2022-09-08
2
+ ##Added
3
+ **New country authorizations endpoints**
4
+
5
+ Country authorizations can now be viewed by using one of the following endpoints:
6
+
7
+ <a href="https://docs.mangopay.com/endpoints/v2.01/regulatory#e1061_the-country-authorizations-object">View a country's authorizations</a> <br>
8
+ <a href="https://docs.mangopay.com/endpoints/v2.01/regulatory#e1061_the-country-authorizations-object">View all countries' authorizations</a>
9
+
10
+ With these calls, it is possible to check which countries have:
11
+
12
+ - Blocked user creation
13
+ - Blocked bank account creation
14
+ - Blocked payout creation
15
+
16
+ Please refer to the <a href="https://docs.mangopay.com/guide/restrictions-by-country">Restrictions by country</a>
17
+ article for more information.
18
+
1
19
  ## [3.10.0] - 2022-06-29
2
20
  ##Added
3
21
  **Recurring: €0 deadlines for CIT**
@@ -0,0 +1,22 @@
1
+ module MangoPay
2
+ # Provides API methods for the UBO entity.
3
+ class Regulatory < Resource
4
+ class << self
5
+ def one_country_url(country_iso)
6
+ "#{MangoPay.api_path_no_client}/countries/#{country_iso}/authorizations"
7
+ end
8
+
9
+ def all_countries_url
10
+ "#{MangoPay.api_path_no_client}/countries/authorizations"
11
+ end
12
+
13
+ def get_country_authorizations(country_iso)
14
+ MangoPay.request(:get, one_country_url(country_iso))
15
+ end
16
+
17
+ def get_all_countries_authorizations
18
+ MangoPay.request(:get, all_countries_url)
19
+ end
20
+ end
21
+ end
22
+ end
@@ -1,3 +1,3 @@
1
1
  module MangoPay
2
- VERSION = '3.10.0'
2
+ VERSION = '3.11.0'
3
3
  end
data/lib/mangopay.rb CHANGED
@@ -42,6 +42,7 @@ module MangoPay
42
42
  autoload :BankingAliasesIBAN, 'mangopay/bankingaliases_iban'
43
43
  autoload :UboDeclaration, 'mangopay/ubo_declaration'
44
44
  autoload :Ubo, 'mangopay/ubo'
45
+ autoload :Regulatory, 'mangopay/regulatory'
45
46
 
46
47
  # temporary
47
48
  autoload :Temp, 'mangopay/temp'
@@ -74,6 +75,10 @@ module MangoPay
74
75
  "/#{version_code}/#{MangoPay.configuration.client_id}"
75
76
  end
76
77
 
78
+ def api_path_no_client
79
+ "/#{version_code}"
80
+ end
81
+
77
82
  def api_uri(url='')
78
83
  URI(configuration.root_url + url)
79
84
  end
@@ -0,0 +1,26 @@
1
+ describe MangoPay::Regulatory do
2
+
3
+ describe 'GET Country Authorizations' do
4
+ it 'can get country authorizations' do
5
+ country_authorizations = MangoPay::Regulatory.get_country_authorizations('FR')
6
+
7
+ expect(country_authorizations).not_to be_nil
8
+ expect(country_authorizations['CountryCode']).not_to be_nil
9
+ expect(country_authorizations['CountryName']).not_to be_nil
10
+ expect(country_authorizations['Authorization']).not_to be_nil
11
+ expect(country_authorizations['LastUpdate']).not_to be_nil
12
+ end
13
+ end
14
+
15
+ describe 'GET All Countries Authorizations' do
16
+ it 'can get all countries authorizations' do
17
+ country_authorizations = MangoPay::Regulatory.get_all_countries_authorizations
18
+
19
+ expect(country_authorizations).not_to be_nil
20
+ expect(country_authorizations[0]['CountryCode']).not_to be_nil
21
+ expect(country_authorizations[0]['CountryName']).not_to be_nil
22
+ expect(country_authorizations[0]['Authorization']).not_to be_nil
23
+ expect(country_authorizations[0]['LastUpdate']).not_to be_nil
24
+ end
25
+ end
26
+ 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.10.0
4
+ version: 3.11.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: 2022-06-29 00:00:00.000000000 Z
12
+ date: 2022-09-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: multi_json
@@ -97,6 +97,7 @@ files:
97
97
  - lib/mangopay/pay_out.rb
98
98
  - lib/mangopay/pre_authorization.rb
99
99
  - lib/mangopay/refund.rb
100
+ - lib/mangopay/regulatory.rb
100
101
  - lib/mangopay/report.rb
101
102
  - lib/mangopay/resource.rb
102
103
  - lib/mangopay/transaction.rb
@@ -138,6 +139,7 @@ files:
138
139
  - spec/mangopay/preauthorization_spec.rb
139
140
  - spec/mangopay/recurring_payin_spec.rb
140
141
  - spec/mangopay/refund_spec.rb
142
+ - spec/mangopay/regulatory_spec.rb
141
143
  - spec/mangopay/report_spec.rb
142
144
  - spec/mangopay/report_wallets_spec.rb
143
145
  - spec/mangopay/shared_resources.rb
@@ -204,6 +206,7 @@ test_files:
204
206
  - spec/mangopay/preauthorization_spec.rb
205
207
  - spec/mangopay/recurring_payin_spec.rb
206
208
  - spec/mangopay/refund_spec.rb
209
+ - spec/mangopay/regulatory_spec.rb
207
210
  - spec/mangopay/report_spec.rb
208
211
  - spec/mangopay/report_wallets_spec.rb
209
212
  - spec/mangopay/shared_resources.rb