mangopay 3.40.2 → 3.41.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 +4 -4
- data/CHANGELOG.md +9 -0
- data/lib/mangopay/client.rb +2 -0
- data/lib/mangopay/pay_in.rb +11 -3
- data/lib/mangopay/version.rb +1 -1
- data/lib/mangopay.rb +8 -2
- data/spec/mangopay/payin_intent_spec.rb +12 -12
- data/spec/mangopay/payin_paypal_web_spec.rb +39 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b9013971a3b6fe617300168a55fcf6cd0a970463786c857d102e1dc930ee173
|
4
|
+
data.tar.gz: 62c67f789d9d1831d81bdf3a9940d340cd92be58a9b8f1ba451f48ea06f362c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a432296d798507df1115fcf3c51265e4b8be9b24fa15314116fd0e12514dbaf537c4d6020907cd0eb080d6694ef2d7820b584aa5c790cea091a43ab2956a4dff
|
7
|
+
data.tar.gz: cd818297767715b6dc51a5ad5a24d2b3a93809cef3ead895d8b4a260e88da6326e0960d1009a256955767a4fc25b89d552cbd57d493e08a294d014ee64190e5e
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
## [3.41.1] - 2025-10-10
|
2
|
+
### Added
|
3
|
+
- Configuration for `after_request_proc` to be able to check rate limits post-request (#301 - thank you @matteeyah and @robertfall for the contribution 🙏)
|
4
|
+
|
5
|
+
## [3.41.0] - 2025-10-01
|
6
|
+
### Added
|
7
|
+
- Support for the [POST Cancel an Intent](https://docs.mangopay.com/api-reference/intents/cancel-intent) endpoint for [Echo](https://docs.mangopay.com/guides/echo), Mangopay's solution for platforms working with another third-party PSP for funds acquisition (#435)
|
8
|
+
- Support for [POST Submit data for a PayPal PayIn](https://docs.mangopay.com/api-reference/paypal/submit-data-paypal-payin) endpoint (#305)
|
9
|
+
|
1
10
|
## [3.40.2] - 2025-09-02
|
2
11
|
### Changed
|
3
12
|
- OAuth token refresh buffer before expiry updated to 30s #303
|
data/lib/mangopay/client.rb
CHANGED
@@ -83,6 +83,8 @@ module MangoPay
|
|
83
83
|
MangoPay.request(method, path, params)
|
84
84
|
end
|
85
85
|
|
86
|
+
# Create a Bank Wire PayIn to the Repudiation Wallet
|
87
|
+
# see https://docs.mangopay.com/api-reference/dispute-settlement/create-bank-wire-payin-to-repudiation-wallet
|
86
88
|
def create_bank_wire_direct_pay_in(params, idempotency_key = nil)
|
87
89
|
MangoPay.request(:post, url() + "/payins/bankwire/direct", params, {}, idempotency_key)
|
88
90
|
end
|
data/lib/mangopay/pay_in.rb
CHANGED
@@ -135,6 +135,14 @@ module MangoPay
|
|
135
135
|
def self.add_paypal_tracking_information(pay_in_id, params, idempotency_key = nil)
|
136
136
|
MangoPay.request(:put, "#{MangoPay.api_path}/payins/#{pay_in_id}/trackings", params, {}, idempotency_key)
|
137
137
|
end
|
138
|
+
|
139
|
+
def self.create_data_collection(params, idempotency_key = nil)
|
140
|
+
MangoPay.request(:post, "#{MangoPay.api_path}/payins/payment-methods/paypal/data-collection", params, {}, idempotency_key)
|
141
|
+
end
|
142
|
+
|
143
|
+
def self.get_data_collection(data_collection_id, idempotency_key = nil)
|
144
|
+
MangoPay.request(:get, "#{MangoPay.api_path}/payins/payment-methods/paypal/data-collection/#{data_collection_id}")
|
145
|
+
end
|
138
146
|
end
|
139
147
|
|
140
148
|
end
|
@@ -372,9 +380,9 @@ module MangoPay
|
|
372
380
|
MangoPay.request(:get, "#{MangoPay.api_path_v3}/payins/intents/#{intent_id}")
|
373
381
|
end
|
374
382
|
|
375
|
-
|
376
|
-
|
377
|
-
|
383
|
+
def cancel(intent_id, params, idempotency_key = nil)
|
384
|
+
MangoPay.request(:post, "#{MangoPay.api_path_v3}/payins/intents/#{intent_id}/cancel", params, {}, idempotency_key)
|
385
|
+
end
|
378
386
|
end
|
379
387
|
end
|
380
388
|
|
data/lib/mangopay/version.rb
CHANGED
data/lib/mangopay.rb
CHANGED
@@ -65,7 +65,8 @@ module MangoPay
|
|
65
65
|
:client_id, :client_apiKey,
|
66
66
|
:temp_dir, :log_file, :log_trace_headers, :http_timeout,
|
67
67
|
:http_max_retries, :http_open_timeout,
|
68
|
-
:logger, :use_ssl, :uk_header_flag
|
68
|
+
:logger, :use_ssl, :uk_header_flag,
|
69
|
+
:after_request_proc
|
69
70
|
|
70
71
|
def apply_configuration
|
71
72
|
MangoPay.configure do |config|
|
@@ -80,6 +81,7 @@ module MangoPay
|
|
80
81
|
config.use_ssl = @use_ssl
|
81
82
|
config.logger = @logger
|
82
83
|
config.uk_header_flag = @uk_header_flag
|
84
|
+
config.after_request_proc = @after_request_proc
|
83
85
|
end
|
84
86
|
end
|
85
87
|
|
@@ -110,7 +112,7 @@ module MangoPay
|
|
110
112
|
|
111
113
|
true
|
112
114
|
end
|
113
|
-
|
115
|
+
|
114
116
|
def log_trace_headers
|
115
117
|
@log_trace_headers || false
|
116
118
|
end
|
@@ -266,6 +268,8 @@ module MangoPay
|
|
266
268
|
}
|
267
269
|
end
|
268
270
|
|
271
|
+
configuration.after_request_proc&.call(data)
|
272
|
+
|
269
273
|
data
|
270
274
|
end
|
271
275
|
|
@@ -328,6 +332,8 @@ module MangoPay
|
|
328
332
|
}
|
329
333
|
end
|
330
334
|
|
335
|
+
configuration.after_request_proc&.call(data)
|
336
|
+
|
331
337
|
data
|
332
338
|
end
|
333
339
|
|
@@ -62,18 +62,18 @@ describe MangoPay::PayIn::PayInIntent, type: :feature do
|
|
62
62
|
end
|
63
63
|
end
|
64
64
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
65
|
+
describe 'CANCEL' do
|
66
|
+
it 'cancels an intent' do
|
67
|
+
intent = new_payin_intent_authorization
|
68
|
+
canceled = MangoPay::PayIn::PayInIntent::Intent.cancel(intent['Id'], {
|
69
|
+
"ExternalData": {
|
70
|
+
"ExternalProcessingDate": 1728133765,
|
71
|
+
"ExternalProviderReference": SecureRandom.uuid,
|
72
|
+
}
|
73
|
+
})
|
74
|
+
expect(canceled['Status']).to eq('CANCELLED')
|
75
|
+
end
|
76
|
+
end
|
77
77
|
|
78
78
|
describe 'SPLITS' do
|
79
79
|
it 'creates a split' do
|
@@ -71,4 +71,43 @@ describe MangoPay::PayIn::PayPal::Web, type: :feature do
|
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
74
|
+
describe 'Data Collection' do
|
75
|
+
it 'creates data collection' do
|
76
|
+
created = MangoPay::PayIn::PayPal::Web.create_data_collection(get_data_collection_dto)
|
77
|
+
expect(created['dataCollectionId']).not_to be_nil
|
78
|
+
end
|
79
|
+
|
80
|
+
it 'fetches data collection' do
|
81
|
+
created = MangoPay::PayIn::PayPal::Web.create_data_collection(get_data_collection_dto)
|
82
|
+
fetched = MangoPay::PayIn::PayPal::Web.get_data_collection(created['dataCollectionId'])
|
83
|
+
expect(fetched['DataCollectionId']).to eq(created['dataCollectionId'])
|
84
|
+
expect(fetched['sender_first_name']).to eq('Jane')
|
85
|
+
expect(fetched['sender_last_name']).to eq('Doe')
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
def get_data_collection_dto
|
90
|
+
return {
|
91
|
+
"sender_account_id": "A12345N343",
|
92
|
+
"sender_first_name": "Jane",
|
93
|
+
"sender_last_name": "Doe",
|
94
|
+
"sender_email": "jane.doe@sample.com",
|
95
|
+
"sender_phone": "(042)11234567",
|
96
|
+
"sender_address_zip": "75009",
|
97
|
+
"sender_country_code": "FR",
|
98
|
+
"sender_create_date": "2012-12-09T19:14:55.277-0:00",
|
99
|
+
"sender_signup_ip": "10.220.90.20",
|
100
|
+
"sender_popularity_score": "high",
|
101
|
+
"receiver_account_id": "A12345N344",
|
102
|
+
"receiver_create_date": "2012-12-09T19:14:55.277-0:00",
|
103
|
+
"receiver_email": "jane@sample.com",
|
104
|
+
"receiver_address_country_code": "FR",
|
105
|
+
"business_name": "Jane Ltd",
|
106
|
+
"recipient_popularity_score": "high",
|
107
|
+
"first_interaction_date": "2012-12-09T19:14:55.277-0:00",
|
108
|
+
"txn_count_total": "34",
|
109
|
+
"vertical": "Household goods",
|
110
|
+
"transaction_is_tangible": "0"
|
111
|
+
}
|
112
|
+
end
|
74
113
|
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.
|
4
|
+
version: 3.41.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-
|
12
|
+
date: 2025-10-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: multi_json
|