mangopay 3.33.0 → 3.42.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 +131 -0
- data/README.md +36 -42
- data/lib/mangopay/authorization_token.rb +1 -1
- data/lib/mangopay/card.rb +4 -0
- data/lib/mangopay/client.rb +6 -0
- data/lib/mangopay/conversion.rb +10 -0
- data/lib/mangopay/deposit.rb +16 -0
- data/lib/mangopay/dispute.rb +5 -0
- data/lib/mangopay/identity_verification.rb +2 -2
- data/lib/mangopay/pay_in.rb +90 -0
- data/lib/mangopay/recipient.rb +2 -2
- data/lib/mangopay/report_v2.rb +21 -0
- data/lib/mangopay/settlement.rb +21 -0
- data/lib/mangopay/user.rb +10 -2
- data/lib/mangopay/version.rb +1 -1
- data/lib/mangopay.rb +82 -2
- data/mangopay.gemspec +3 -3
- data/spec/mangopay/card_registration_spec.rb +13 -0
- data/spec/mangopay/client_spec.rb +20 -2
- data/spec/mangopay/conversion_spec.rb +32 -0
- data/spec/mangopay/deposit_spec.rb +32 -0
- data/spec/mangopay/dispute_spec.rb +6 -3
- data/spec/mangopay/identity_verification_spec.rb +10 -15
- data/spec/mangopay/payin_bizum_web_spec.rb +54 -0
- data/spec/mangopay/payin_card_direct_spec.rb +1 -1
- data/spec/mangopay/payin_intent_spec.rb +151 -0
- data/spec/mangopay/payin_paybybank_web_spec.rb +26 -0
- data/spec/mangopay/payin_payconiq_web_spec.rb +6 -0
- data/spec/mangopay/payin_paypal_web_spec.rb +43 -2
- data/spec/mangopay/payin_preauthorized_direct_spec.rb +42 -15
- data/spec/mangopay/payout_bankwire_spec.rb +3 -3
- data/spec/mangopay/preauthorization_spec.rb +1 -1
- data/spec/mangopay/recipient_spec.rb +27 -6
- data/spec/mangopay/recurring_payin_spec.rb +3 -3
- data/spec/mangopay/report_v2_spec.rb +117 -0
- data/spec/mangopay/settlement_sample.csv +8 -0
- data/spec/mangopay/settlement_spec.rb +38 -0
- data/spec/mangopay/shared_resources.rb +113 -5
- data/spec/mangopay/user_spec.rb +46 -4
- metadata +20 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 75e70fb3e6f0127887de7a15963f3d6da46eba5ae5e442e020cb68464540f3d9
|
|
4
|
+
data.tar.gz: 2925a4605e33e3c0325522cdd3657db592b87675172ceabeb749f321ce1af2e9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '016839ec01d68ffeeff441b0f144758b911febc7ad559808f65ef57baab454f21798cc9c52ff664b4fdcb6ed3bc54fea8d3b38e3c3e2801767d9fd793eb1f915'
|
|
7
|
+
data.tar.gz: 055ae925c27dc1aed17a0f41fa2585854f156b1b206d3661d990a8bf91dbfc83ca63199f3992e83604883466bb23c972547d3364fc1d1cb78a795efdeeceb076
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,134 @@
|
|
|
1
|
+
## [3.42.0] - 2025-10-27
|
|
2
|
+
### Added
|
|
3
|
+
- New [POST Manage proxy consent for a User](https://docs.mangopay.com/api-reference/users/manage-proxy-consent) endpoint to obtain and manage user consent via the hosted SCA experience (if proxy is activated). A proxy and user consent are now required to use the `USER_NOT_PRESENT` value for `ScaContext` ([API release note](https://docs.mangopay.com/release-notes/api/2025-10-23), #310)
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
- `x-tenant-id` deprecated as no longer necessary for UK platforms; the parameter is ignored by Mangopay (#309 )
|
|
7
|
+
|
|
8
|
+
## [3.41.1] - 2025-10-10
|
|
9
|
+
### Added
|
|
10
|
+
- Configuration for `after_request_proc` to be able to check rate limits post-request (#301 - thank you @matteeyah and @robertfall for the contribution 🙏)
|
|
11
|
+
|
|
12
|
+
## [3.41.0] - 2025-10-01
|
|
13
|
+
### Added
|
|
14
|
+
- 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)
|
|
15
|
+
- Support for [POST Submit data for a PayPal PayIn](https://docs.mangopay.com/api-reference/paypal/submit-data-paypal-payin) endpoint (#305)
|
|
16
|
+
|
|
17
|
+
## [3.40.2] - 2025-09-02
|
|
18
|
+
### Changed
|
|
19
|
+
- OAuth token refresh buffer before expiry updated to 30s #303
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
- Tests #302
|
|
23
|
+
|
|
24
|
+
## [3.40.1] - 2025-08-14
|
|
25
|
+
### Added
|
|
26
|
+
- Support for [POST Create a Quoted Conversion between Client Wallets](https://docs.mangopay.com/api-reference/conversions/create-quoted-conversion-client-wallets) and [POST Create an Instant Conversion between Client Wallets](https://docs.mangopay.com/api-reference/conversions/create-instant-conversion-client-wallets) #297
|
|
27
|
+
- Support for [POST Create a Bank Wire to the Repudiation Wallet](https://docs.mangopay.com/api-reference/dispute-settlement/create-bank-wire-payin-to-repudiation-wallet) #299
|
|
28
|
+
|
|
29
|
+
## [3.40.0] - 2025-08-07
|
|
30
|
+
### Added
|
|
31
|
+
Support for new Splits endpoints for Echo (#294 , [API release note](https://docs.mangopay.com/release-notes/api/2025-07-16)):
|
|
32
|
+
- [PUT Update a Split of an Intent](https://docs.mangopay.com/api-reference/intents/update-intent-split)
|
|
33
|
+
- [POST Execute a Split of an Intent](https://docs.mangopay.com/api-reference/intents/execute-intent-split)
|
|
34
|
+
- [POST Reverse the Split of an Intent](https://docs.mangopay.com/api-reference/intents/reverse-intent-split)
|
|
35
|
+
- [GET View a Split of an Intent](https://docs.mangopay.com/api-reference/intents/view-intent-split)
|
|
36
|
+
|
|
37
|
+
New `ReportTypes` for Echo (#295, [API release note](https://docs.mangopay.com/release-notes/api/2025-08-06))):
|
|
38
|
+
- `ECHO_INTENT`
|
|
39
|
+
- `ECHO_INTENT_ACTION`
|
|
40
|
+
- `ECHO_SETTLEMENT`
|
|
41
|
+
- `ECHO_SPLIT`
|
|
42
|
+
|
|
43
|
+
## [3.39.1] - 2025-07-28
|
|
44
|
+
### Added
|
|
45
|
+
- support for new endpoint [View supported banks for Pay by Bank](https://docs.mangopay.com/api-reference/pay-by-bank/view-supported-banks-pay-by-bank), to enable presentation of banks to user before Pay by Bank payment request
|
|
46
|
+
|
|
47
|
+
## [3.39.0] - 2025-07-18
|
|
48
|
+
### Added
|
|
49
|
+
Endpoints for [Mangopay Echo](https://docs.mangopay.com/guides/echo), a solution for platforms working with another third-party PSP for funds acquisition (including via the Mirakl Connector) #291 :
|
|
50
|
+
- [POST Create an Intent](https://docs.mangopay.com/api-reference/intents/create-intent)
|
|
51
|
+
- [GET View an Intent](https://docs.mangopay.com/api-reference/intents/view-intent)
|
|
52
|
+
- [POST Create a Capture for an Intent](https://docs.mangopay.com/api-reference/intents/create-intent-capture)
|
|
53
|
+
- [POST Create a Settlement](https://docs.mangopay.com/api-reference/settlements/create-settlement)
|
|
54
|
+
- [PUT Update a Settlement](https://docs.mangopay.com/api-reference/settlements/update-settlement)
|
|
55
|
+
- [GET View a Settlement](https://docs.mangopay.com/api-reference/settlements/view-settlement)
|
|
56
|
+
- [POST Create a Split of an Intent](https://docs.mangopay.com/api-reference/intents/create-intent-split)
|
|
57
|
+
|
|
58
|
+
## [3.38.0] - 2025-07-02
|
|
59
|
+
### Added
|
|
60
|
+
- New endpoint [POST Create a Bizum PayIn](https://docs.mangopay.com/api-reference/bizum/create-bizum-payin)
|
|
61
|
+
- New webhook event types for SCA enrollment ([API release note](https://docs.mangopay.com/release-notes/api/2025-06-23)), note that these are triggered on enrollment not authentication:
|
|
62
|
+
- `SCA_ENROLLMENT_SUCCEEDED`
|
|
63
|
+
- `SCA_ENROLLMENT_FAILED`
|
|
64
|
+
- `SCA_ENROLLMENT_EXPIRED`
|
|
65
|
+
- New webhook event types for `UserCategory` change ([API release note](https://docs.mangopay.com/release-notes/api/2025-06-23) ):
|
|
66
|
+
- `USER_CATEGORY_UPDATED_TO_OWNER`
|
|
67
|
+
- `USER_CATEGORY_UPDATED_TO_PAYER`
|
|
68
|
+
- `USER_CATEGORY_UPDATED_TO_PLATFORM`
|
|
69
|
+
- Support for `PLATFORM` value to `UserCategory` enum
|
|
70
|
+
|
|
71
|
+
## [3.37.0] - 2025-06-24
|
|
72
|
+
### Changed
|
|
73
|
+
- `multi_json` library version updated to 1.15.0 (latest, release 2020) to enable compatibility with later versions of Ruby
|
|
74
|
+
|
|
75
|
+
> ⚠️ **Caution - Breaking change**
|
|
76
|
+
>
|
|
77
|
+
> If you use version 1.7.7 (2013) of the `multi_json` [gem](https://rubygems.org/gems/multi_json/versions/1.15.0) in your project, you need to update to 1.15.0 to use this version v3.37.0 of the Mangopay Ruby SDK
|
|
78
|
+
|
|
79
|
+
## [3.36.0] - 2025-06-24
|
|
80
|
+
### Added
|
|
81
|
+
|
|
82
|
+
[New Reporting Service](https://docs.mangopay.com/release-notes/api/2025-06-05) endpoints (#287 ):
|
|
83
|
+
- [POST Create a Report](https://docs.mangopay.com/api-reference/reporting/create-report)
|
|
84
|
+
- [GET View a Report](https://docs.mangopay.com/api-reference/reporting/view-report)
|
|
85
|
+
- [GET List all Reports](https://docs.mangopay.com/api-reference/reporting/list-reports)
|
|
86
|
+
|
|
87
|
+
Support for:
|
|
88
|
+
- [GET List Disputes for a PayIn](https://docs.mangopay.com/api-reference/disputes/list-disputes-payin) (#287)
|
|
89
|
+
- [GET List Transactions for a Card Fingerprint](https://docs.mangopay.com/api-reference/transactions/list-transactions-card-fingerprint) (#289)
|
|
90
|
+
|
|
91
|
+
## [3.35.1] - 2025-06-05
|
|
92
|
+
### Added
|
|
93
|
+
- Support for `RecipientScope` query parameter on [GET List Recipients for a User](https://docs.mangopay.com/api-reference/recipients/list-recipients-user)
|
|
94
|
+
- [POST Validate the format of User data](https://docs.mangopay.com/api-reference/user-data-format/validate-user-data-format)
|
|
95
|
+
|
|
96
|
+
### Fixed
|
|
97
|
+
- Support for legacy Payconiq integration via `MangoPay::PayIn::Payconiq::Web.create_legacy` (removed in error).
|
|
98
|
+
|
|
99
|
+
## [3.35.0] - 2025-05-23
|
|
100
|
+
### Added
|
|
101
|
+
|
|
102
|
+
Support for [30-day deposit preauthorization](https://docs.mangopay.com/guides/payment-methods/card/deposit-preauthorization) features:
|
|
103
|
+
- [POST Create a Deposit Preauthorized PayIn prior to complement](https://docs.mangopay.com/api-reference/deposit-preauthorizations/create-deposit-preauthorized-payin-prior-to-complement)
|
|
104
|
+
- [POST Create a Deposit Preauthorized PayIn complement](https://docs.mangopay.com/api-reference/deposit-preauthorizations/create-deposit-preauthorized-payin-complement)
|
|
105
|
+
- `NO_SHOW_REQUESTED` on `updateDeposit` method for [PUT Cancel a Deposit Preauthorization or request a no-show](https://docs.mangopay.com/api-reference/deposit-preauthorizations/cancel-deposit-preauthorization-request-no-show)
|
|
106
|
+
- [GET View a PayIn (Deposit Preauthorized Card](https://docs.mangopay.com/api-reference/deposit-preauthorizations/view-payin-deposit-preauthorized)
|
|
107
|
+
- [GET List Transactions for a Deposit Preauthorization](https://docs.mangopay.com/api-reference/transactions/list-transactions-deposit-preauthorization)
|
|
108
|
+
|
|
109
|
+
## [3.34.0] - 2025-05-14
|
|
110
|
+
### Added and refined
|
|
111
|
+
|
|
112
|
+
#### Hosted KYC/KYB endpoints
|
|
113
|
+
|
|
114
|
+
The following endpoints have been refined following the beta phase, and are now generally available:
|
|
115
|
+
- [POST Create an IDV Session](https://docs.mangopay.com/api-reference/idv-sessions/create-idv-session) (no changes)
|
|
116
|
+
- [GET View an IDV Session](https://docs.mangopay.com/api-reference/idv-sessions/view-idv-session) (includes `Checks` in response)
|
|
117
|
+
- [GET List IDV Sessions for a User](https://docs.mangopay.com/api-reference/idv-sessions/list-idv-sessions-user) (new endpoint)
|
|
118
|
+
|
|
119
|
+
The previously available endpoint GET View Checks for an IDV Session has been removed (as Checks were integrated into the GET by ID).
|
|
120
|
+
|
|
121
|
+
See the [guide](https://docs.mangopay.com/guides/users/verification/hosted) for more details.
|
|
122
|
+
|
|
123
|
+
#### Recipients
|
|
124
|
+
|
|
125
|
+
The `Country` property has been added to [Recipients](https://docs.mangopay.com/guides/sca/recipients), as a required query parameter on [GET View the schema for a Recipient](https://docs.mangopay.com/api-reference/recipients/view-recipient-schema) and as a required body parameter on [POST Validate data for a Recipient](https://docs.mangopay.com/api-reference/recipients/validate-recipient-data) and [POST Create a Recipient](https://docs.mangopay.com/api-reference/recipients/create-recipient).
|
|
126
|
+
|
|
127
|
+
### Added
|
|
128
|
+
|
|
129
|
+
- [GET List Deposit Preauthorizations for a Card](https://docs.mangopay.com/api-reference/deposit-preauthorizations/list-deposit-preauthorizations-card)
|
|
130
|
+
- [GET List Deposit Preauthorizations for a User](https://docs.mangopay.com/api-reference/deposit-preauthorizations/list-deposit-preauthorizations-user)
|
|
131
|
+
|
|
1
132
|
## [3.33.0] - 2025-04-29
|
|
2
133
|
### Added
|
|
3
134
|
|
data/README.md
CHANGED
|
@@ -1,33 +1,25 @@
|
|
|
1
|
-
# Mangopay Ruby SDK
|
|
1
|
+
# Mangopay Ruby SDK
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
See the [API documentation](http://docs.mangopay.com/api-references/)
|
|
5
|
-
for more details on the API.
|
|
3
|
+
[](https://rubygems.org/gems/mangopay)
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
Official [Mangopay Gem](https://rubygems.org/gems/mangopay) to access the [Mangopay API](https://docs.mangopay.com/api-reference) from applications written in Ruby.
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
See the [Mangopay API documentation](https://docs.mangopay.com/) for Ruby samples and details on product features. See the [SDK tests](#tests) for further usage examples.
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
## Prerequisites
|
|
10
|
+
- * A `ClientId` and an API key – if you don't have these, <a href="https://mangopay.com/contact" target="_blank">contact Sales</a> to get access to the <a href="https://hub.mangopay.com/" target="_blank">Mangopay Dashboard</a>
|
|
11
|
+
- Ruby 1.9.2 or higher (tested from 1.9.2 up to 3.4.4)
|
|
13
12
|
|
|
14
|
-
Since [v3.0.17](https://github.com/Mangopay/mangopay2-ruby-sdk/releases/tag/v3.0.17)
|
|
13
|
+
Since SDK [v3.0.17](https://github.com/Mangopay/mangopay2-ruby-sdk/releases/tag/v3.0.17), the library uses v2.01 of the API. The older API version (v2) is no longer available.
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
-------------------------------------------------
|
|
18
|
-
You can get yourself a free sandbox account or sign up for a production account by [registering on the Mangopay site](https://www.mangopay.com/start/) (note that validation of your production account involves several steps, so think about doing it in advance of when you actually want to go live).
|
|
19
|
-
|
|
20
|
-
## Usage
|
|
21
|
-
|
|
22
|
-
### Install
|
|
23
|
-
* You can get yourself a free sandbox account or sign up for a production account [on the Mangopay site](https://www.mangopay.com/start/) (note that validation of your production account will involve several steps, so think about doing it in advance of when you actually want to go live).
|
|
15
|
+
## Installation
|
|
24
16
|
|
|
25
17
|
* Install the gem by either running ```gem install mangopay```
|
|
26
18
|
or by adding it to your Gemfile ```gem 'mangopay'```
|
|
27
19
|
|
|
28
|
-
*
|
|
20
|
+
* Call ```MangoPay.configure``` in your script as shown in the snippet below.
|
|
29
21
|
|
|
30
|
-
###
|
|
22
|
+
### Usage
|
|
31
23
|
|
|
32
24
|
```ruby
|
|
33
25
|
require 'mangopay'
|
|
@@ -85,8 +77,8 @@ rescue MangoPay::ResponseError => ex
|
|
|
85
77
|
end
|
|
86
78
|
```
|
|
87
79
|
|
|
88
|
-
### Using multiple
|
|
89
|
-
|
|
80
|
+
### Using multiple Client IDs
|
|
81
|
+
The Ruby SDK offers the option to create multiple configuration objects tailored to your specific needs:
|
|
90
82
|
|
|
91
83
|
```
|
|
92
84
|
config = MangoPay::Configuration.new
|
|
@@ -94,18 +86,19 @@ config.client_id = 'your-client-id'
|
|
|
94
86
|
config.client_apiKey = 'your-api-key'
|
|
95
87
|
config.preproduction = true
|
|
96
88
|
```
|
|
97
|
-
|
|
89
|
+
|
|
90
|
+
Add them using:
|
|
98
91
|
|
|
99
92
|
`MangoPay.add_config('config1', config)`
|
|
100
93
|
|
|
101
|
-
|
|
94
|
+
And perform a call with them using:
|
|
102
95
|
|
|
103
96
|
`MangoPay.get_config('config1').apply_configuration`
|
|
104
97
|
|
|
105
|
-
The previous method configure() is still working.
|
|
98
|
+
The previous method `configure()` is still working.
|
|
106
99
|
|
|
107
|
-
### Accessing
|
|
108
|
-
|
|
100
|
+
### Accessing rate limiting headers
|
|
101
|
+
The API returns rate limiting headers which are automatically updated in the `MangoPay` object:
|
|
109
102
|
|
|
110
103
|
* X-RateLimit-Limit
|
|
111
104
|
* X-RateLimit-Remaining
|
|
@@ -121,18 +114,28 @@ Along with each request, the rate limiting headers are automatically updated in
|
|
|
121
114
|
}
|
|
122
115
|
```
|
|
123
116
|
|
|
124
|
-
|
|
117
|
+
For more information, see the [rate limiting](https://docs.mangopay.com/api-reference/overview/rate-limiting) article on the Mangopay docs.
|
|
125
118
|
|
|
126
119
|
### Log requests and responses
|
|
127
|
-
You can
|
|
120
|
+
You can enable logs by setting the ```log_file``` configuration option (see [usage](#usage) above). If you don't want logs, remove the ```log_file``` line.
|
|
128
121
|
|
|
129
122
|
Requests and responses are filtered, so confidential data is not saved in logs.
|
|
130
123
|
|
|
131
124
|
### Tests
|
|
132
|
-
Make sure that you have run:
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
125
|
+
Make sure that you have run:
|
|
126
|
+
```
|
|
127
|
+
bundle install
|
|
128
|
+
```
|
|
129
|
+
Then to run the test suite, run:
|
|
130
|
+
```
|
|
131
|
+
rspec
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## Issues
|
|
135
|
+
|
|
136
|
+
Create a [GitHub issue](https://github.com/Mangopay/mangopay2-ruby-sdk/issues) to report any problems or request features.
|
|
137
|
+
|
|
138
|
+
We aim to reply to issues and contributions in a timely manner. For additional followup or anything that can't be shared over GitHub, please get in touch with our Support teams via the <a href="https://hub.mangopay.com/" target="_blank">Mangopay Dashboard</a>.
|
|
136
139
|
|
|
137
140
|
## Contributing
|
|
138
141
|
|
|
@@ -149,10 +152,6 @@ a test!
|
|
|
149
152
|
|
|
150
153
|
5. Push to your fork and submit a pull request.
|
|
151
154
|
|
|
152
|
-
At this point you're waiting on us. We like to at least comment on, if not
|
|
153
|
-
accept, pull requests within three business days (and, typically, one business
|
|
154
|
-
day). We may suggest some changes or improvements or alternatives.
|
|
155
|
-
|
|
156
155
|
Syntax:
|
|
157
156
|
|
|
158
157
|
* Two spaces, no tabs.
|
|
@@ -160,9 +159,4 @@ Syntax:
|
|
|
160
159
|
* Prefer &&/|| over and/or.
|
|
161
160
|
* MyClass.my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
|
|
162
161
|
* a = b and not a=b.
|
|
163
|
-
* Follow the conventions you see used in the source already.
|
|
164
|
-
|
|
165
|
-
A contribution can also be as simple as a +1 on issues tickets to show us
|
|
166
|
-
what you would like to see in this gem.
|
|
167
|
-
|
|
168
|
-
That's it for now. Good Hacking...
|
|
162
|
+
* Follow the conventions you see used in the source already.
|
|
@@ -23,7 +23,7 @@ module MangoPay
|
|
|
23
23
|
req.body = 'grant_type=client_credentials'
|
|
24
24
|
req.add_field('Content-Type', 'application/x-www-form-urlencoded')
|
|
25
25
|
end)
|
|
26
|
-
token['timestamp'] = Time.now + (token['expires_in'].to_i -
|
|
26
|
+
token['timestamp'] = Time.now + (token['expires_in'].to_i - 30)
|
|
27
27
|
token['environment_key'] = env_key
|
|
28
28
|
storage.store token
|
|
29
29
|
end
|
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/client.rb
CHANGED
|
@@ -83,6 +83,12 @@ 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
|
|
88
|
+
def create_bank_wire_direct_pay_in(params, idempotency_key = nil)
|
|
89
|
+
MangoPay.request(:post, url() + "/payins/bankwire/direct", params, {}, idempotency_key)
|
|
90
|
+
end
|
|
91
|
+
|
|
86
92
|
end
|
|
87
93
|
end
|
|
88
94
|
end
|
data/lib/mangopay/conversion.rb
CHANGED
|
@@ -34,6 +34,16 @@ module MangoPay
|
|
|
34
34
|
url = "#{MangoPay.api_path}/conversions/quote/#{id}"
|
|
35
35
|
MangoPay.request(:get, url, params)
|
|
36
36
|
end
|
|
37
|
+
|
|
38
|
+
def create_client_wallets_quoted_conversion(params, idempotency_key = nil)
|
|
39
|
+
url = "#{MangoPay.api_path}/clients/conversions/quoted-conversion"
|
|
40
|
+
MangoPay.request(:post, url, params, {}, idempotency_key)
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def create_client_wallets_instant_conversion(params, idempotency_key = nil)
|
|
44
|
+
url = "#{MangoPay.api_path}/clients/conversions/instant-conversion"
|
|
45
|
+
MangoPay.request(:post, url, params, {}, idempotency_key)
|
|
46
|
+
end
|
|
37
47
|
end
|
|
38
48
|
end
|
|
39
49
|
end
|
data/lib/mangopay/deposit.rb
CHANGED
|
@@ -16,5 +16,21 @@ module MangoPay
|
|
|
16
16
|
}
|
|
17
17
|
MangoPay.request(:put, "#{MangoPay.api_path}/deposit-preauthorizations/#{deposit_id}", params)
|
|
18
18
|
end
|
|
19
|
+
|
|
20
|
+
def self.update(deposit_id, params)
|
|
21
|
+
MangoPay.request(:put, "#{MangoPay.api_path}/deposit-preauthorizations/#{deposit_id}", params)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def self.get_all_for_user(user_id, filters = {})
|
|
25
|
+
MangoPay.request(:get, "#{MangoPay.api_path}/users/#{user_id}/deposit-preauthorizations", {}, filters)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def self.get_all_for_card(card_id, filters = {})
|
|
29
|
+
MangoPay.request(:get, "#{MangoPay.api_path}/cards/#{card_id}/deposit-preauthorizations", {}, filters)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def self.get_transactions(deposit_id, filters = {})
|
|
33
|
+
MangoPay.request(:get, "#{MangoPay.api_path}/deposit-preauthorizations/#{deposit_id}/transactions", {}, filters)
|
|
34
|
+
end
|
|
19
35
|
end
|
|
20
36
|
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)
|
|
@@ -9,8 +9,8 @@ module MangoPay
|
|
|
9
9
|
MangoPay.request(:get, "#{MangoPay.api_path}/identity-verifications/#{identity_verification_id}", {}, filters)
|
|
10
10
|
end
|
|
11
11
|
|
|
12
|
-
def self.
|
|
13
|
-
MangoPay.request(:get, "#{MangoPay.api_path}/
|
|
12
|
+
def self.get_all(user_id, filters = {})
|
|
13
|
+
MangoPay.request(:get, "#{MangoPay.api_path}/users/#{user_id}/identity-verifications", {}, filters)
|
|
14
14
|
end
|
|
15
15
|
end
|
|
16
16
|
end
|
data/lib/mangopay/pay_in.rb
CHANGED
|
@@ -62,6 +62,14 @@ module MangoPay
|
|
|
62
62
|
def self.create_pre_authorized_deposit_pay_in(params, idempotency_key = nil)
|
|
63
63
|
MangoPay.request(:post, "#{MangoPay.api_path}/payins/deposit-preauthorized/direct/full-capture", params, {}, idempotency_key)
|
|
64
64
|
end
|
|
65
|
+
|
|
66
|
+
def self.create_deposit_preauthorized_pay_in_prior_to_complement(params, idempotency_key = nil)
|
|
67
|
+
MangoPay.request(:post, "#{MangoPay.api_path}/payins/deposit-preauthorized/direct/capture-with-complement", params, {}, idempotency_key)
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
def self.create_deposit_preauthorized_pay_in_complement(params, idempotency_key = nil)
|
|
71
|
+
MangoPay.request(:post, "#{MangoPay.api_path}/payins/deposit-preauthorized/direct/complement", params, {}, idempotency_key)
|
|
72
|
+
end
|
|
65
73
|
end
|
|
66
74
|
|
|
67
75
|
end
|
|
@@ -127,6 +135,14 @@ module MangoPay
|
|
|
127
135
|
def self.add_paypal_tracking_information(pay_in_id, params, idempotency_key = nil)
|
|
128
136
|
MangoPay.request(:put, "#{MangoPay.api_path}/payins/#{pay_in_id}/trackings", params, {}, idempotency_key)
|
|
129
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
|
|
130
146
|
end
|
|
131
147
|
|
|
132
148
|
end
|
|
@@ -139,6 +155,10 @@ module MangoPay
|
|
|
139
155
|
def self.url(*)
|
|
140
156
|
"#{MangoPay.api_path}/payins/payment-methods/payconiq"
|
|
141
157
|
end
|
|
158
|
+
|
|
159
|
+
def self.create_legacy(params, idempotency_key = nil)
|
|
160
|
+
MangoPay.request(:post, "#{MangoPay.api_path}/payins/payconiq/web", params, {}, idempotency_key)
|
|
161
|
+
end
|
|
142
162
|
end
|
|
143
163
|
|
|
144
164
|
end
|
|
@@ -243,6 +263,16 @@ module MangoPay
|
|
|
243
263
|
end
|
|
244
264
|
end
|
|
245
265
|
|
|
266
|
+
module Bizum
|
|
267
|
+
class Web < Resource
|
|
268
|
+
include HTTPCalls::Create
|
|
269
|
+
|
|
270
|
+
def self.url(*)
|
|
271
|
+
"#{MangoPay.api_path}/payins/payment-methods/bizum"
|
|
272
|
+
end
|
|
273
|
+
end
|
|
274
|
+
end
|
|
275
|
+
|
|
246
276
|
module Twint
|
|
247
277
|
class Web < Resource
|
|
248
278
|
include HTTPCalls::Create
|
|
@@ -270,6 +300,12 @@ module MangoPay
|
|
|
270
300
|
def self.url(*)
|
|
271
301
|
"#{MangoPay.api_path}/payins/payment-methods/openbanking"
|
|
272
302
|
end
|
|
303
|
+
|
|
304
|
+
class << self
|
|
305
|
+
def get_supported_banks(filters = {})
|
|
306
|
+
MangoPay.request(:get, "#{MangoPay.api_path}/payment-methods/openbanking/metadata/supported-banks", {}, filters)
|
|
307
|
+
end
|
|
308
|
+
end
|
|
273
309
|
end
|
|
274
310
|
end
|
|
275
311
|
|
|
@@ -321,5 +357,59 @@ module MangoPay
|
|
|
321
357
|
end
|
|
322
358
|
end
|
|
323
359
|
|
|
360
|
+
module PayInIntent
|
|
361
|
+
class Authorization < Resource
|
|
362
|
+
class << self
|
|
363
|
+
def create(params, idempotency_key = nil)
|
|
364
|
+
MangoPay.request(:post, "#{MangoPay.api_path_v3}/payins/intents", params, {}, idempotency_key)
|
|
365
|
+
end
|
|
366
|
+
end
|
|
367
|
+
end
|
|
368
|
+
|
|
369
|
+
class Capture < Resource
|
|
370
|
+
class << self
|
|
371
|
+
def create(intent_id, params, idempotency_key = nil)
|
|
372
|
+
MangoPay.request(:post, "#{MangoPay.api_path_v3}/payins/intents/#{intent_id}/captures", params, {}, idempotency_key)
|
|
373
|
+
end
|
|
374
|
+
end
|
|
375
|
+
end
|
|
376
|
+
|
|
377
|
+
class Intent < Resource
|
|
378
|
+
class << self
|
|
379
|
+
def get(intent_id)
|
|
380
|
+
MangoPay.request(:get, "#{MangoPay.api_path_v3}/payins/intents/#{intent_id}")
|
|
381
|
+
end
|
|
382
|
+
|
|
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
|
|
386
|
+
end
|
|
387
|
+
end
|
|
388
|
+
|
|
389
|
+
class Split < Resource
|
|
390
|
+
class << self
|
|
391
|
+
def create(intent_id, params, idempotency_key = nil)
|
|
392
|
+
MangoPay.request(:post, "#{MangoPay.api_path_v3}/payins/intents/#{intent_id}/splits", params, {}, idempotency_key)
|
|
393
|
+
end
|
|
394
|
+
|
|
395
|
+
def execute(intent_id, split_id, idempotency_key = nil)
|
|
396
|
+
MangoPay.request(:post, "#{MangoPay.api_path_v3}/payins/intents/#{intent_id}/splits/#{split_id}/execute", {}, {}, idempotency_key)
|
|
397
|
+
end
|
|
398
|
+
|
|
399
|
+
def reverse(intent_id, split_id, idempotency_key = nil)
|
|
400
|
+
MangoPay.request(:post, "#{MangoPay.api_path_v3}/payins/intents/#{intent_id}/splits/#{split_id}/reverse", {}, {}, idempotency_key)
|
|
401
|
+
end
|
|
402
|
+
|
|
403
|
+
def get(intent_id, split_id)
|
|
404
|
+
MangoPay.request(:get, "#{MangoPay.api_path_v3}/payins/intents/#{intent_id}/splits/#{split_id}")
|
|
405
|
+
end
|
|
406
|
+
|
|
407
|
+
def update(intent_id, split_id, params)
|
|
408
|
+
MangoPay.request(:put, "#{MangoPay.api_path_v3}/payins/intents/#{intent_id}/splits/#{split_id}", params)
|
|
409
|
+
end
|
|
410
|
+
end
|
|
411
|
+
end
|
|
412
|
+
end
|
|
413
|
+
|
|
324
414
|
end
|
|
325
415
|
end
|
data/lib/mangopay/recipient.rb
CHANGED
|
@@ -13,8 +13,8 @@ module MangoPay
|
|
|
13
13
|
MangoPay.request(:get, "#{MangoPay.api_path}/users/#{user_id}/recipients", {}, filters)
|
|
14
14
|
end
|
|
15
15
|
|
|
16
|
-
def self.get_schema(payout_method_type, recipient_type, currency, filters = {})
|
|
17
|
-
MangoPay.request(:get, "#{MangoPay.api_path}/recipients/schema?payoutMethodType=#{payout_method_type}&recipientType=#{recipient_type}¤cy=#{currency}", {}, filters)
|
|
16
|
+
def self.get_schema(payout_method_type, recipient_type, currency, country, filters = {})
|
|
17
|
+
MangoPay.request(:get, "#{MangoPay.api_path}/recipients/schema?payoutMethodType=#{payout_method_type}&recipientType=#{recipient_type}¤cy=#{currency}&country=#{country}", {}, filters)
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
def self.get_payout_methods(country, currency, 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
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module MangoPay
|
|
2
|
+
|
|
3
|
+
class Settlement < Resource
|
|
4
|
+
class << self
|
|
5
|
+
def upload(file, idempotency_key = nil)
|
|
6
|
+
url = "#{MangoPay.api_path_v3}/payins/intents/settlements"
|
|
7
|
+
MangoPay.request_multipart(:post, url, file, 'settlement_file.csv', idempotency_key)
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def get(settlement_id)
|
|
11
|
+
url = "#{MangoPay.api_path_v3}/payins/intents/settlements/#{settlement_id}"
|
|
12
|
+
MangoPay.request(:get, url)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def update(settlement_id, file, idempotency_key = nil)
|
|
16
|
+
url = "#{MangoPay.api_path_v3}/payins/intents/settlements/#{settlement_id}"
|
|
17
|
+
MangoPay.request_multipart(:put, url, file, 'settlement_file.csv', idempotency_key)
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
data/lib/mangopay/user.rb
CHANGED
|
@@ -11,11 +11,15 @@ module MangoPay
|
|
|
11
11
|
include HTTPCalls::Update
|
|
12
12
|
include HTTPCalls::Fetch
|
|
13
13
|
class << self
|
|
14
|
-
def enroll_sca(user_id)
|
|
14
|
+
def enroll_sca(user_id, idempotency_key = nil)
|
|
15
15
|
url = "#{MangoPay.api_path}/sca/users/#{user_id}/enrollment"
|
|
16
|
-
MangoPay.request(:post, url, {}, {})
|
|
16
|
+
MangoPay.request(:post, url, {}, {}, idempotency_key)
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
+
def manage_consent(user_id, idempotency_key = nil)
|
|
20
|
+
url = "#{MangoPay.api_path}/sca/users/#{user_id}/consent"
|
|
21
|
+
MangoPay.request(:post, url, {}, {}, idempotency_key)
|
|
22
|
+
end
|
|
19
23
|
|
|
20
24
|
# Fetches list of wallets belonging to the given +user_id+.
|
|
21
25
|
# Optional +filters+ is a hash accepting following keys:
|
|
@@ -87,6 +91,10 @@ module MangoPay
|
|
|
87
91
|
url = "#{MangoPay.api_path}/sca/users/#{user_id}"
|
|
88
92
|
MangoPay.request(:get, url, {}, {})
|
|
89
93
|
end
|
|
94
|
+
|
|
95
|
+
def validate_data_format(params, idempotency_key = nil)
|
|
96
|
+
MangoPay.request(:post, "#{MangoPay.api_path}/users/data-formats/validation", params, {}, idempotency_key)
|
|
97
|
+
end
|
|
90
98
|
end
|
|
91
99
|
end
|
|
92
100
|
end
|
data/lib/mangopay/version.rb
CHANGED