mangopay4-ruby-sdk 4.0.0 → 4.1.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 +4 -4
- data/CHANGELOG.md +16 -0
- data/lib/mangopay/deposit.rb +3 -0
- data/lib/mangopay/extended_preauthorization.rb +32 -0
- data/lib/mangopay/http_calls.rb +1 -1
- data/lib/mangopay/pay_in.rb +7 -0
- data/lib/mangopay/version.rb +1 -1
- data/lib/mangopay.rb +3 -2
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 043facedde7d0e2e39ee93b0725498ecd735f9b630d186118b9a61d07140296e
|
|
4
|
+
data.tar.gz: b587b64329a5c61b09656b305e6fb8f08eed2a8b06ed4f5130567d3a1fd0548b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4565aadf4d1a72baee4ca3b60c067e3479f01a79028bb00f38ce7d9bcb81329cff055d70c8dc82d37e676593a95956d19a4e19fec7b89127c9448128872e6659
|
|
7
|
+
data.tar.gz: 8cc922b2fc56c0097abb4ef1031ea38d1e00f6ca43d9f87e0208167f186aada60a63455d8dc1d036fe2fc6fbac611ee504c26cccb2568eb2731140b195b6d93f
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
## [4.1.0] - 2026-10-01
|
|
2
|
+
### Added – Extended Preauthorizations
|
|
3
|
+
- Added `MangoPay::ExtendedPreauthorization` with:
|
|
4
|
+
- `create` – create an extended preauthorization (card/direct)
|
|
5
|
+
- `create_paypal_preauthorization` – create an extended preauthorization via PayPal
|
|
6
|
+
- `get` – fetch an extended preauthorization by id
|
|
7
|
+
- `update` – update an extended preauthorization. To cancel one, call `update` with `{ PaymentStatus: 'CANCELED' }`
|
|
8
|
+
- `get_all_for_user` – list a user's extended preauthorizations
|
|
9
|
+
- `get_all_for_card` – list a card's extended preauthorizations
|
|
10
|
+
- `get_transactions` – list an extended preauthorization's transactions
|
|
11
|
+
- Added `MangoPay::PayIn::PreAuthorized::Direct.create_pre_authorized_extended_pay_in` for extended preauthorized pay-ins
|
|
12
|
+
|
|
13
|
+
#### Deprecated
|
|
14
|
+
- `MangoPay::Deposit` – use `MangoPay::ExtendedPreauthorization` instead
|
|
15
|
+
- `MangoPay::PayIn::PreAuthorized::Direct.create_pre_authorized_deposit_pay_in` – use `create_pre_authorized_extended_pay_in` instead
|
|
16
|
+
|
|
1
17
|
## [4.0.0] - 2026-09-02
|
|
2
18
|
### Infrastructure – CI/CD Migration
|
|
3
19
|
|
data/lib/mangopay/deposit.rb
CHANGED
|
@@ -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
|
data/lib/mangopay/http_calls.rb
CHANGED
|
@@ -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
|
|
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)
|
data/lib/mangopay/pay_in.rb
CHANGED
|
@@ -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."
|
data/lib/mangopay/version.rb
CHANGED
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)
|
|
254
|
-
if res.is_a?(Net::HTTPUnauthorized)
|
|
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.
|
|
4
|
+
version: 4.1.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-
|
|
12
|
+
date: 2026-10-01 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
|