mangopay4-ruby-sdk 4.0.0 → 4.2.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: eb654fc06104d0fe492b2be09168600553f9f81cd3bd3e80271aa6d160f27cf1
4
- data.tar.gz: b78f7505e4d6d5cd267f33736fcd0daa3d5511cd155699d1cc4cd6b9fea78112
3
+ metadata.gz: 07eab6907304e0d4dba0e64a4622ffd1eee23cf88659f29ee651ddb5b2626f9c
4
+ data.tar.gz: 5dac81827d238ce53822eac8abe398e8d8ca04c6e86cdba41da8ac7d770fa003
5
5
  SHA512:
6
- metadata.gz: 4c77cfd779734df7907a175a559df9ce04fbbaa8fe6da3a73a1a860e6d32d04115a38c1797aa0fede7fb6abee4b846dd0b4038835eefd0a10a8109799ed27d1d
7
- data.tar.gz: 2f0d52816f02390228792e1d60300d39c3cdec9bae793d3b76d798fc2f43c8e4e9d25d0cc1b348bab40cc24702ea77ae1c6f83d167dcfc6bde3c42752c865503
6
+ metadata.gz: 4c529e90aa87cdc669a2c7838d081b004d38e2a246105443a17eaaf59525e6f0c1837179fa244615cd226279acca5d250b35cce20197ec651cb09d34aa13a7d3
7
+ data.tar.gz: 0a124ac898c33a81401e602650bd9234b51c8a1c3511f2a35e724cd52baa6d8bec10e69a07eeb3da4e57aa18f7cfc6ca4048a00186c5baa779cd252c65907db5
data/CHANGELOG.md CHANGED
@@ -1,3 +1,26 @@
1
+ ## [4.2.0] - 2026-10-15
2
+ ### Added – Mandate recipients, PayIn Intents/Splits & Settlements listing
3
+ - Added `MangoPay::Mandate.fetch_for_recipient` to list the mandates belonging to a given user's recipient
4
+ - Added `MangoPay::PayIn::PayInIntent::Intent.get_all` to list pay-in intents
5
+ - Added `MangoPay::PayIn::PayInIntent::Split.get_all` to list pay-in intent splits
6
+ - Added `MangoPay::Settlement.get_all` to list settlements
7
+
8
+ ## [4.1.0] - 2026-10-01
9
+ ### Added – Extended Preauthorizations
10
+ - Added `MangoPay::ExtendedPreauthorization` with:
11
+ - `create` – create an extended preauthorization (card/direct)
12
+ - `create_paypal_preauthorization` – create an extended preauthorization via PayPal
13
+ - `get` – fetch an extended preauthorization by id
14
+ - `update` – update an extended preauthorization. To cancel one, call `update` with `{ PaymentStatus: 'CANCELED' }`
15
+ - `get_all_for_user` – list a user's extended preauthorizations
16
+ - `get_all_for_card` – list a card's extended preauthorizations
17
+ - `get_transactions` – list an extended preauthorization's transactions
18
+ - Added `MangoPay::PayIn::PreAuthorized::Direct.create_pre_authorized_extended_pay_in` for extended preauthorized pay-ins
19
+
20
+ #### Deprecated
21
+ - `MangoPay::Deposit` – use `MangoPay::ExtendedPreauthorization` instead
22
+ - `MangoPay::PayIn::PreAuthorized::Direct.create_pre_authorized_deposit_pay_in` – use `create_pre_authorized_extended_pay_in` instead
23
+
1
24
  ## [4.0.0] - 2026-09-02
2
25
  ### Infrastructure – CI/CD Migration
3
26
 
@@ -1,6 +1,9 @@
1
1
  module MangoPay
2
2
 
3
3
  # See http://docs.mangopay.com/api-references/payins/preauthorized-payin/
4
+ #
5
+ # <b>DEPRECATED</b>: The "deposit" terminology is being phased out.
6
+ # Please use MangoPay::ExtendedPreauthorization instead.
4
7
  class Deposit < Resource
5
8
  def self.create(params, idempotency_key = nil)
6
9
  MangoPay.request(:post, "#{MangoPay.api_path}/deposit-preauthorizations/card/direct", params, {}, idempotency_key)
