mangopay 3.10.0 → 3.11.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 27372664cdb5c2c9155a08ab3b9a5ebddd31f261f86c154d0b64ae2d346c4e9f
4
- data.tar.gz: ba496e8fff4adb93001b20b69081d7edfb5cb95c80722f1e9cc155bfc342af98
3
+ metadata.gz: 1b1c4ab5a218b4ccd0da9317cb444381509768780a2ff99d27b920ae48edbbec
4
+ data.tar.gz: 3c5af9a55982270cd08a57a02603f243c0c205f512a8560536ee5a370f0a6951
5
5
  SHA512:
6
- metadata.gz: 7663a69824b9b188227c1a78a9bec1589f368bd84893cb3915b856c53e3df4453416d0593060a49d74a2132bdcf4e624430704619f9189396ebe660ed6d845f4
7
- data.tar.gz: 6e48f2457c2ac4ce3b32a8814b93ccd8e10bb91d689b5d2d5508398ab8c7bb3596500eb104d250a6c1f84dec2f48667c8249774a791bebf4021976ee5a56c861
6
+ metadata.gz: 515d50e9a5dcfcaab5fc81cf63609e80351ae955efaec23e7549c32ff345184e4af24ecf50367d482cfda1cd2e93d513271ebda859bee48379cf89ef5fa3769d
7
+ data.tar.gz: f6a6dace6284cbac4b6bb27a23092196fcfd8f325fccf850c3dfd47431fbedf280d1e2cd77cac1b3c65642b4992cd2ecfd906a0bfc533942274bf00e4c1bc81e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,26 @@
1
+ ## [3.11.1] - 2022-10-18
2
+ ### Fixed
3
+
4
+ Tests has been fixed due to API evolution.
5
+
6
+ ## [3.11.0] - 2022-09-08
7
+ ##Added
8
+ **New country authorizations endpoints**
9
+
10
+ Country authorizations can now be viewed by using one of the following endpoints:
11
+
12
+ <a href="https://docs.mangopay.com/endpoints/v2.01/regulatory#e1061_the-country-authorizations-object">View a country's authorizations</a> <br>
13
+ <a href="https://docs.mangopay.com/endpoints/v2.01/regulatory#e1061_the-country-authorizations-object">View all countries' authorizations</a>
14
+
15
+ With these calls, it is possible to check which countries have:
16
+
17
+ - Blocked user creation
18
+ - Blocked bank account creation
19
+ - Blocked payout creation
20
+
21
+ Please refer to the <a href="https://docs.mangopay.com/guide/restrictions-by-country">Restrictions by country</a>
22
+ article for more information.
23
+
1
24
  ## [3.10.0] - 2022-06-29
2
25
  ##Added
3
26
  **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.1'
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
@@ -15,7 +15,7 @@ describe MangoPay::PreAuthorization do
15
15
  expect(created['PaymentStatus']).to eq('WAITING')
16
16
  expect(created['PaymentType']).to eq('CARD')
17
17
  expect(created['ExecutionType']).to eq('DIRECT')
18
- expect(created['Requested3DSVersion']).to eq('V1')
18
+ expect(created['Requested3DSVersion']).to eq('V2_1')
19
19
  end
20
20
  end
21
21
 
@@ -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
@@ -221,13 +221,13 @@ shared_context 'payins' do
221
221
 
222
222
  let(:new_payin_payconiq_web) do
223
223
  MangoPay::PayIn::Payconiq::Web.create(
224
- AuthorId: new_natural_user['Id'],
225
- CreditedWalletId: new_wallet['Id'],
226
- DebitedFunds: {Currency: 'EUR', Amount: 100},
227
- Fees: {Currency: 'EUR', Amount: 0},
228
- ReturnURL: MangoPay.configuration.root_url,
229
- Country: "BE",
230
- Tag: 'Custom Meta'
224
+ AuthorId: new_natural_user['Id'],
225
+ CreditedWalletId: new_wallet['Id'],
226
+ DebitedFunds: {Currency: 'EUR', Amount: 100},
227
+ Fees: {Currency: 'EUR', Amount: 0},
228
+ ReturnURL: MangoPay.configuration.root_url,
229
+ Country: "BE",
230
+ Tag: 'Custom Meta'
231
231
  )
232
232
  end
233
233
 
