mangopay 3.0.37 → 3.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -1
- data/CHANGELOG.md +95 -0
- data/README.md +2 -2
- data/lib/mangopay/client.rb +8 -2
- data/lib/mangopay/dispute.rb +8 -8
- data/lib/mangopay/errors.rb +9 -4
- data/lib/mangopay/filter_parameters.rb +2 -2
- data/lib/mangopay/http_calls.rb +2 -2
- data/lib/mangopay/kyc_document.rb +7 -7
- data/lib/mangopay/pay_out.rb +7 -2
- data/lib/mangopay/transaction.rb +3 -3
- data/lib/mangopay/ubo.rb +4 -4
- data/lib/mangopay/ubo_declaration.rb +6 -6
- data/lib/mangopay/user.rb +10 -0
- data/lib/mangopay/version.rb +1 -1
- data/lib/mangopay/wallet.rb +2 -2
- data/spec/mangopay/client_spec.png +0 -0
- data/spec/mangopay/client_spec.rb +5 -4
- data/spec/mangopay/configuration_spec.rb +5 -1
- data/spec/mangopay/dispute_spec.png +0 -0
- data/spec/mangopay/kyc_document_spec.png +0 -0
- data/spec/mangopay/log_requests_filter_spec.rb +1 -0
- data/spec/mangopay/payin_applepay_direct_spec.rb +1 -0
- data/spec/mangopay/payin_card_direct_spec.rb +1 -0
- data/spec/mangopay/payout_bankwire_spec.rb +9 -0
- data/spec/mangopay/preauthorization_spec.rb +1 -0
- data/spec/mangopay/shared_resources.rb +8 -5
- data/spec/mangopay/ubo_declaration_spec.rb +4 -4
- data/spec/mangopay/ubo_spec.rb +3 -3
- data/spec/mangopay/user_spec.rb +10 -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: f3be9c170462d86c30e551361cb135196086b166a5b4da755002635e6dffa367
|
4
|
+
data.tar.gz: f6cba5c6f4a1f3eacaa4fed0ffb484dacbf71e3d8b8f6a8cc16deca7387188ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50f20f836d5eb42c7122b2e5865d20dc6a566ad1433915eef235d9cc0dfef4d4cde39f949c050de0bfafa9510c8aa263d6091ebf7df126e77a222160db8250b2
|
7
|
+
data.tar.gz: 11a3cc3fb9ed24f8b791c331f2113bf35e388082f18f78063c3c2ded7c74d1d8cffe53016d0a4f4fc5ccb03f2a296b09fb73246801bf45b6a1011a065a78d2a0
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,98 @@
|
|
1
|
+
## [3.4.0] - 2021.05.27
|
2
|
+
## Added
|
3
|
+
|
4
|
+
### Instant payment
|
5
|
+
|
6
|
+
Mangopay introduces the instant payment mode. It allows payouts (transfer from wallet to user bank account) to be processed within 25 seconds, rather than the 48 hours for a standard payout.
|
7
|
+
|
8
|
+
You can now use this new type of payout with the Ruby SDK.
|
9
|
+
|
10
|
+
Example :
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
bankwire = MangoPay::PayOut::BankWire.get_bankwire(payout['Id'])
|
14
|
+
# where payout['Id'] is the id of an existing payout
|
15
|
+
```
|
16
|
+
|
17
|
+
Please note that this feature must be authorized and activated by MANGOPAY. More information [here](https://docs.mangopay.com/guide/instant-payment-payout).
|
18
|
+
|
19
|
+
### Accepted PRs
|
20
|
+
|
21
|
+
- Add support to create refunds for PayIn, Transfer and PayOut transactions.
|
22
|
+
- ResponseError object improvement
|
23
|
+
|
24
|
+
## [3.3.0]
|
25
|
+
## Fixed
|
26
|
+
|
27
|
+
### IBAN for testing purposes
|
28
|
+
|
29
|
+
⚠️ **IBAN provided for testing purpose should never be used outside of a testing environement!**
|
30
|
+
|
31
|
+
More information about how to test payments, click [here](https://docs.mangopay.com/guide/testing-payments).
|
32
|
+
|
33
|
+
### Others
|
34
|
+
|
35
|
+
- Adding missing json require in log requests filter spec. Thank you @Vin0uz
|
36
|
+
- Extend fetch_wallet and create_payout API. Thank you @peterb
|
37
|
+
|
38
|
+
## Added
|
39
|
+
|
40
|
+
Some of you use a lot the [PreAuthorization](https://docs.mangopay.com/endpoints/v2.01/preauthorizations#e183_the-preauthorization-object) feature of our API. To make your life easier, we have added three new events :
|
41
|
+
|
42
|
+
- PREAUTHORIZATION_CREATED
|
43
|
+
- PREAUTHORIZATION_SUCCEEDED
|
44
|
+
- PREAUTHORIZATION_FAILED
|
45
|
+
|
46
|
+
The goal is to help you monitor a PreAuthorization with a [webhook](https://docs.mangopay.com/endpoints/v2.01/hooks#e246_the-hook-object).
|
47
|
+
|
48
|
+
*Example: If a PreAuthorization is desynchronized, when the status is updated, you will be able to know it.*
|
49
|
+
|
50
|
+
|
51
|
+
|
52
|
+
## [3.2.0]
|
53
|
+
## Added
|
54
|
+
|
55
|
+
### On demand feature for 3DSv2
|
56
|
+
|
57
|
+
> **This on-demand feature is for testing purposes only and will not be available in production**
|
58
|
+
|
59
|
+
#### Request
|
60
|
+
|
61
|
+
We've added a new parameter `Requested3DSVersion` (not mandatory) that allows you to choose between versions of 3DS protocols (managed by the parameter `SecureMode`). Two values are available:
|
62
|
+
* `V1`
|
63
|
+
* `V2_1`
|
64
|
+
|
65
|
+
If nothing is sent, the flow will be 3DS V1.
|
66
|
+
|
67
|
+
The `Requested3DSVersion` may be included on all calls to the following endpoints:
|
68
|
+
* `/preauthorizations/card/direct`
|
69
|
+
* `/payins/card/direct`
|
70
|
+
|
71
|
+
#### Response
|
72
|
+
|
73
|
+
In the API response, the `Requested3DSVersion` will show the value you requested:
|
74
|
+
* `V1`
|
75
|
+
* `V2_1`
|
76
|
+
* `null` – indicates that nothing was requested
|
77
|
+
|
78
|
+
The parameter `Applied3DSVersion` shows you the version of the 3DS protocol used. Two values are possible:
|
79
|
+
* `V1`
|
80
|
+
* `V2_1`
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
## [3.1.0]
|
86
|
+
- 3DS2 integration with Shipping and Billing objects, including FirstName and LastName fields
|
87
|
+
The objects Billing and Shipping may be included on all calls to the following endpoints:
|
88
|
+
- /preauthorizations/card/direct
|
89
|
+
- /payins/card/direct
|
90
|
+
- /payins/card/web
|
91
|
+
- Enable Instant Payment for payouts by adding a new parameter PayoutModeRequested on the following endpoint /payouts/bankwire
|
92
|
+
- The new parameter PayoutModeRequested can take two differents values : "INSTANT_PAYMENT" or "STANDARD" (STANDARD = the way we procede normaly a payout request)
|
93
|
+
- This new parameter is not mandatory and if empty or not present, the payout will be "STANDARD" by default
|
94
|
+
- Instant Payment is in beta all over Europe - SEPA region
|
95
|
+
- Add test on new payout mode PayoutModeRequested
|
1
96
|
## [3.0.37] - 2020-10-30
|
2
97
|
- Card Validation endpoint fully activated
|
3
98
|
- added pre authorizations transactions method
|
data/README.md
CHANGED
@@ -15,12 +15,12 @@ Since [v3.0.17](https://github.com/Mangopay/mangopay2-ruby-sdk/releases/tag/v3.0
|
|
15
15
|
|
16
16
|
Account creation
|
17
17
|
-------------------------------------------------
|
18
|
-
You can get yourself a
|
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
19
|
|
20
20
|
## Usage
|
21
21
|
|
22
22
|
### Install
|
23
|
-
* You can get yourself a
|
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).
|
24
24
|
|
25
25
|
* Install the gem by either running ```gem install mangopay```
|
26
26
|
or by adding it to your Gemfile ```gem 'mangopay'```
|
data/lib/mangopay/client.rb
CHANGED
@@ -47,7 +47,10 @@ module MangoPay
|
|
47
47
|
# +currency_iso_code+ is currncy ISO code
|
48
48
|
# see https://docs.mangopay.com/api-references/client-wallets/
|
49
49
|
def fetch_wallet(funds_type, currency_iso_code)
|
50
|
-
|
50
|
+
method = :get
|
51
|
+
path = url() + "/wallets/#{funds_type}/#{currency_iso_code}"
|
52
|
+
yield method, path if block_given?
|
53
|
+
MangoPay.request(method, path)
|
51
54
|
end
|
52
55
|
|
53
56
|
# Fetch transactions for all your client wallets.
|
@@ -79,7 +82,10 @@ module MangoPay
|
|
79
82
|
end
|
80
83
|
|
81
84
|
def create_payout(params)
|
82
|
-
|
85
|
+
method = :post
|
86
|
+
path = url() + "/payouts"
|
87
|
+
yield method, path, params if block_given?
|
88
|
+
MangoPay.request(method, path, params)
|
83
89
|
end
|
84
90
|
|
85
91
|
end
|
data/lib/mangopay/dispute.rb
CHANGED
@@ -8,9 +8,9 @@ module MangoPay
|
|
8
8
|
include HTTPCalls::Update
|
9
9
|
class << self
|
10
10
|
|
11
|
-
def close(dispute_id)
|
11
|
+
def close(dispute_id, idempotency_key = nil)
|
12
12
|
url = url(dispute_id) + "/close/"
|
13
|
-
MangoPay.request(:put, url)
|
13
|
+
MangoPay.request(:put, url, {}, {}, idempotency_key)
|
14
14
|
end
|
15
15
|
|
16
16
|
# +contested_funds+: Money hash
|
@@ -44,7 +44,7 @@ module MangoPay
|
|
44
44
|
url = "#{MangoPay.api_path}/disputes/pendingsettlement"
|
45
45
|
MangoPay.request(:get, url, {}, filters)
|
46
46
|
end
|
47
|
-
|
47
|
+
|
48
48
|
#####################################################
|
49
49
|
# repudiations / settlement transfers
|
50
50
|
#####################################################
|
@@ -66,7 +66,7 @@ module MangoPay
|
|
66
66
|
url = "#{MangoPay.api_path}/settlements/#{transfer_id}"
|
67
67
|
MangoPay.request(:get, url)
|
68
68
|
end
|
69
|
-
|
69
|
+
|
70
70
|
#####################################################
|
71
71
|
# documents
|
72
72
|
#####################################################
|
@@ -91,13 +91,13 @@ module MangoPay
|
|
91
91
|
# Fetches list of dispute documents:
|
92
92
|
# - for the particular dispute if +dispute_id+ is provided (not nil)
|
93
93
|
# - or for all disputes otherwise.
|
94
|
-
#
|
94
|
+
#
|
95
95
|
# Optional +filters+ is a hash accepting following keys:
|
96
96
|
# - +page+, +per_page+, +sort+: pagination and sorting params (see MangoPay::HTTPCalls::Fetch::ClassMethods#fetch)
|
97
97
|
# - filters such as +Type+ (e.g. 'REFUND_PROOF') and +Status+ (e.g. 'VALIDATED')
|
98
98
|
# - +BeforeDate+ (timestamp): filters documents with CreationDate _before_ this date
|
99
99
|
# - +AfterDate+ (timestamp): filters documents with CreationDate _after_ this date
|
100
|
-
#
|
100
|
+
#
|
101
101
|
# See https://docs.mangopay.com/api-references/disputes/dispute-documents/
|
102
102
|
#
|
103
103
|
def fetch_documents(dispute_id = nil, filters = {})
|
@@ -106,12 +106,12 @@ module MangoPay
|
|
106
106
|
end
|
107
107
|
|
108
108
|
# Adds the file page (attachment) to the given document.
|
109
|
-
#
|
109
|
+
#
|
110
110
|
# See https://docs.mangopay.com/api-references/disputes/dispute-document-pages/ :
|
111
111
|
# - Document have to be in 'CREATED' Status
|
112
112
|
# - You can create as many pages as needed
|
113
113
|
# - Change Status to 'VALIDATION_ASKED' to submit dispute documents
|
114
|
-
#
|
114
|
+
#
|
115
115
|
# The file_content_base64 param may be:
|
116
116
|
# - Base64 encoded file content
|
117
117
|
# - or nil: in this case pass the file path in the next param
|
data/lib/mangopay/errors.rb
CHANGED
@@ -49,12 +49,17 @@ module MangoPay
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def type; @details['Type']; end
|
52
|
-
def
|
52
|
+
def error; @details['error']; end
|
53
|
+
def errors; @details['errors'] || error; end
|
53
54
|
|
54
55
|
def message;
|
55
|
-
|
56
|
-
|
57
|
-
|
56
|
+
if error
|
57
|
+
msg = error
|
58
|
+
else
|
59
|
+
msg = @details['Message']
|
60
|
+
msg += errors.sort.map {|k,v| " #{k}: #{v}"}.join if (errors && errors.is_a?(Hash))
|
61
|
+
msg
|
62
|
+
end
|
58
63
|
end
|
59
64
|
|
60
65
|
end
|
@@ -39,12 +39,12 @@ module MangoPay
|
|
39
39
|
@@res_confidential_params ||= [
|
40
40
|
'access_token', 'AccessKey', 'IBAN', 'CardRegistrationURL',
|
41
41
|
'PreregistrationData', 'RedirectURL', 'RegistrationData',
|
42
|
-
'SecureModeRedirectUrl'
|
42
|
+
'SecureModeRedirectUrl', 'OwnerName', 'OwnerAddress', 'BIC'
|
43
43
|
].freeze
|
44
44
|
end
|
45
45
|
|
46
46
|
def self.req_confidential_params
|
47
|
-
@@req_confidential_params ||= ['File', 'IBAN'].freeze
|
47
|
+
@@req_confidential_params ||= ['File', 'IBAN', 'OwnerName', 'OwnerAddress', 'BIC'].freeze
|
48
48
|
end
|
49
49
|
|
50
50
|
end
|
data/lib/mangopay/http_calls.rb
CHANGED
@@ -52,9 +52,9 @@ module MangoPay
|
|
52
52
|
# MangoPay::User.fetch(filter = {'page' => 2, 'per_page' => 3})
|
53
53
|
# filter # => {"page"=>2, "per_page"=>3, "total_pages"=>1969, "total_items"=>5905}
|
54
54
|
#
|
55
|
-
def fetch(id_or_filters = nil)
|
55
|
+
def fetch(id_or_filters = nil, idempotency_key = nil)
|
56
56
|
id, filters = HTTPCalls::Fetch.parse_id_or_filters(id_or_filters)
|
57
|
-
response = MangoPay.request(:get, url(id), {}, filters)
|
57
|
+
response = MangoPay.request(:get, url(id), {}, filters, idempotency_key)
|
58
58
|
end
|
59
59
|
end
|
60
60
|
|
@@ -9,20 +9,20 @@ module MangoPay
|
|
9
9
|
MangoPay.request(:post, url(user_id), params, {}, idempotency_key)
|
10
10
|
end
|
11
11
|
|
12
|
-
def update(user_id, document_id, params = {})
|
13
|
-
MangoPay.request(:put, url(user_id, document_id), params)
|
12
|
+
def update(user_id, document_id, params = {}, idempotency_key = nil)
|
13
|
+
MangoPay.request(:put, url(user_id, document_id), params, {}, idempotency_key)
|
14
14
|
end
|
15
15
|
|
16
16
|
# Fetches the KYC document belonging to the given +user_id+, with the given +document_id+.
|
17
|
-
def fetch(user_id, document_id)
|
17
|
+
def fetch(user_id, document_id, idempotency_key = nil)
|
18
18
|
url = (user_id) ? url(user_id, document_id) : "#{MangoPay.api_path}/KYC/documents/#{CGI.escape(document_id.to_s)}"
|
19
|
-
MangoPay.request(:get, url)
|
19
|
+
MangoPay.request(:get, url, {}, {}, idempotency_key)
|
20
20
|
end
|
21
21
|
|
22
22
|
# Fetches list of KYC documents:
|
23
23
|
# - for the particular user if +user_id+ is provided (not nil)
|
24
24
|
# - or for all users otherwise.
|
25
|
-
#
|
25
|
+
#
|
26
26
|
# Optional +filters+ is a hash accepting following keys:
|
27
27
|
# - +page+, +per_page+, +sort+: pagination and sorting params (see MangoPay::HTTPCalls::Fetch::ClassMethods#fetch)
|
28
28
|
# - filters such as +Type+ (e.g. 'IDENTITY_PROOF') and +Status+ (e.g. 'VALIDATED')
|
@@ -35,12 +35,12 @@ module MangoPay
|
|
35
35
|
end
|
36
36
|
|
37
37
|
# Adds the file page (attachment) to the given document.
|
38
|
-
#
|
38
|
+
#
|
39
39
|
# See http://docs.mangopay.com/api-references/kyc/pages/ :
|
40
40
|
# - Document have to be in 'CREATED' Status
|
41
41
|
# - You can create as many pages as needed
|
42
42
|
# - Change Status to 'VALIDATION_ASKED' to submit KYC documents
|
43
|
-
#
|
43
|
+
#
|
44
44
|
# The file_content_base64 param may be:
|
45
45
|
# - Base64 encoded file content
|
46
46
|
# - or nil: in this case pass the file path in the next param
|
data/lib/mangopay/pay_out.rb
CHANGED
@@ -8,9 +8,9 @@ module MangoPay
|
|
8
8
|
# - +page+, +per_page+, +sort+: pagination and sorting params (see MangoPay::HTTPCalls::Fetch::ClassMethods#fetch)
|
9
9
|
# - +Status+: TransactionStatus {CREATED, SUCCEEDED, FAILED}
|
10
10
|
# - +ResultCode+: string representing the transaction result
|
11
|
-
def self.refunds(pay_out_id, filters = {})
|
11
|
+
def self.refunds(pay_out_id, filters = {}, idempotency_key = nil)
|
12
12
|
url = url(pay_out_id) + '/refunds'
|
13
|
-
MangoPay.request(:get, url, {}, filters)
|
13
|
+
MangoPay.request(:get, url, {}, filters, idempotency_key)
|
14
14
|
end
|
15
15
|
|
16
16
|
# See http://docs.mangopay.com/api-references/pay-out-bank-wire/
|
@@ -20,6 +20,11 @@ module MangoPay
|
|
20
20
|
def self.url(*)
|
21
21
|
"#{MangoPay.api_path}/payouts/bankwire"
|
22
22
|
end
|
23
|
+
|
24
|
+
def self.get_bankwire(pay_out_id)
|
25
|
+
url = self.url() + "/" + pay_out_id
|
26
|
+
MangoPay.request(:get, url);
|
27
|
+
end
|
23
28
|
end
|
24
29
|
end
|
25
30
|
end
|
data/lib/mangopay/transaction.rb
CHANGED
@@ -3,7 +3,7 @@ module MangoPay
|
|
3
3
|
class << self
|
4
4
|
# Fetches list of transactions belonging to the given +wallet_id+.
|
5
5
|
# See also transactions for user: MangoPay::User#transactions
|
6
|
-
#
|
6
|
+
#
|
7
7
|
# Optional +filters+ is a hash accepting following keys:
|
8
8
|
# - +page+, +per_page+, +sort+: pagination and sorting params (see MangoPay::HTTPCalls::Fetch::ClassMethods#fetch)
|
9
9
|
# - +Status+: TransactionStatus {CREATED, SUCCEEDED, FAILED}
|
@@ -12,8 +12,8 @@ module MangoPay
|
|
12
12
|
# - +BeforeDate+ (timestamp): filters transactions with CreationDate _before_ this date
|
13
13
|
# - +AfterDate+ (timestamp): filters transactions with CreationDate _after_ this date
|
14
14
|
# See https://docs.mangopay.com/api-references/sort-lists/
|
15
|
-
def fetch(wallet_id, filters={})
|
16
|
-
MangoPay.request(:get, url(wallet_id), {}, filters)
|
15
|
+
def fetch(wallet_id, filters={}, headers = nil)
|
16
|
+
MangoPay.request(:get, url(wallet_id), {}, filters, headers)
|
17
17
|
end
|
18
18
|
|
19
19
|
def url(wallet_id)
|
data/lib/mangopay/ubo.rb
CHANGED
@@ -10,16 +10,16 @@ module MangoPay
|
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
|
-
def create(user_id, ubo_declaration_id, params)
|
14
|
-
MangoPay.request(:post, url(user_id, ubo_declaration_id), params)
|
13
|
+
def create(user_id, ubo_declaration_id, params, idempotency_key = nil)
|
14
|
+
MangoPay.request(:post, url(user_id, ubo_declaration_id), params, {}, idempotency_key)
|
15
15
|
end
|
16
16
|
|
17
17
|
def fetch(user_id, ubo_declaration_id, ubo_id)
|
18
18
|
MangoPay.request(:get, url(user_id, ubo_declaration_id, ubo_id))
|
19
19
|
end
|
20
20
|
|
21
|
-
def update(user_id, ubo_declaration_id, ubo_id, params)
|
22
|
-
MangoPay.request(:put, url(user_id, ubo_declaration_id, ubo_id), params)
|
21
|
+
def update(user_id, ubo_declaration_id, ubo_id, params, idempotency_key = nil)
|
22
|
+
MangoPay.request(:put, url(user_id, ubo_declaration_id, ubo_id), params, {}, idempotency_key)
|
23
23
|
end
|
24
24
|
end
|
25
25
|
end
|
@@ -10,20 +10,20 @@ module MangoPay
|
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
|
-
def create(user_id)
|
14
|
-
MangoPay.request(:post, url(user_id))
|
13
|
+
def create(user_id, idempotency_key)
|
14
|
+
MangoPay.request(:post, url(user_id), {}, {}, idempotency_key)
|
15
15
|
end
|
16
16
|
|
17
|
-
def fetch(user_id, id)
|
18
|
-
MangoPay.request(:get, url(user_id, id))
|
17
|
+
def fetch(user_id, id, idempotency_key)
|
18
|
+
MangoPay.request(:get, url(user_id, id), {}, {}, idempotency_key)
|
19
19
|
end
|
20
20
|
|
21
|
-
def update(user_id, id, params = {})
|
21
|
+
def update(user_id, id, params = {}, idempotency_key)
|
22
22
|
request_params = {
|
23
23
|
Status: params['Status'],
|
24
24
|
Ubos: params['Ubos']
|
25
25
|
}
|
26
|
-
MangoPay.request(:put, url(user_id, id), request_params)
|
26
|
+
MangoPay.request(:put, url(user_id, id), request_params, {}, idempotency_key)
|
27
27
|
end
|
28
28
|
end
|
29
29
|
end
|
data/lib/mangopay/user.rb
CHANGED
@@ -64,6 +64,16 @@ module MangoPay
|
|
64
64
|
def pre_authorizations(user_id, filters = {})
|
65
65
|
MangoPay.request(:get, url(user_id) + '/preauthorizations', {}, filters)
|
66
66
|
end
|
67
|
+
|
68
|
+
# Fetches User Block Status
|
69
|
+
def block_status(user_id, filters = {})
|
70
|
+
MangoPay.request(:get, url(user_id) + '/blockStatus', {}, filters)
|
71
|
+
end
|
72
|
+
|
73
|
+
# Fetches User Regulatory
|
74
|
+
def regulatory(user_id, filters = {})
|
75
|
+
MangoPay.request(:get, url(user_id) + '/Regulatory', {}, filters)
|
76
|
+
end
|
67
77
|
end
|
68
78
|
end
|
69
79
|
end
|
data/lib/mangopay/version.rb
CHANGED
data/lib/mangopay/wallet.rb
CHANGED
@@ -10,8 +10,8 @@ module MangoPay
|
|
10
10
|
# Optional +filters+ is a hash accepting following keys:
|
11
11
|
# - +page+, +per_page+, +sort+: pagination and sorting params (see MangoPay::HTTPCalls::Fetch::ClassMethods#fetch)
|
12
12
|
# - other keys specific for transactions filtering (see MangoPay::Transaction.fetch)
|
13
|
-
def self.transactions(wallet_id, filters = {})
|
14
|
-
Transaction.fetch(wallet_id, filters)
|
13
|
+
def self.transactions(wallet_id, filters = {}, headers = nil)
|
14
|
+
Transaction.fetch(wallet_id, filters, headers)
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
Binary file
|
@@ -151,8 +151,8 @@ describe MangoPay::Client do
|
|
151
151
|
PostalCode: '75001',
|
152
152
|
Country: 'FR'
|
153
153
|
},
|
154
|
-
IBAN: '
|
155
|
-
BIC: '
|
154
|
+
IBAN: 'FR7630004000031234567890143',
|
155
|
+
BIC: 'BNPAFRPP',
|
156
156
|
Tag: 'Test bank account')
|
157
157
|
expect(bank_account).not_to be_nil
|
158
158
|
expect(bank_account['Id']).not_to be_nil
|
@@ -172,8 +172,8 @@ describe MangoPay::Client do
|
|
172
172
|
PostalCode: '75001',
|
173
173
|
Country: 'FR'
|
174
174
|
},
|
175
|
-
IBAN: '
|
176
|
-
BIC: '
|
175
|
+
IBAN: 'FR7630004000031234567890143',
|
176
|
+
BIC: 'BNPAFRPP',
|
177
177
|
Tag: 'Test bank account')
|
178
178
|
pay_out = MangoPay::Client.create_payout(BankAccountId: bank_account['Id'],
|
179
179
|
|
@@ -183,6 +183,7 @@ describe MangoPay::Client do
|
|
183
183
|
},
|
184
184
|
DebitedWalletId: wallets[0]['Id'],
|
185
185
|
BankWireRef: 'invoice 7282',
|
186
|
+
PayoutModeRequested: 'STANDARD',
|
186
187
|
Tag: 'bla')
|
187
188
|
|
188
189
|
expect(pay_out).not_to be_nil
|
@@ -6,7 +6,11 @@ describe MangoPay::Configuration do
|
|
6
6
|
c.client_id = 'test_asd'
|
7
7
|
c.client_apiKey = '00000'
|
8
8
|
MangoPay::User.fetch()
|
9
|
-
}.to raise_error
|
9
|
+
}.to raise_error { |err|
|
10
|
+
expect(err).to be_a MangoPay::ResponseError
|
11
|
+
expect(err.code).to eq '401'
|
12
|
+
expect(err.message).to eq 'invalid_client'
|
13
|
+
}
|
10
14
|
end
|
11
15
|
|
12
16
|
it 'goes ok when calling with correct client credentials' do
|
Binary file
|
Binary file
|
@@ -11,6 +11,7 @@ describe MangoPay::PayIn::ApplePay::Direct, type: :feature do
|
|
11
11
|
|
12
12
|
describe 'CREATE' do
|
13
13
|
it 'creates a applepay direct payin' do
|
14
|
+
#pending("no cards to test for")
|
14
15
|
created = new_payin_applepay_direct
|
15
16
|
expect(created['Id']).not_to be_nil
|
16
17
|
check_type_and_status(created)
|
@@ -19,6 +19,7 @@ describe MangoPay::PayIn::Card::Direct, type: :feature do
|
|
19
19
|
it 'creates a card direct payin' do
|
20
20
|
created = new_payin_card_direct
|
21
21
|
expect(created['Id']).not_to be_nil
|
22
|
+
expect(created['Requested3DSVersion']).not_to be_nil
|
22
23
|
check_type_and_status(created)
|
23
24
|
end
|
24
25
|
end
|
@@ -40,6 +40,15 @@ describe MangoPay::PayOut::BankWire, type: :feature do
|
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
|
+
describe 'Get Bankwire' do
|
44
|
+
it 'gets a bankwire' do
|
45
|
+
created = new_payout_bankwire
|
46
|
+
fetched = MangoPay::PayOut::BankWire.get_bankwire(created['Id'])
|
47
|
+
expect(fetched['Id']).to eq(created['Id'])
|
48
|
+
expect(fetched['CreationDate']).to eq(created['CreationDate'])
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
43
52
|
describe 'FETCH' do
|
44
53
|
it 'fetches a payout' do
|
45
54
|
created = new_payout_bankwire
|
@@ -15,6 +15,7 @@ describe MangoPay::PreAuthorization do
|
|
15
15
|
expect(created['PaymentStatus']).to eq('WAITING')
|
16
16
|
expect(created['PaymentType']).to eq('CARD')
|
17
17
|
expect(created['ExecutionType']).to eq('DIRECT')
|
18
|
+
expect(created['Requested3DSVersion']).to eq('V1')
|
18
19
|
end
|
19
20
|
end
|
20
21
|
|
@@ -136,8 +136,8 @@ shared_context 'bank_accounts' do
|
|
136
136
|
PostalCode: '75001',
|
137
137
|
Country: 'FR'
|
138
138
|
},
|
139
|
-
IBAN: '
|
140
|
-
BIC: '
|
139
|
+
IBAN: 'FR7630004000031234567890143',
|
140
|
+
BIC: 'BNPAFRPP',
|
141
141
|
Tag: 'Test bank account')
|
142
142
|
end
|
143
143
|
end
|
@@ -368,7 +368,8 @@ shared_context 'payins' do
|
|
368
368
|
CardType: 'CB_VISA_MASTERCARD',
|
369
369
|
CardId: cardreg['CardId'],
|
370
370
|
SecureModeReturnURL: 'http://test.com',
|
371
|
-
Tag: 'Test PayIn/Card/Direct'
|
371
|
+
Tag: 'Test PayIn/Card/Direct',
|
372
|
+
Requested3DSVersion: 'V1'
|
372
373
|
)
|
373
374
|
end
|
374
375
|
|
@@ -385,7 +386,8 @@ shared_context 'payins' do
|
|
385
386
|
CardId: cardreg['CardId'],
|
386
387
|
SecureMode: 'DEFAULT',
|
387
388
|
SecureModeReturnURL: 'http://test.com',
|
388
|
-
Tag: 'Test Card PreAuthorization'
|
389
|
+
Tag: 'Test Card PreAuthorization',
|
390
|
+
Requested3DSVersion: 'V1'
|
389
391
|
)
|
390
392
|
end
|
391
393
|
|
@@ -437,7 +439,8 @@ shared_context 'payouts' do
|
|
437
439
|
Fees: {Currency: 'EUR', Amount: 0},
|
438
440
|
BankAccountId: new_bank_account['Id'],
|
439
441
|
Communication: 'This is a test',
|
440
|
-
Tag: 'Test PayOut/Bank/Wire'
|
442
|
+
Tag: 'Test PayOut/Bank/Wire',
|
443
|
+
PayoutModeRequested: 'Standard'
|
441
444
|
)
|
442
445
|
end
|
443
446
|
end
|
@@ -6,9 +6,9 @@ describe MangoPay::UboDeclaration do
|
|
6
6
|
it 'can fetch a UBO declaration' do
|
7
7
|
legal_user = new_legal_user
|
8
8
|
|
9
|
-
ubo_declaration = MangoPay::UboDeclaration.create(legal_user['Id'])
|
9
|
+
ubo_declaration = MangoPay::UboDeclaration.create(legal_user['Id'], nil)
|
10
10
|
|
11
|
-
ubo_declaration_byId = MangoPay::UboDeclaration.fetch(legal_user['Id'], ubo_declaration['Id'])
|
11
|
+
ubo_declaration_byId = MangoPay::UboDeclaration.fetch(legal_user['Id'], ubo_declaration['Id'], nil)
|
12
12
|
|
13
13
|
expect(ubo_declaration).not_to be_nil
|
14
14
|
expect(ubo_declaration_byId).not_to be_nil
|
@@ -17,13 +17,13 @@ describe MangoPay::UboDeclaration do
|
|
17
17
|
describe 'UPDATE' do
|
18
18
|
it 'can update a UBO declaration' do
|
19
19
|
legal_user = new_legal_user
|
20
|
-
ubo_declaration = MangoPay::UboDeclaration.create(legal_user['Id'])
|
20
|
+
ubo_declaration = MangoPay::UboDeclaration.create(legal_user['Id'], nil)
|
21
21
|
ubo_declaration['Status'] = 'VALIDATION_ASKED'
|
22
22
|
|
23
23
|
ubo = new_ubo(legal_user, ubo_declaration)
|
24
24
|
|
25
25
|
ubo_declaration['Ubos'] = [ubo]
|
26
|
-
ubo_declaration = MangoPay::UboDeclaration.update(legal_user['Id'], ubo_declaration['Id'], ubo_declaration)
|
26
|
+
ubo_declaration = MangoPay::UboDeclaration.update(legal_user['Id'], ubo_declaration['Id'], ubo_declaration, nil)
|
27
27
|
|
28
28
|
expect(ubo_declaration).not_to be_nil
|
29
29
|
expect(ubo_declaration['Status']).to eq 'VALIDATION_ASKED'
|
data/spec/mangopay/ubo_spec.rb
CHANGED
@@ -5,7 +5,7 @@ describe MangoPay::Ubo do
|
|
5
5
|
describe 'FETCH' do
|
6
6
|
it 'can fetch a Ubo' do
|
7
7
|
legal_user = new_legal_user
|
8
|
-
ubo_declaration = MangoPay::UboDeclaration.create(legal_user['Id'])
|
8
|
+
ubo_declaration = MangoPay::UboDeclaration.create(legal_user['Id'], nil)
|
9
9
|
ubo = new_ubo(legal_user, ubo_declaration)
|
10
10
|
result = MangoPay::Ubo.fetch(legal_user['Id'], ubo_declaration['Id'], ubo['Id'])
|
11
11
|
expect(result).not_to be_nil
|
@@ -16,7 +16,7 @@ describe MangoPay::Ubo do
|
|
16
16
|
describe 'CREATE' do
|
17
17
|
it 'can create a new Ubo' do
|
18
18
|
legal_user = new_legal_user
|
19
|
-
ubo_declaration = MangoPay::UboDeclaration.create(legal_user['Id'])
|
19
|
+
ubo_declaration = MangoPay::UboDeclaration.create(legal_user['Id'], nil)
|
20
20
|
result = new_ubo(legal_user, ubo_declaration)
|
21
21
|
expect(result).not_to be_nil
|
22
22
|
end
|
@@ -25,7 +25,7 @@ describe MangoPay::Ubo do
|
|
25
25
|
describe 'UPDATE' do
|
26
26
|
it 'can update a Ubo' do
|
27
27
|
legal_user = new_legal_user
|
28
|
-
ubo_declaration = MangoPay::UboDeclaration.create(legal_user['Id'])
|
28
|
+
ubo_declaration = MangoPay::UboDeclaration.create(legal_user['Id'], nil)
|
29
29
|
ubo = new_ubo(legal_user, ubo_declaration)
|
30
30
|
ubo['FirstName'] = 'Santa'
|
31
31
|
ubo['LastName'] = 'Clause'
|
data/spec/mangopay/user_spec.rb
CHANGED
@@ -208,4 +208,14 @@ describe MangoPay::User do
|
|
208
208
|
expect(pre_authorizations).to be_an(Array)
|
209
209
|
end
|
210
210
|
end
|
211
|
+
|
212
|
+
=begin
|
213
|
+
describe 'FETCH Block Status' do
|
214
|
+
it "fetches user's block status" do
|
215
|
+
legal_user = new_legal_user
|
216
|
+
block_status = MangoPay::User.block_status(legal_user['Id'])
|
217
|
+
expect(block_status).to_not be_nil
|
218
|
+
end
|
219
|
+
end
|
220
|
+
=end
|
211
221
|
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.0
|
4
|
+
version: 3.4.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:
|
12
|
+
date: 2021-05-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: multi_json
|