mangopay 3.41.1 → 3.42.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: 1b9013971a3b6fe617300168a55fcf6cd0a970463786c857d102e1dc930ee173
4
- data.tar.gz: 62c67f789d9d1831d81bdf3a9940d340cd92be58a9b8f1ba451f48ea06f362c4
3
+ metadata.gz: 879bafa3fe5fd5adfea4cd26ae6ee9999f6943178748f9000f52c7a523dcfc9e
4
+ data.tar.gz: 52c1b5b99f13209340f0c96d1229241a32c83e6b3baa1c503c34d27dfead0325
5
5
  SHA512:
6
- metadata.gz: a432296d798507df1115fcf3c51265e4b8be9b24fa15314116fd0e12514dbaf537c4d6020907cd0eb080d6694ef2d7820b584aa5c790cea091a43ab2956a4dff
7
- data.tar.gz: cd818297767715b6dc51a5ad5a24d2b3a93809cef3ead895d8b4a260e88da6326e0960d1009a256955767a4fc25b89d552cbd57d493e08a294d014ee64190e5e
6
+ metadata.gz: 50b75a77849b4414d345e5d16f2ccec95cd388cd74c9162baed376837dd734b58fb907b0d6f7b020a416cf0c26b7fe649d3f454c1046690708b9f4da6d81faef
7
+ data.tar.gz: d4168edc1c8dbe69c86ba13462bfe716d61bd035c489c21ac24a547b1e4bce8d9fb312e10195633339efafc5b912991b9bc61052eb5133d0e4ca3d9a431e30ce
data/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## [3.42.1] - 2025-11-06
2
+ ### Improved
3
+ - Support for case variations in error handler #313
4
+
5
+ ## [3.42.0] - 2025-10-27
6
+ ### Added
7
+ - New [POST Manage proxy consent for a User](https://docs.mangopay.com/api-reference/users/manage-proxy-consent) endpoint to obtain and manage user consent via the hosted SCA experience (if proxy is activated). A proxy and user consent are now required to use the `USER_NOT_PRESENT` value for `ScaContext` ([API release note](https://docs.mangopay.com/release-notes/api/2025-10-23), #310)
8
+
9
+ ### Changed
10
+ - `x-tenant-id` deprecated as no longer necessary for UK platforms; the parameter is ignored by Mangopay (#309 )
11
+
1
12
  ## [3.41.1] - 2025-10-10
2
13
  ### Added
3
14
  - Configuration for `after_request_proc` to be able to check rate limits post-request (#301 - thank you @matteeyah and @robertfall for the contribution 🙏)
@@ -50,7 +50,7 @@ module MangoPay
50
50
 
51
51
  def type; @details['Type'] || @details['type']; end
52
52
  def error; @details['error']; end
53
- def errors; @details['errors'] || error; end
53
+ def errors; @details['errors'] || @details['Errors'] || error; end
54
54
 
55
55
  def message;
56
56
  if error
data/lib/mangopay/user.rb CHANGED
@@ -11,11 +11,15 @@ module MangoPay
11
11
  include HTTPCalls::Update
12
12
  include HTTPCalls::Fetch
13
13
  class << self
14
- def enroll_sca(user_id)
14
+ def enroll_sca(user_id, idempotency_key = nil)
15
15
  url = "#{MangoPay.api_path}/sca/users/#{user_id}/enrollment"
16
- MangoPay.request(:post, url, {}, {})
16
+ MangoPay.request(:post, url, {}, {}, idempotency_key)
17
17
  end
18
18
 
19
+ def manage_consent(user_id, idempotency_key = nil)
20
+ url = "#{MangoPay.api_path}/sca/users/#{user_id}/consent"
21
+ MangoPay.request(:post, url, {}, {}, idempotency_key)
22
+ end
19
23
 
20
24
  # Fetches list of wallets belonging to the given +user_id+.
21
25
  # Optional +filters+ is a hash accepting following keys:
@@ -1,3 +1,3 @@
1
1
  module MangoPay
2
- VERSION = '3.41.1'
2
+ VERSION = '3.42.1'
3
3
  end
@@ -19,7 +19,7 @@ describe MangoPay::Recipient do
19
19
 
20
20
  describe 'GET User Recipients' do
21
21
  it 'fetches recipients without query param' do
22
- john = create_new_natural_user_sca_payer
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'])
25
25
  expect(fetched).not_to be_nil
@@ -28,7 +28,7 @@ describe MangoPay::Recipient do
28
28
  end
29
29
 
30
30
  it 'fetches recipients with scope PAYOUT' do
31
- john = create_new_natural_user_sca_payer
31
+ john = create_new_natural_user_sca_owner
32
32
  create_new_recipient(john['Id'])
33
33
  fetched = MangoPay::Recipient.get_user_recipients(john['Id'], {RecipientScope: "PAYOUT"})
34
34
  expect(fetched).not_to be_nil
@@ -37,7 +37,7 @@ describe MangoPay::Recipient do
37
37
  end
38
38
 
39
39
  it 'fetches recipients with scope PAYIN' do
40
- john = create_new_natural_user_sca_payer
40
+ john = create_new_natural_user_sca_owner
41
41
  create_new_recipient(john['Id'])
42
42
  fetched = MangoPay::Recipient.get_user_recipients(john['Id'], {RecipientScope: "PAYIN"})
43
43
  expect(fetched).not_to be_nil
@@ -92,7 +92,7 @@ describe MangoPay::Recipient do
92
92
  describe 'VALIDATE' do
93
93
  it 'validates a recipient' do
94
94
  recipient = define_new_recipient
95
- john = create_new_natural_user_sca_payer
95
+ john = create_new_natural_user_sca_owner
96
96
  # it should pass
97
97
  MangoPay::Recipient.validate(recipient, john['Id'])
98
98
 
@@ -1306,7 +1306,7 @@ end
1306
1306
  shared_context 'recipient' do
1307
1307
  include_context 'users'
1308
1308
 
1309
- let(:new_recipient) { create_new_recipient(create_new_natural_user_sca_payer['Id']) }
1309
+ let(:new_recipient) { create_new_recipient(create_new_natural_user_sca_owner['Id']) }
1310
1310
 
1311
1311
  def create_new_recipient(user_id)
1312
1312
  MangoPay::Recipient.create(define_new_recipient, user_id)
@@ -161,6 +161,18 @@ describe MangoPay::User do
161
161
  end
162
162
  end
163
163
 
164
+ describe 'MANAGE CONSENT' do
165
+ it 'manages consent' do
166
+ user = new_natural_user
167
+
168
+ enrollment_result = MangoPay::User.enroll_sca(user['Id'])
169
+ expect(enrollment_result["PendingUserAction"]["RedirectUrl"]).not_to be_nil
170
+
171
+ consent_result = MangoPay::User.manage_consent(user['Id'])
172
+ expect(consent_result["PendingUserAction"]["RedirectUrl"]).not_to be_nil
173
+ end
174
+ end
175
+
164
176
  describe 'FETCH' do
165
177
  it 'fetches all the users' do
166
178
  users = MangoPay::User.fetch()
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.41.1
4
+ version: 3.42.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-10-10 00:00:00.000000000 Z
12
+ date: 2025-11-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: multi_json