mangopay 3.31.0 → 3.33.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/.github/workflows/ruby_cd.yml +1 -1
- data/.github/workflows/ruby_ci.yml +1 -1
- data/CHANGELOG.md +35 -0
- data/lib/mangopay/http_calls.rb +4 -1
- data/lib/mangopay/legal_user.rb +3 -0
- data/lib/mangopay/legal_user_sca.rb +4 -0
- data/lib/mangopay/natural_user.rb +6 -0
- data/lib/mangopay/natural_user_sca.rb +4 -0
- data/lib/mangopay/recipient.rb +35 -0
- data/lib/mangopay/version.rb +1 -1
- data/lib/mangopay.rb +8 -1
- data/spec/mangopay/client_spec.rb +2 -2
- data/spec/mangopay/kyc_document_spec.rb +2 -2
- data/spec/mangopay/payin_blik_web_spec.rb +9 -0
- data/spec/mangopay/recipient_spec.rb +113 -0
- data/spec/mangopay/shared_resources.rb +66 -2
- data/spec/mangopay/user_spec.rb +32 -0
- data/spec/mangopay/wallet_spec.rb +15 -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: e2ea73775e3cbe39be6e8c2ab08353e325e4022c8e880c91ec39a2f7815158a5
|
4
|
+
data.tar.gz: e7a4e7daa408c976653cc7b45bb143e1e7d88b8c8267980bc26a03cd9483e100
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a237843330abcee5203d85c86fcfcdf4d4e549b1ff3c0662f502d9d064de94de512dd358a26b930a55ae133852bf8aba5b92b91c3f92391806b1cc47797977e4
|
7
|
+
data.tar.gz: c15777f6e7043c031371dcf1aaca92ed2396402c68fa9a3c2d8ab0e8a8cf6bfdb4f516b55602d5fa32ae543bbb9254e0b3fc0f557630e7e1806601d3b4043a02
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,38 @@
|
|
1
|
+
## [3.33.0] - 2025-04-29
|
2
|
+
### Added
|
3
|
+
|
4
|
+
#### SCA on wallet access endpoints
|
5
|
+
|
6
|
+
`ScaContext` query parameter added on wallet access endpoints for the [introduction of SCA](https://docs.mangopay.com/guides/sca/wallets):
|
7
|
+
|
8
|
+
- [GET View a Wallet](https://docs.mangopay.com/api-reference/wallets/view-wallet)
|
9
|
+
- [GET List Wallets for a User](https://docs.mangopay.com/api-reference/wallets/list-wallets-user)
|
10
|
+
- [GET List Transactions for a User](https://docs.mangopay.com/api-reference/transactions/list-transactions-user)
|
11
|
+
- [GET List Transactions for a Wallet](https://docs.mangopay.com/api-reference/transactions/list-transactions-wallet)
|
12
|
+
|
13
|
+
If SCA is required, Mangopay responds with a 401 response code. The `PendingUserAction` `RedirectUrl` is in the dedicated `WWW-Authenticate` response header.
|
14
|
+
|
15
|
+
See the tests for examples on handling this error.
|
16
|
+
|
17
|
+
#### BLIK with code
|
18
|
+
Support for [BLIK with code endpoint](https://docs.mangopay.com/api-reference/blik/create-blik-payin-with-code)
|
19
|
+
|
20
|
+
## [3.32.0] - 2025-04-16
|
21
|
+
### Added
|
22
|
+
|
23
|
+
#### Recipients
|
24
|
+
- [GET View payout methods](/api-reference/recipients/view-payout-methods)
|
25
|
+
- [GET View the schema for a Recipient](/api-reference/recipients/view-recipient-schema)
|
26
|
+
- [POST Validate data for a Recipient](/api-reference/recipients/validate-recipient-data)
|
27
|
+
- [POST Create a Recipient](/api-reference/recipients/create-recipient)
|
28
|
+
- [GET View a Recipient](/api-reference/recipients/view-recipient)
|
29
|
+
- [GET List Recipients for a user](/api-reference/recipients/list-recipients-user)
|
30
|
+
- [PUT Deactivate a Recipient](/api-reference/recipients/deactivate-recipient)
|
31
|
+
|
32
|
+
#### Endpoints to close a user account
|
33
|
+
- [DELETE Close a Natural User](/api-reference/users/close-natural-user)
|
34
|
+
- [DELETE Close a Legal User](/api-reference/users/close-legal-user)
|
35
|
+
|
1
36
|
## [3.31.0] - 2025-04-16
|
2
37
|
### Added
|
3
38
|
- [POST Create a Pay by Bank PayIn](https://docs.mangopay.com/api-reference/pay-by-bank/create-pay-by-bank-payin)
|
data/lib/mangopay/http_calls.rb
CHANGED
@@ -52,8 +52,11 @@ 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, idempotency_key = nil)
|
55
|
+
def fetch(id_or_filters = nil, idempotency_key = nil, query_params_get_by_id = nil)
|
56
56
|
id, filters = HTTPCalls::Fetch.parse_id_or_filters(id_or_filters)
|
57
|
+
if query_params_get_by_id != nil and query_params_get_by_id != {}
|
58
|
+
filters = query_params_get_by_id
|
59
|
+
end
|
57
60
|
response = MangoPay.request(:get, url(id), {}, filters, idempotency_key)
|
58
61
|
end
|
59
62
|
end
|
data/lib/mangopay/legal_user.rb
CHANGED
@@ -0,0 +1,35 @@
|
|
1
|
+
module MangoPay
|
2
|
+
|
3
|
+
class Recipient < Resource
|
4
|
+
def self.create(params, user_id, idempotency_key = nil)
|
5
|
+
MangoPay.request(:post, "#{MangoPay.api_path}/users/#{user_id}/recipients", params, {}, idempotency_key)
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.get(recipient_id, filters = {})
|
9
|
+
MangoPay.request(:get, "#{MangoPay.api_path}/recipients/#{recipient_id}", {}, filters)
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.get_user_recipients(user_id, filters = {})
|
13
|
+
MangoPay.request(:get, "#{MangoPay.api_path}/users/#{user_id}/recipients", {}, filters)
|
14
|
+
end
|
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)
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.get_payout_methods(country, currency, filters = {})
|
21
|
+
MangoPay.request(:get, "#{MangoPay.api_path}/recipients/payout-methods?country=#{country}¤cy=#{currency}", {}, filters)
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.validate(params, user_id, idempotency_key = nil)
|
25
|
+
MangoPay.request(:post, "#{MangoPay.api_path}/users/#{user_id}/recipients/validate", params, {}, idempotency_key)
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.deactivate(recipient_id)
|
29
|
+
params = {
|
30
|
+
Status: 'DEACTIVATED'
|
31
|
+
}
|
32
|
+
MangoPay.request(:put, "#{MangoPay.api_path}/recipients/#{recipient_id}", params, {})
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
data/lib/mangopay/version.rb
CHANGED
data/lib/mangopay.rb
CHANGED
@@ -51,6 +51,7 @@ module MangoPay
|
|
51
51
|
autoload :PaymentMethodMetadata, 'mangopay/payment_method_metadata'
|
52
52
|
autoload :VirtualAccount, 'mangopay/virtual_account'
|
53
53
|
autoload :IdentityVerification, 'mangopay/identity_verification'
|
54
|
+
autoload :Recipient, 'mangopay/recipient'
|
54
55
|
|
55
56
|
# temporary
|
56
57
|
autoload :Temp, 'mangopay/temp'
|
@@ -232,7 +233,13 @@ module MangoPay
|
|
232
233
|
raise MangoPay::ResponseError.new(uri, res.code, details)
|
233
234
|
end
|
234
235
|
|
235
|
-
unless res.is_a?(Net::HTTPOK)
|
236
|
+
unless res.is_a?(Net::HTTPOK) or res.is_a?(Net::HTTPCreated) or res.is_a?(Net::HTTPNoContent)
|
237
|
+
if res.is_a?(Net::HTTPUnauthorized) and res['www-authenticate'] != nil
|
238
|
+
redirect_url = res['www-authenticate'][/RedirectUrl=(.+)/, 1]
|
239
|
+
data['RedirectUrl'] = redirect_url
|
240
|
+
data['message'] = 'SCA required to perform this action.'
|
241
|
+
raise MangoPay::ResponseError.new(uri, res.code, data)
|
242
|
+
end
|
236
243
|
raise MangoPay::ResponseError.new(uri, res.code, data)
|
237
244
|
end
|
238
245
|
|
@@ -45,13 +45,13 @@ describe MangoPay::Client do
|
|
45
45
|
bts = File.open(fnm, 'rb') { |f| f.read }
|
46
46
|
b64 = Base64.encode64(bts)
|
47
47
|
ret = MangoPay::Client.upload_logo(b64)
|
48
|
-
expect(ret).
|
48
|
+
expect(ret).to_not be_nil
|
49
49
|
end
|
50
50
|
|
51
51
|
it 'accepts file path' do
|
52
52
|
fnm = __FILE__.sub('.rb', '.png')
|
53
53
|
ret = MangoPay::Client.upload_logo(nil, fnm)
|
54
|
-
expect(ret).
|
54
|
+
expect(ret).to_not be_nil
|
55
55
|
end
|
56
56
|
|
57
57
|
it 'fails when input string is not base64-encoded' do
|
@@ -86,13 +86,13 @@ describe MangoPay::KycDocument do
|
|
86
86
|
bts = File.open(fnm, 'rb') { |f| f.read }
|
87
87
|
b64 = Base64.encode64(bts)
|
88
88
|
ret = create_page(b64)
|
89
|
-
expect(ret).
|
89
|
+
expect(ret).to_not be_nil
|
90
90
|
end
|
91
91
|
|
92
92
|
it 'accepts file path' do
|
93
93
|
fnm = __FILE__.sub('.rb', '.png')
|
94
94
|
ret = MangoPay::KycDocument.create_page(new_natural_user['Id'], new_document['Id'], nil, fnm)
|
95
|
-
expect(ret).
|
95
|
+
expect(ret).to_not be_nil
|
96
96
|
end
|
97
97
|
|
98
98
|
it 'fails when input string is not base64-encoded' do
|
@@ -17,6 +17,15 @@ describe MangoPay::PayIn::Blik::Web, type: :feature do
|
|
17
17
|
expect(created['ReturnURL']).not_to be_nil
|
18
18
|
check_type_and_status(created)
|
19
19
|
end
|
20
|
+
|
21
|
+
it 'creates a blik web payin with code' do
|
22
|
+
created = new_payin_blik_web_with_code
|
23
|
+
expect(created['Id']).not_to be_nil
|
24
|
+
expect(created['Code']).not_to be_nil
|
25
|
+
expect(created['IpAddress']).not_to be_nil
|
26
|
+
expect(created['BrowserInfo']).not_to be_nil
|
27
|
+
check_type_and_status(created)
|
28
|
+
end
|
20
29
|
end
|
21
30
|
|
22
31
|
describe 'FETCH' do
|
@@ -0,0 +1,113 @@
|
|
1
|
+
describe MangoPay::Recipient do
|
2
|
+
include_context 'recipient'
|
3
|
+
|
4
|
+
describe 'CREATE' do
|
5
|
+
it 'creates a new recipient' do
|
6
|
+
recipient = new_recipient
|
7
|
+
assert_recipient(recipient)
|
8
|
+
expect(recipient['PendingUserAction']).not_to be_nil
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
describe 'GET' do
|
13
|
+
it 'fetches a recipient' do
|
14
|
+
recipient = new_recipient
|
15
|
+
fetched = MangoPay::Recipient.get(recipient['Id'])
|
16
|
+
assert_recipient(fetched)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
describe 'GET User Recipients' do
|
21
|
+
it 'fetches a recipient' do
|
22
|
+
john = create_new_natural_user_sca_owner
|
23
|
+
create_new_recipient(john['Id'])
|
24
|
+
fetched = MangoPay::Recipient.get_user_recipients(john['Id'])
|
25
|
+
expect(fetched).not_to be_nil
|
26
|
+
expect(fetched).to be_kind_of(Array)
|
27
|
+
expect(fetched).not_to be_empty
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
describe 'GET Schema' do
|
32
|
+
it 'fetches schema for LocalBankTransfer, Individual' do
|
33
|
+
schema = MangoPay::Recipient.get_schema('LocalBankTransfer', 'Individual', 'GBP')
|
34
|
+
expect(schema).not_to be_nil
|
35
|
+
expect(schema['DisplayName']).not_to be_nil
|
36
|
+
expect(schema['Currency']).not_to be_nil
|
37
|
+
expect(schema['RecipientType']).not_to be_nil
|
38
|
+
expect(schema['PayoutMethodType']).not_to be_nil
|
39
|
+
expect(schema['RecipientScope']).not_to be_nil
|
40
|
+
expect(schema['Tag']).not_to be_nil
|
41
|
+
expect(schema['IndividualRecipient']).not_to be_nil
|
42
|
+
expect(schema['LocalBankTransfer']).not_to be_nil
|
43
|
+
expect(schema['BusinessRecipient']).to be_nil
|
44
|
+
expect(schema['InternationalBankTransfer']).to be_nil
|
45
|
+
end
|
46
|
+
|
47
|
+
it 'fetches schema for InternationalBankTransfer, Business' do
|
48
|
+
schema = MangoPay::Recipient.get_schema('InternationalBankTransfer', 'Business', 'GBP')
|
49
|
+
expect(schema).not_to be_nil
|
50
|
+
expect(schema['DisplayName']).not_to be_nil
|
51
|
+
expect(schema['Currency']).not_to be_nil
|
52
|
+
expect(schema['RecipientType']).not_to be_nil
|
53
|
+
expect(schema['PayoutMethodType']).not_to be_nil
|
54
|
+
expect(schema['RecipientScope']).not_to be_nil
|
55
|
+
expect(schema['Tag']).not_to be_nil
|
56
|
+
expect(schema['BusinessRecipient']).not_to be_nil
|
57
|
+
expect(schema['InternationalBankTransfer']).not_to be_nil
|
58
|
+
expect(schema['IndividualRecipient']).to be_nil
|
59
|
+
expect(schema['LocalBankTransfer']).to be_nil
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
describe 'GET Payout Methods' do
|
64
|
+
it 'fetches payout methods' do
|
65
|
+
payout_methods = MangoPay::Recipient.get_payout_methods('DE', 'EUR')
|
66
|
+
expect(payout_methods).not_to be_nil
|
67
|
+
expect(payout_methods['AvailablePayoutMethods']).to be_kind_of(Array)
|
68
|
+
expect(payout_methods['AvailablePayoutMethods']).not_to be_empty
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
describe 'VALIDATE' do
|
73
|
+
it 'validates a recipient' do
|
74
|
+
recipient = define_new_recipient
|
75
|
+
john = create_new_natural_user_sca_owner
|
76
|
+
# it should pass
|
77
|
+
MangoPay::Recipient.validate(recipient, john['Id'])
|
78
|
+
|
79
|
+
# it should throw error
|
80
|
+
recipient['Currency'] = nil
|
81
|
+
expect { MangoPay::Recipient.validate(recipient, john['Id']) }.to raise_error { |err|
|
82
|
+
expect(err).to be_a MangoPay::ResponseError
|
83
|
+
expect(err.code).to eq '400'
|
84
|
+
expect(err.type).to eq 'param_error'
|
85
|
+
}
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
describe 'DEACTIVATE' do
|
90
|
+
it 'deactivates a recipient' do
|
91
|
+
pending("a recipient needs to be manually activated before running the test")
|
92
|
+
john = create_new_natural_user_sca_owner
|
93
|
+
recipient = create_new_recipient(john['Id'])
|
94
|
+
deactivated = MangoPay::Recipient.deactivate(recipient['Id'])
|
95
|
+
fetched = MangoPay::Recipient.get(recipient['Id'])
|
96
|
+
expect(deactivated['Status']).to eq('DEACTIVATED')
|
97
|
+
expect(fetched['Status']).to eq('DEACTIVATED')
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
|
103
|
+
def assert_recipient(recipient)
|
104
|
+
expect(recipient).not_to be_nil
|
105
|
+
expect(recipient['Status']).not_to be_nil
|
106
|
+
expect(recipient['DisplayName']).not_to be_nil
|
107
|
+
expect(recipient['PayoutMethodType']).not_to be_nil
|
108
|
+
expect(recipient['RecipientType']).not_to be_nil
|
109
|
+
expect(recipient['IndividualRecipient']).not_to be_nil
|
110
|
+
expect(recipient['LocalBankTransfer']).not_to be_nil
|
111
|
+
expect(recipient['RecipientScope']).not_to be_nil
|
112
|
+
expect(recipient['UserId']).not_to be_nil
|
113
|
+
end
|
@@ -577,7 +577,36 @@ shared_context 'payins' do
|
|
577
577
|
Currency: 'PLN',
|
578
578
|
Tag: 'Test wallet'
|
579
579
|
)
|
580
|
-
MangoPay::PayIn::Blik::Web.create(
|
580
|
+
MangoPay::PayIn::Blik::Web.create(define_new_blik(user, wallet))
|
581
|
+
end
|
582
|
+
|
583
|
+
let(:new_payin_blik_web_with_code) do
|
584
|
+
user = new_natural_user
|
585
|
+
wallet = MangoPay::Wallet.create(
|
586
|
+
Owners: [user['Id']],
|
587
|
+
Description: 'A test wallet',
|
588
|
+
Currency: 'PLN',
|
589
|
+
Tag: 'Test wallet'
|
590
|
+
)
|
591
|
+
blik = define_new_blik(user, wallet)
|
592
|
+
blik['Code'] = '777365'
|
593
|
+
blik['IpAddress'] = '159.180.248.187'
|
594
|
+
blik['BrowserInfo'] = {
|
595
|
+
AcceptHeader: "text/html, application/xhtml+xml, application/xml;q=0.9, /;q=0.8",
|
596
|
+
JavaEnabled: true,
|
597
|
+
Language: "FR-FR",
|
598
|
+
ColorDepth: 4,
|
599
|
+
ScreenHeight: 1800,
|
600
|
+
ScreenWidth: 400,
|
601
|
+
JavascriptEnabled: true,
|
602
|
+
TimeZoneOffset: "+60",
|
603
|
+
UserAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 13_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148"
|
604
|
+
}
|
605
|
+
MangoPay::PayIn::Blik::Web.create(blik)
|
606
|
+
end
|
607
|
+
|
608
|
+
def define_new_blik(user, wallet)
|
609
|
+
{
|
581
610
|
AuthorId: user['Id'],
|
582
611
|
CreditedWalletId: wallet['Id'],
|
583
612
|
DebitedFunds: { Currency: 'PLN', Amount: 199 },
|
@@ -585,7 +614,7 @@ shared_context 'payins' do
|
|
585
614
|
StatementDescriptor: "ruby",
|
586
615
|
Tag: 'Test PayIn/Blik/Web',
|
587
616
|
ReturnURL: 'https://example.com'
|
588
|
-
|
617
|
+
}
|
589
618
|
end
|
590
619
|
|
591
620
|
###############################################
|
@@ -1205,4 +1234,39 @@ shared_context 'virtual_account' do
|
|
1205
1234
|
|
1206
1235
|
MangoPay::VirtualAccount.create(wallet_id, create_virtual_account)
|
1207
1236
|
end
|
1237
|
+
end
|
1238
|
+
|
1239
|
+
shared_context 'recipient' do
|
1240
|
+
include_context 'users'
|
1241
|
+
|
1242
|
+
let(:new_recipient) { create_new_recipient(create_new_natural_user_sca_owner['Id']) }
|
1243
|
+
|
1244
|
+
def create_new_recipient(user_id)
|
1245
|
+
MangoPay::Recipient.create(define_new_recipient, user_id)
|
1246
|
+
end
|
1247
|
+
|
1248
|
+
def define_new_recipient
|
1249
|
+
{
|
1250
|
+
"DisplayName": "Alex Smith GBP account",
|
1251
|
+
"PayoutMethodType": "LocalBankTransfer",
|
1252
|
+
"RecipientType": "Individual",
|
1253
|
+
"Currency": "GBP",
|
1254
|
+
"IndividualRecipient": {
|
1255
|
+
"FirstName": "Alex",
|
1256
|
+
"LastName": "Smith",
|
1257
|
+
"Address": {
|
1258
|
+
"AddressLine1": "10 Kingsway",
|
1259
|
+
"City": "London",
|
1260
|
+
"PostalCode": "WC2B 6LH",
|
1261
|
+
"Country": "GB"
|
1262
|
+
}
|
1263
|
+
},
|
1264
|
+
"LocalBankTransfer": {
|
1265
|
+
"GBP": {
|
1266
|
+
"SortCode": "200000",
|
1267
|
+
"AccountNumber": "55779911"
|
1268
|
+
}
|
1269
|
+
}
|
1270
|
+
}
|
1271
|
+
end
|
1208
1272
|
end
|
data/spec/mangopay/user_spec.rb
CHANGED
@@ -240,6 +240,14 @@ describe MangoPay::User do
|
|
240
240
|
expect(transactions_ids).to include payin['Id']
|
241
241
|
expect(transactions_ids).to include payout['Id']
|
242
242
|
end
|
243
|
+
|
244
|
+
it 'fetches transactions sca' do
|
245
|
+
begin
|
246
|
+
MangoPay::User.transactions(new_natural_user['Id'], {'ScaContext': 'USER_PRESENT'})
|
247
|
+
rescue MangoPay::ResponseError => ex
|
248
|
+
expect(ex.details['RedirectUrl']).not_to be_nil
|
249
|
+
end
|
250
|
+
end
|
243
251
|
end
|
244
252
|
|
245
253
|
describe 'FETCH WALLETS' do
|
@@ -256,6 +264,14 @@ describe MangoPay::User do
|
|
256
264
|
expect(wallets.count).to eq 1
|
257
265
|
expect(wallets.first['Id']).to eq wallet['Id']
|
258
266
|
end
|
267
|
+
|
268
|
+
it 'fetches wallets sca' do
|
269
|
+
begin
|
270
|
+
MangoPay::User.wallets(new_natural_user['Id'], {'ScaContext': 'USER_PRESENT'})
|
271
|
+
rescue MangoPay::ResponseError => ex
|
272
|
+
expect(ex.details['RedirectUrl']).not_to be_nil
|
273
|
+
end
|
274
|
+
end
|
259
275
|
end
|
260
276
|
|
261
277
|
describe 'FETCH CARDS' do
|
@@ -367,4 +383,20 @@ describe MangoPay::User do
|
|
367
383
|
end
|
368
384
|
end
|
369
385
|
=end
|
386
|
+
|
387
|
+
describe 'CLOSE' do
|
388
|
+
it 'closes a natural user' do
|
389
|
+
new_user = create_new_natural_user
|
390
|
+
MangoPay::NaturalUser.close(new_user['Id'])
|
391
|
+
closed = MangoPay::User.fetch(new_user['Id'])
|
392
|
+
expect(closed['UserStatus']).to eq('CLOSED')
|
393
|
+
end
|
394
|
+
|
395
|
+
it 'closes a legal user' do
|
396
|
+
new_user = new_legal_user
|
397
|
+
MangoPay::LegalUser.close(new_user['Id'])
|
398
|
+
closed = MangoPay::User.fetch(new_user['Id'])
|
399
|
+
expect(closed['UserStatus']).to eq('CLOSED')
|
400
|
+
end
|
401
|
+
end
|
370
402
|
end
|
@@ -27,6 +27,14 @@ describe MangoPay::Wallet do
|
|
27
27
|
wallet = MangoPay::Wallet.fetch(new_wallet['Id'])
|
28
28
|
expect(wallet['Id']).to eq(new_wallet['Id'])
|
29
29
|
end
|
30
|
+
|
31
|
+
it 'fetches a wallet sca' do
|
32
|
+
begin
|
33
|
+
MangoPay::Wallet.fetch(new_wallet['Id'], nil, {'ScaContext': 'USER_PRESENT'})
|
34
|
+
rescue MangoPay::ResponseError => ex
|
35
|
+
expect(ex.details['RedirectUrl']).not_to be_nil
|
36
|
+
end
|
37
|
+
end
|
30
38
|
end
|
31
39
|
|
32
40
|
describe 'FETCH TRANSACTIONS' do
|
@@ -81,5 +89,12 @@ describe MangoPay::Wallet do
|
|
81
89
|
expect(by_type_pyout.first['Id']).to eq payout['Id']
|
82
90
|
end
|
83
91
|
|
92
|
+
it 'fetches transactions sca' do
|
93
|
+
begin
|
94
|
+
MangoPay::Wallet.transactions(new_wallet['Id'], {'ScaContext': 'USER_PRESENT'})
|
95
|
+
rescue MangoPay::ResponseError => ex
|
96
|
+
expect(ex.details['RedirectUrl']).not_to be_nil
|
97
|
+
end
|
98
|
+
end
|
84
99
|
end
|
85
100
|
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.33.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-04-
|
12
|
+
date: 2025-04-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: multi_json
|
@@ -102,6 +102,7 @@ files:
|
|
102
102
|
- lib/mangopay/pay_out.rb
|
103
103
|
- lib/mangopay/payment_method_metadata.rb
|
104
104
|
- lib/mangopay/pre_authorization.rb
|
105
|
+
- lib/mangopay/recipient.rb
|
105
106
|
- lib/mangopay/refund.rb
|
106
107
|
- lib/mangopay/regulatory.rb
|
107
108
|
- lib/mangopay/report.rb
|
@@ -160,6 +161,7 @@ files:
|
|
160
161
|
- spec/mangopay/payment_method_metadata_spec.rb
|
161
162
|
- spec/mangopay/payout_bankwire_spec.rb
|
162
163
|
- spec/mangopay/preauthorization_spec.rb
|
164
|
+
- spec/mangopay/recipient_spec.rb
|
163
165
|
- spec/mangopay/recurring_payin_spec.rb
|
164
166
|
- spec/mangopay/refund_spec.rb
|
165
167
|
- spec/mangopay/regulatory_spec.rb
|
@@ -244,6 +246,7 @@ test_files:
|
|
244
246
|
- spec/mangopay/payment_method_metadata_spec.rb
|
245
247
|
- spec/mangopay/payout_bankwire_spec.rb
|
246
248
|
- spec/mangopay/preauthorization_spec.rb
|
249
|
+
- spec/mangopay/recipient_spec.rb
|
247
250
|
- spec/mangopay/recurring_payin_spec.rb
|
248
251
|
- spec/mangopay/refund_spec.rb
|
249
252
|
- spec/mangopay/regulatory_spec.rb
|