@@ -0,0 +1,32 @@
1
+ module MangoPay
2
+
3
+ class ExtendedPreauthorization < Resource
4
+ def self.create(params, idempotency_key = nil)
5
+ MangoPay.request(:post, "#{MangoPay.api_path}/extended-preauthorizations/card/direct", params, {}, idempotency_key)
6
+ end
7
+
8
+ def self.create_paypal_preauthorization(params, idempotency_key = nil)
9
+ MangoPay.request(:post, "#{MangoPay.api_path}/extended-preauthorizations/payment-methods/paypal", params, {}, idempotency_key)
10
+ end
11
+
12
+ def self.get(extended_preauthorization_id, filters = {})
13
+ MangoPay.request(:get, "#{MangoPay.api_path}/extended-preauthorizations/#{extended_preauthorization_id}", {}, filters)
14
+ end
15
+
16
+ def self.update(extended_preauthorization_id, params)
17
+ MangoPay.request(:put, "#{MangoPay.api_path}/extended-preauthorizations/#{extended_preauthorization_id}", params)
18
+ end
19
+
20
+ def self.get_all_for_user(user_id, filters = {})
21
+ MangoPay.request(:get, "#{MangoPay.api_path}/users/#{user_id}/extended-preauthorizations", {}, filters)
22
+ end
23
+
24
+ def self.get_all_for_card(card_id, filters = {})
25
+ MangoPay.request(:get, "#{MangoPay.api_path}/cards/#{card_id}/extended-preauthorizations", {}, filters)
26
+ end
27
+
28
+ def self.get_transactions(extended_preauthorization_id, filters = {})
29
+ MangoPay.request(:get, "#{MangoPay.api_path}/extended-preauthorizations/#{extended_preauthorization_id}/transactions", {}, filters)
30
+ end
31
+ end
32
+ end
@@ -54,7 +54,7 @@ module MangoPay
54
54
  #
55
55
  def fetch(id_or_filters = nil, idempotency_key = nil, query_params_get_by_id = nil)
56
56
  id, filters = HTTPCalls::Fetch.parse_id_or_filters(id_or_filters)
57
- if query_params_get_by_id != nil and query_params_get_by_id != {}
57
+ if query_params_get_by_id != nil && query_params_get_by_id != {}
58
58
  filters = query_params_get_by_id
59
59
  end
60
60
  response = MangoPay.request(:get, url(id), {}, filters, idempotency_key)
@@ -27,6 +27,11 @@ module MangoPay
27
27
  MangoPay.request(:get, url, {}, filters)
28
28
  end
29
29
 
30
+ def fetch_for_recipient(user_id, recipient_id, filters = {})
31
+ url = "#{MangoPay.api_path}/users/#{user_id}/recipients/#{recipient_id}/mandates"
32
+ MangoPay.request(:get, url, {}, filters)
33
+ end
34
+
30
35
  # Fetches list of transactions belonging to given +mandate_id+.
31
36
  #
32
37
  # Optional +filters+ is a hash accepting following keys:
@@ -59,10 +59,17 @@ module MangoPay
59
59
  "#{MangoPay.api_path}/payins/preauthorized/direct"
60
60
  end
61
61
 
62
+ # <b>DEPRECATED</b>: 'create_pre_authorized_deposit_pay_in' function is now deprecated.
63
+ # Please use 'create_pre_authorized_extended_pay_in' instead.
62
64
  def self.create_pre_authorized_deposit_pay_in(params, idempotency_key = nil)
65
+ warn "[DEPRECATION] MangoPay::PayIn::PreAuthorized::Direct.create_pre_authorized_deposit_pay_in is deprecated. Please use create_pre_authorized_extended_pay_in instead."
63
66
  MangoPay.request(:post, "#{MangoPay.api_path}/payins/deposit-preauthorized/direct/full-capture", params, {}, idempotency_key)
64
67
  end
65
68
 
69
+ def self.create_pre_authorized_extended_pay_in(params, idempotency_key = nil)
70
+ MangoPay.request(:post, "#{MangoPay.api_path}/payins/extended-preauthorized/direct/full-capture", params, {}, idempotency_key)
71
+ end
72
+
66
73
  # <b>DEPRECATED</b>: 'create_deposit_preauthorized_pay_in_prior_to_complement' function is now deprecated.
67
74
  def self.create_deposit_preauthorized_pay_in_prior_to_complement(params, idempotency_key = nil)
