mangopay 3.35.0 → 3.36.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 +20 -0
- data/lib/mangopay/card.rb +4 -0
- data/lib/mangopay/dispute.rb +5 -0
- data/lib/mangopay/pay_in.rb +4 -0
- data/lib/mangopay/report_v2.rb +21 -0
- data/lib/mangopay/user.rb +4 -0
- data/lib/mangopay/version.rb +1 -1
- data/lib/mangopay.rb +1 -0
- data/spec/mangopay/card_registration_spec.rb +13 -0
- data/spec/mangopay/dispute_spec.rb +6 -3
- data/spec/mangopay/payin_payconiq_web_spec.rb +6 -0
- data/spec/mangopay/recipient_spec.rb +22 -4
- data/spec/mangopay/report_v2_spec.rb +38 -0
- data/spec/mangopay/shared_resources.rb +13 -1
- data/spec/mangopay/user_spec.rb +26 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e7c13389de9248688caaafdb17c31f307c06626b42f3062c963001d8f0a6910
|
4
|
+
data.tar.gz: 57c70a006da5aa84d3250683183aafe354b3fb549099cd6d428f66b252a1623e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d662e3de61baec5457c58ef57a477a463177460acb6a7e9f193ce5e7ceef8023bb490bb9b47e10a357cec10f2444e4ee29b813af371449d6c87143695201cfeb
|
7
|
+
data.tar.gz: e8e73b9ce2db464f598366e6ff558980d676df136ab4f16df9e696f8995d4417163272f2bbfdd4be7c574493bd8c46dc7a68e811cf9a4412d7c5fa3c5352530d
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,23 @@
|
|
1
|
+
## [3.36.0] - 2025-06-24
|
2
|
+
### Added
|
3
|
+
|
4
|
+
[New Reporting Service](https://docs.mangopay.com/release-notes/api/2025-06-05) endpoints (#287 ):
|
5
|
+
- [POST Create a Report](https://docs.mangopay.com/api-reference/reporting/create-report)
|
6
|
+
- [GET View a Report](https://docs.mangopay.com/api-reference/reporting/view-report)
|
7
|
+
- [GET List all Reports](https://docs.mangopay.com/api-reference/reporting/list-reports)
|
8
|
+
|
9
|
+
Support for:
|
10
|
+
- [GET List Disputes for a PayIn](https://docs.mangopay.com/api-reference/disputes/list-disputes-payin) (#287)
|
11
|
+
- [GET List Transactions for a Card Fingerprint](https://docs.mangopay.com/api-reference/transactions/list-transactions-card-fingerprint) (#289)
|
12
|
+
|
13
|
+
## [3.35.1] - 2025-06-05
|
14
|
+
### Added
|
15
|
+
- Support for `RecipientScope` query parameter on [GET List Recipients for a User](https://docs.mangopay.com/api-reference/recipients/list-recipients-user)
|
16
|
+
- [POST Validate the format of User data](https://docs.mangopay.com/api-reference/user-data-format/validate-user-data-format)
|
17
|
+
|
18
|
+
### Fixed
|
19
|
+
- Support for legacy Payconiq integration via `MangoPay::PayIn::Payconiq::Web.create_legacy` (removed in error).
|
20
|
+
|
1
21
|
## [3.35.0] - 2025-05-23
|
2
22
|
### Added
|
3
23
|
|
data/lib/mangopay/card.rb
CHANGED
@@ -45,6 +45,10 @@ module MangoPay
|
|
45
45
|
url = "#{MangoPay.api_path}/cards/#{card_id}/validation/#{validation_id}"
|
46
46
|
MangoPay.request(:get, url)
|
47
47
|
end
|
48
|
+
|
49
|
+
def get_transactions_by_fingerprint(fingerprint, filters = {})
|
50
|
+
MangoPay.request(:get, "#{fingerprint_url(fingerprint)}/transactions", {}, filters)
|
51
|
+
end
|
48
52
|
end
|
49
53
|
end
|
50
54
|
end
|
data/lib/mangopay/dispute.rb
CHANGED
@@ -40,6 +40,11 @@ module MangoPay
|
|
40
40
|
MangoPay.request(:get, url, {}, filters)
|
41
41
|
end
|
42
42
|
|
43
|
+
def fetch_for_pay_in(pay_in_id, filters = {})
|
44
|
+
url = "#{MangoPay.api_path}/payins/#{pay_in_id}/disputes"
|
45
|
+
MangoPay.request(:get, url, {}, filters)
|
46
|
+
end
|
47
|
+
|
43
48
|
def fetch_pending_settlement(filters = {})
|
44
49
|
url = "#{MangoPay.api_path}/disputes/pendingsettlement"
|
45
50
|
MangoPay.request(:get, url, {}, filters)
|
data/lib/mangopay/pay_in.rb
CHANGED
@@ -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
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module MangoPay
|
2
|
+
|
3
|
+
# See https://docs.mangopay.com/endpoints/v2.01/reporting
|
4
|
+
class ReportV2 < Resource
|
5
|
+
|
6
|
+
class << self
|
7
|
+
def create(params, idempotency_key = nil)
|
8
|
+
MangoPay.request(:post, "#{MangoPay.api_path}/reporting/reports", params, {}, idempotency_key)
|
9
|
+
end
|
10
|
+
|
11
|
+
def get(id)
|
12
|
+
MangoPay.request(:get, "#{MangoPay.api_path}/reporting/reports/#{id}")
|
13
|
+
end
|
14
|
+
|
15
|
+
def get_all(params = nil)
|
16
|
+
MangoPay.request(:get, "#{MangoPay.api_path}/reporting/reports", params)
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
21
|
+
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
|
data/lib/mangopay/version.rb
CHANGED
data/lib/mangopay.rb
CHANGED
@@ -38,6 +38,7 @@ module MangoPay
|
|
38
38
|
autoload :Dispute, 'mangopay/dispute'
|
39
39
|
autoload :Mandate, 'mangopay/mandate'
|
40
40
|
autoload :Report, 'mangopay/report'
|
41
|
+
autoload :ReportV2, 'mangopay/report_v2'
|
41
42
|
autoload :JSON, 'mangopay/json'
|
42
43
|
autoload :AuthorizationToken, 'mangopay/authorization_token'
|
43
44
|
autoload :FilterParameters, 'mangopay/filter_parameters'
|
@@ -107,4 +107,17 @@ describe MangoPay::CardRegistration do
|
|
107
107
|
expect(card_validation['Id']).equal? fetched_card_validation['Id']
|
108
108
|
end
|
109
109
|
end
|
110
|
+
|
111
|
+
describe 'Get transactions by card fingerprint' do
|
112
|
+
it 'retrieves list of transactions for a fingerprint' do
|
113
|
+
completed = new_card_registration_completed
|
114
|
+
card_id = completed['CardId']
|
115
|
+
card = MangoPay::Card.fetch(card_id)
|
116
|
+
fingerprint = card['Fingerprint']
|
117
|
+
result = MangoPay::Card.get_transactions_by_fingerprint(fingerprint)
|
118
|
+
|
119
|
+
expect(result).to be_kind_of(Array)
|
120
|
+
expect(result.count).to be > 0
|
121
|
+
end
|
122
|
+
end
|
110
123
|
end
|
@@ -49,14 +49,17 @@ and it's infact not suitable like that
|
|
49
49
|
expect(disputes).not_to be_empty
|
50
50
|
end
|
51
51
|
it 'fetches disputes for wallet' do
|
52
|
-
|
53
|
-
expect(dispute).not_to be_nil, "Cannot test fetching disputes for wallet because there's no disputes with transaction ID in the disputes list."
|
54
|
-
payin = MangoPay::PayIn.fetch(dispute['InitialTransactionId'])
|
52
|
+
payin = MangoPay::PayIn.fetch("133379281")
|
55
53
|
wallet_id = payin['CreditedWalletId']
|
56
54
|
disputes = MangoPay::Dispute.fetch_for_wallet(wallet_id, {'per_page' => 1})
|
57
55
|
expect(disputes).to be_kind_of(Array)
|
58
56
|
expect(disputes).not_to be_empty
|
59
57
|
end
|
58
|
+
it 'fetches disputes for payin' do
|
59
|
+
disputes = MangoPay::Dispute.fetch_for_pay_in("133379281", {'per_page' => 1})
|
60
|
+
expect(disputes).to be_kind_of(Array)
|
61
|
+
expect(disputes).not_to be_empty
|
62
|
+
end
|
60
63
|
end
|
61
64
|
|
62
65
|
describe 'UPDATE' do
|
@@ -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
|
@@ -5,7 +5,7 @@ describe MangoPay::Recipient do
|
|
5
5
|
it 'creates a new recipient' do
|
6
6
|
recipient = new_recipient
|
7
7
|
assert_recipient(recipient)
|
8
|
-
expect(recipient['
|
8
|
+
expect(recipient['Status']).to eq('PENDING')
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
@@ -18,14 +18,32 @@ describe MangoPay::Recipient do
|
|
18
18
|
end
|
19
19
|
|
20
20
|
describe 'GET User Recipients' do
|
21
|
-
it 'fetches
|
22
|
-
john =
|
21
|
+
it 'fetches recipients without query param' do
|
22
|
+
john = create_new_natural_user_sca_payer
|
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
|
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_payer
|
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_payer
|
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
|
@@ -74,7 +92,7 @@ describe MangoPay::Recipient do
|
|
74
92
|
describe 'VALIDATE' do
|
75
93
|
it 'validates a recipient' do
|
76
94
|
recipient = define_new_recipient
|
77
|
-
john =
|
95
|
+
john = create_new_natural_user_sca_payer
|
78
96
|
# it should pass
|
79
97
|
MangoPay::Recipient.validate(recipient, john['Id'])
|
80
98
|
|
@@ -0,0 +1,38 @@
|
|
1
|
+
describe MangoPay::ReportV2 do
|
2
|
+
|
3
|
+
def create
|
4
|
+
params = {
|
5
|
+
"Tag": "Created using the Mangopay API Postman collection",
|
6
|
+
"DownloadFormat": "CSV",
|
7
|
+
"ReportType": "COLLECTED_FEES",
|
8
|
+
"AfterDate": 1740787200,
|
9
|
+
"BeforeDate": 1743544740
|
10
|
+
}
|
11
|
+
MangoPay::ReportV2.create(params)
|
12
|
+
end
|
13
|
+
|
14
|
+
describe 'CREATE' do
|
15
|
+
it 'creates a report v2' do
|
16
|
+
created = create
|
17
|
+
expect(created['Id']).to_not be_nil
|
18
|
+
expect(created['Status']).to eq("PENDING")
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
describe 'GET' do
|
23
|
+
|
24
|
+
it 'gets a report' do
|
25
|
+
created = create
|
26
|
+
fetched = MangoPay::ReportV2.get(created['Id'])
|
27
|
+
expect(fetched['Id']).to eq(created['Id'])
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'gets all the reports' do
|
31
|
+
reports = MangoPay::ReportV2.get_all
|
32
|
+
expect(reports).to be_kind_of(Array)
|
33
|
+
expect(reports).not_to be_empty
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
@@ -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
|
###############################################
|
@@ -1261,7 +1273,7 @@ end
|
|
1261
1273
|
shared_context 'recipient' do
|
1262
1274
|
include_context 'users'
|
1263
1275
|
|
1264
|
-
let(:new_recipient) { create_new_recipient(
|
1276
|
+
let(:new_recipient) { create_new_recipient(create_new_natural_user_sca_payer['Id']) }
|
1265
1277
|
|
1266
1278
|
def create_new_recipient(user_id)
|
1267
1279
|
MangoPay::Recipient.create(define_new_recipient, user_id)
|
data/spec/mangopay/user_spec.rb
CHANGED
@@ -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.
|
4
|
+
version: 3.36.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: 2025-
|
12
|
+
date: 2025-06-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: multi_json
|
@@ -106,6 +106,7 @@ files:
|
|
106
106
|
- lib/mangopay/refund.rb
|
107
107
|
- lib/mangopay/regulatory.rb
|
108
108
|
- lib/mangopay/report.rb
|
109
|
+
- lib/mangopay/report_v2.rb
|
109
110
|
- lib/mangopay/resource.rb
|
110
111
|
- lib/mangopay/transaction.rb
|
111
112
|
- lib/mangopay/transfer.rb
|
@@ -166,6 +167,7 @@ files:
|
|
166
167
|
- spec/mangopay/refund_spec.rb
|
167
168
|
- spec/mangopay/regulatory_spec.rb
|
168
169
|
- spec/mangopay/report_spec.rb
|
170
|
+
- spec/mangopay/report_v2_spec.rb
|
169
171
|
- spec/mangopay/report_wallets_spec.rb
|
170
172
|
- spec/mangopay/shared_resources.rb
|
171
173
|
- spec/mangopay/transaction_spec.rb
|
@@ -251,6 +253,7 @@ test_files:
|
|
251
253
|
- spec/mangopay/refund_spec.rb
|
252
254
|
- spec/mangopay/regulatory_spec.rb
|
253
255
|
- spec/mangopay/report_spec.rb
|
256
|
+
- spec/mangopay/report_v2_spec.rb
|
254
257
|
- spec/mangopay/report_wallets_spec.rb
|
255
258
|
- spec/mangopay/shared_resources.rb
|
256
259
|
- spec/mangopay/transaction_spec.rb
|