@@ -357,7 +357,7 @@ shared_context 'payins' do
357
357
  data = {
358
358
  data: cardreg['PreregistrationData'],
359
359
  accessKeyRef: cardreg['AccessKey'],
360
- cardNumber: 4970100000000154,
360
+ cardNumber: 4970105191923460,
361
361
  cardExpirationDate: 1226,
362
362
  cardCvx: 123}
363
363
 
@@ -377,11 +377,11 @@ shared_context 'payins' do
377
377
 
378
378
  # 2nd step: tokenize by payline (fills-in RegistrationData)
379
379
  data = {
380
- data: cardreg['PreregistrationData'],
381
- accessKeyRef: cardreg['AccessKey'],
382
- cardNumber: 4970105191923460,
383
- cardExpirationDate: 1224,
384
- cardCvx: 123}
380
+ data: cardreg['PreregistrationData'],
381
+ accessKeyRef: cardreg['AccessKey'],
382
+ cardNumber: 4970105191923460,
383
+ cardExpirationDate: 1224,
384
+ cardCvx: 123}
385
385
 
386
386
  res = Net::HTTP.post_form(URI(cardreg['CardRegistrationURL']), data)
387
387
  raise Exception, [res, res.body] unless res.is_a?(Net::HTTPOK) && res.body.start_with?('data=')
@@ -407,7 +407,19 @@ shared_context 'payins' do
407
407
  CardId: cardreg['CardId'],
408
408
  SecureModeReturnURL: 'http://test.com',
409
409
  Tag: 'Test PayIn/Card/Direct',
410
- Requested3DSVersion: 'V1'
410
+ Requested3DSVersion: 'V2_1',
411
+ BrowserInfo: {
412
+ AcceptHeader: "text/html, application/xhtml+xml, application/xml;q=0.9, /;q=0.8",
413
+ JavaEnabled: true,
414
+ Language: "FR-FR",
415
+ ColorDepth: 4,
416
+ ScreenHeight: 1800,
417
+ ScreenWidth: 400,
418
+ JavascriptEnabled: true,
419
+ TimeZoneOffset: "+60",
420
+ UserAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 13_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148"
421
+ },
422
+ IpAddress: "2001:0620:0000:0000:0211:24FF:FE80:C12C"
411
423
  )
412
424
  end
413
425
 
@@ -425,7 +437,19 @@ shared_context 'payins' do
425
437
  SecureMode: 'DEFAULT',
426
438
  SecureModeReturnURL: 'http://test.com',
427
439
  Tag: 'Test Card PreAuthorization',
428
- Requested3DSVersion: 'V1'
440
+ Requested3DSVersion: 'V2_1',
441
+ BrowserInfo: {
442
+ AcceptHeader: "text/html, application/xhtml+xml, application/xml;q=0.9, /;q=0.8",
443
+ JavaEnabled: true,
444
+ Language: "FR-FR",
445
+ ColorDepth: 4,
446
+ ScreenHeight: 1800,
447
+ ScreenWidth: 400,
448
+ JavascriptEnabled: true,
449
+ TimeZoneOffset: "+60",
450
+ UserAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 13_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148"
451
+ },
452
+ IpAddress: "2001:0620:0000:0000:0211:24FF:FE80:C12C"
429
453
  )
430
454
  end
431
455
 
@@ -440,7 +464,19 @@ shared_context 'payins' do
440
464
  DebitedFunds: {Currency: 'EUR', Amount: amnt},
441
465
  Fees: {Currency: 'EUR', Amount: 0},
442
466
  PreauthorizationId: preauth['Id'],
443
- Tag: 'Test PayIn/PreAuthorized/Direct'
467
+ Tag: 'Test PayIn/PreAuthorized/Direct',
468
+ BrowserInfo: {
469
+ AcceptHeader: "text/html, application/xhtml+xml, application/xml;q=0.9, /;q=0.8",
470
+ JavaEnabled: true,
471
+ Language: "FR-FR",
472
+ ColorDepth: 4,
473
+ ScreenHeight: 1800,
474
+ ScreenWidth: 400,
475
+ JavascriptEnabled: true,
476
+ TimeZoneOffset: "+60",
477
+ UserAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 13_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148"
478
+ },
479
+ IpAddress: "2001:0620:0000:0000:0211:24FF:FE80:C12C"
444
480
  )
445
481
  end
446
482
 
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.1
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-10-19 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