mangopay 3.35.1 → 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 +12 -0
- data/lib/mangopay/card.rb +4 -0
- data/lib/mangopay/dispute.rb +5 -0
- data/lib/mangopay/report_v2.rb +21 -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/recipient_spec.rb +5 -5
- data/spec/mangopay/report_v2_spec.rb +38 -0
- data/spec/mangopay/shared_resources.rb +1 -1
- 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,15 @@
|
|
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
|
+
|
1
13
|
## [3.35.1] - 2025-06-05
|
2
14
|
### Added
|
3
15
|
- Support for `RecipientScope` query parameter on [GET List Recipients for a User](https://docs.mangopay.com/api-reference/recipients/list-recipients-user)
|
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)
|
@@ -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/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
|
@@ -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
|
|
@@ -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 =
|
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
|
@@ -28,7 +28,7 @@ describe MangoPay::Recipient do
|
|
28
28
|
end
|
29
29
|
|
30
30
|
it 'fetches recipients with scope PAYOUT' do
|
31
|
-
john =
|
31
|
+
john = create_new_natural_user_sca_payer
|
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 =
|
40
|
+
john = create_new_natural_user_sca_payer
|
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 =
|
95
|
+
john = create_new_natural_user_sca_payer
|
96
96
|
# it should pass
|
97
97
|
MangoPay::Recipient.validate(recipient, john['Id'])
|
98
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
|
@@ -1273,7 +1273,7 @@ end
|
|
1273
1273
|
shared_context 'recipient' do
|
1274
1274
|
include_context 'users'
|
1275
1275
|
|
1276
|
-
let(:new_recipient) { create_new_recipient(
|
1276
|
+
let(:new_recipient) { create_new_recipient(create_new_natural_user_sca_payer['Id']) }
|
1277
1277
|
|
1278
1278
|
def create_new_recipient(user_id)
|
1279
1279
|
MangoPay::Recipient.create(define_new_recipient, user_id)
|
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-06-
|
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
|