68
75
  warn "[DEPRECATION] MangoPay::PayIn::PreAuthorized::Direct.create_deposit_preauthorized_pay_in_prior_to_complement is deprecated."
@@ -425,6 +432,10 @@ module MangoPay
425
432
  MangoPay.request(:get, "#{MangoPay.api_path_v3}/payins/intents/#{intent_id}")
426
433
  end
427
434
 
435
+ def get_all(filters = {})
436
+ MangoPay.request(:get, "#{MangoPay.api_path_v3}/payins/intents", {}, filters)
437
+ end
438
+
428
439
  def cancel(intent_id, params, idempotency_key = nil)
429
440
  MangoPay.request(:post, "#{MangoPay.api_path_v3}/payins/intents/#{intent_id}/cancel", params, {}, idempotency_key)
430
441
  end
@@ -453,6 +464,10 @@ module MangoPay
453
464
  MangoPay.request(:get, "#{MangoPay.api_path_v3}/payins/intents/#{intent_id}/splits/#{split_id}")
454
465
  end
455
466
 
467
+ def get_all(filters = {})
468
+ MangoPay.request(:get, "#{MangoPay.api_path_v3}/payins/intents/splits", {}, filters)
469
+ end
470
+
456
471
  def update(intent_id, split_id, params)
457
472
  MangoPay.request(:put, "#{MangoPay.api_path_v3}/payins/intents/#{intent_id}/splits/#{split_id}", params)
458
473
  end
@@ -12,6 +12,11 @@ module MangoPay
12
12
  MangoPay.request(:get, url)
13
13
  end
14
14
 
15
+ def get_all(filters = {})
16
+ url = "#{MangoPay.api_path_v3}/payins/intents/settlements"
17
+ MangoPay.request(:get, url, {}, filters)
18
+ end
19
+
15
20
  def generate_new_upload_url(settlement_id, settlement)
16
21
  url = "#{MangoPay.api_path_v3}/payins/intents/settlements/#{settlement_id}"
17
22
  MangoPay.request(:put, url, settlement, {})
@@ -1,3 +1,3 @@
1
1
  module MangoPay
2
- VERSION = '4.0.0'
2
+ VERSION = '4.2.0'
3
3
  end
data/lib/mangopay.rb CHANGED
@@ -50,6 +50,7 @@ module MangoPay
50
50
  autoload :Ubo, 'mangopay/ubo'
51
51
  autoload :Regulatory, 'mangopay/regulatory'
52
52
  autoload :Deposit, 'mangopay/deposit'
53
+ autoload :ExtendedPreauthorization, 'mangopay/extended_preauthorization'
53
54
  autoload :Conversion, 'mangopay/conversion'
54
55
  autoload :PaymentMethodMetadata, 'mangopay/payment_method_metadata'
55
56
  autoload :VirtualAccount, 'mangopay/virtual_account'
@@ -250,8 +251,8 @@ module MangoPay
250
251
  raise MangoPay::ResponseError.new(uri, res.code, details)
251
252
  end
252
253
 
253
- unless res.is_a?(Net::HTTPOK) or res.is_a?(Net::HTTPCreated) or res.is_a?(Net::HTTPNoContent)
254
- if res.is_a?(Net::HTTPUnauthorized) and res['www-authenticate'] != nil
254
+ unless res.is_a?(Net::HTTPOK) || res.is_a?(Net::HTTPCreated) || res.is_a?(Net::HTTPNoContent)
255
+ if res.is_a?(Net::HTTPUnauthorized) && res['www-authenticate'] != nil
255
256
  redirect_url = res['www-authenticate'][/RedirectUrl=(.+)/, 1]
256
257
  data['RedirectUrl'] = redirect_url
257
258
  data['message'] = 'SCA required to perform this action.'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mangopay4-ruby-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.2.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: 2026-09-02 00:00:00.000000000 Z
12
+ date: 2026-10-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: multi_json
@@ -95,6 +95,7 @@ files:
95
95
  - lib/mangopay/dispute.rb
96
96
  - lib/mangopay/errors.rb
97
97
  - lib/mangopay/event.rb
98
+ - lib/mangopay/extended_preauthorization.rb
98
99
  - lib/mangopay/filter_parameters.rb
99
100
  - lib/mangopay/hook.rb
100
101
  - lib/mangopay/http_calls.rb