mangopay 3.35.0 → 3.35.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: e11195066c9596106c5615e858bf1af13f20e4d6f6efa51675158e7d49a8348b
4
- data.tar.gz: d789d50dfdb1cb320cc0b4dc0d3b8b7ef12aac1627da49b77abadaa502b855c4
3
+ metadata.gz: 15264b27e3c6d9543eb22df8793bb0fb37870aa19d6c12c5d9c41f7ae3e37f7a
4
+ data.tar.gz: 8333f909cf729a462acd645a4b68aa03a048a6490fe16881eb675a818e25a0c8
5
5
  SHA512:
6
- metadata.gz: 3ed3eb963aa03ae1874ecab170480f6f0cae564adc7f98007724ce8f0049be680c9f013965f835e0300fcb6d46fa2497da27aa7faf310b24ca3702de72021609
7
- data.tar.gz: 3f3e98a623f39a930ceaa2be9b747c72d7daa987bcb69a8e2a3a1883c0ca4ab93b51a98e69d383c13fc32fb17ec9dbbfb771a55698bfd47618bb15e59010ea08
6
+ metadata.gz: 2522a4843d777f4db554b7df2ab8c331d592155288fd641deaf17e19de28e426df70eeca7041e8007c9732aae4663c1fe93677d1c9a71fcb8244b7b8cf766490
7
+ data.tar.gz: 607684d9029548a5798d1274938f74d8c0fad61591d3ca68bf56a8a90247741d475a34ddb0dbe06c20def8f06810d6d3cdd6ceb47a75221086baf480cb30ec3b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [3.35.1] - 2025-06-05
2
+ ### Added
3
+ - Support for `RecipientScope` query parameter on [GET List Recipients for a User](https://docs.mangopay.com/api-reference/recipients/list-recipients-user)
4
+ - [POST Validate the format of User data](https://docs.mangopay.com/api-reference/user-data-format/validate-user-data-format)
5
+
6
+ ### Fixed
7
+ - Support for legacy Payconiq integration via `MangoPay::PayIn::Payconiq::Web.create_legacy` (removed in error).
8
+
1
9
  ## [3.35.0] - 2025-05-23
2
10
  ### Added
3
11
 
@@ -147,6 +147,10 @@ module MangoPay
147
147
  def self.url(*)
148
148
  "#{MangoPay.api_path}/payins/payment-methods/payconiq"
149
149
  end
150
+
151
+ def self.create_legacy(params, idempotency_key = nil)
152
+ MangoPay.request(:post, "#{MangoPay.api_path}/payins/payconiq/web", params, {}, idempotency_key)
153
+ end
150
154
  end
151
155
 
152
156
  end
data/lib/mangopay/user.rb CHANGED
@@ -87,6 +87,10 @@ module MangoPay
87
87
  url = "#{MangoPay.api_path}/sca/users/#{user_id}"
88
88
  MangoPay.request(:get, url, {}, {})
89
89
  end
90
+
91
+ def validate_data_format(params, idempotency_key = nil)
92
+ MangoPay.request(:post, "#{MangoPay.api_path}/users/data-formats/validation", params, {}, idempotency_key)
93
+ end
90
94
  end
91
95
  end
92
96
  end
@@ -1,3 +1,3 @@
1
1
  module MangoPay
2
- VERSION = '3.35.0'
2
+ VERSION = '3.35.1'
3
3
  end
@@ -20,6 +20,12 @@ describe MangoPay::PayIn::Payconiq::Web, type: :feature do
20
20
  expect(created['Id']).not_to be_nil
21
21
  check_type_and_status(created)
22
22
  end
23
+
24
+ it 'creates a payconiq web payin using the old endpoint' do
25
+ created = new_payin_payconiq_web_legacy
26
+ expect(created['Id']).not_to be_nil
27
+ check_type_and_status(created)
28
+ end
23
29
  end
24
30
 
25
31
  end
@@ -18,7 +18,7 @@ describe MangoPay::Recipient do
18
18
  end
19
19
 
20
20
  describe 'GET User Recipients' do
21
- it 'fetches a recipient' do
21
+ it 'fetches recipients without query param' do
22
22
  john = create_new_natural_user_sca_owner
23
23
  create_new_recipient(john['Id'])
24
24
  fetched = MangoPay::Recipient.get_user_recipients(john['Id'])
@@ -26,6 +26,24 @@ describe MangoPay::Recipient do
26
26
  expect(fetched).to be_kind_of(Array)
27
27
  expect(fetched).not_to be_empty
28
28
  end
29
+
30
+ it 'fetches recipients with scope PAYOUT' do
31
+ john = create_new_natural_user_sca_owner
32
+ create_new_recipient(john['Id'])
33
+ fetched = MangoPay::Recipient.get_user_recipients(john['Id'], {RecipientScope: "PAYOUT"})
34
+ expect(fetched).not_to be_nil
35
+ expect(fetched).to be_kind_of(Array)
36
+ expect(fetched).not_to be_empty
37
+ end
38
+
39
+ it 'fetches recipients with scope PAYIN' do
40
+ john = create_new_natural_user_sca_owner
41
+ create_new_recipient(john['Id'])
42
+ fetched = MangoPay::Recipient.get_user_recipients(john['Id'], {RecipientScope: "PAYIN"})
43
+ expect(fetched).not_to be_nil
44
+ expect(fetched).to be_kind_of(Array)
45
+ expect(fetched).to be_empty
46
+ end
29
47
  end
30
48
 
31
49
  describe 'GET Schema' do
@@ -372,6 +372,18 @@ shared_context 'payins' do
372
372
  )
373
373
  end
374
374
 
375
+ let(:new_payin_payconiq_web_legacy) do
376
+ MangoPay::PayIn::Payconiq::Web.create_legacy(
377
+ AuthorId: new_natural_user['Id'],
378
+ CreditedWalletId: new_wallet['Id'],
379
+ DebitedFunds: { Currency: 'EUR', Amount: 100 },
380
+ Fees: { Currency: 'EUR', Amount: 0 },
381
+ ReturnURL: MangoPay.configuration.root_url,
382
+ Country: "BE",
383
+ Tag: 'Custom Meta'
384
+ )
385
+ end
386
+
375
387
  ###############################################
376
388
  # applepay/direct
377
389
  ###############################################
@@ -399,4 +399,30 @@ describe MangoPay::User do
399
399
  expect(closed['UserStatus']).to eq('CLOSED')
400
400
  end
401
401
  end
402
+
403
+ describe 'Validate User Data Format' do
404
+ it 'validates successfully' do
405
+ validation = {
406
+ "CompanyNumber": {
407
+ "CompanyNumber": "AB123456",
408
+ "CountryCode": "IT"
409
+ }
410
+ }
411
+ result = MangoPay::User.validate_data_format(validation)
412
+ expect(result['CompanyNumber']).not_to be_nil
413
+ end
414
+
415
+ it 'validates with error' do
416
+ validation = {
417
+ "CompanyNumber": {
418
+ "CompanyNumber": "123"
419
+ }
420
+ }
421
+ expect { MangoPay::User.validate_data_format(validation) }.to raise_error { |err|
422
+ expect(err).to be_a MangoPay::ResponseError
423
+ expect(err.code).to eq '400'
424
+ expect(err.type).to eq 'param_error'
425
+ }
426
+ end
427
+ end
402
428
  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.35.0
4
+ version: 3.35.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: 2025-05-23 00:00:00.000000000 Z
12
+ date: 2025-06-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: multi_json