mangopay 3.33.0 → 3.35.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 +33 -0
- data/lib/mangopay/deposit.rb +16 -0
- data/lib/mangopay/identity_verification.rb +2 -2
- data/lib/mangopay/pay_in.rb +8 -0
- data/lib/mangopay/recipient.rb +2 -2
- data/lib/mangopay/version.rb +1 -1
- data/spec/mangopay/client_spec.rb +2 -2
- data/spec/mangopay/deposit_spec.rb +32 -0
- data/spec/mangopay/identity_verification_spec.rb +10 -15
- data/spec/mangopay/payin_preauthorized_direct_spec.rb +41 -15
- data/spec/mangopay/recipient_spec.rb +5 -2
- data/spec/mangopay/shared_resources.rb +23 -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: e11195066c9596106c5615e858bf1af13f20e4d6f6efa51675158e7d49a8348b
|
4
|
+
data.tar.gz: d789d50dfdb1cb320cc0b4dc0d3b8b7ef12aac1627da49b77abadaa502b855c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ed3eb963aa03ae1874ecab170480f6f0cae564adc7f98007724ce8f0049be680c9f013965f835e0300fcb6d46fa2497da27aa7faf310b24ca3702de72021609
|
7
|
+
data.tar.gz: 3f3e98a623f39a930ceaa2be9b747c72d7daa987bcb69a8e2a3a1883c0ca4ab93b51a98e69d383c13fc32fb17ec9dbbfb771a55698bfd47618bb15e59010ea08
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,36 @@
|
|
1
|
+
## [3.35.0] - 2025-05-23
|
2
|
+
### Added
|
3
|
+
|
4
|
+
Support for [30-day deposit preauthorization](https://docs.mangopay.com/guides/payment-methods/card/deposit-preauthorization) features:
|
5
|
+
- [POST Create a Deposit Preauthorized PayIn prior to complement](https://docs.mangopay.com/api-reference/deposit-preauthorizations/create-deposit-preauthorized-payin-prior-to-complement)
|
6
|
+
- [POST Create a Deposit Preauthorized PayIn complement](https://docs.mangopay.com/api-reference/deposit-preauthorizations/create-deposit-preauthorized-payin-complement)
|
7
|
+
- `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)
|
8
|
+
- [GET View a PayIn (Deposit Preauthorized Card](https://docs.mangopay.com/api-reference/deposit-preauthorizations/view-payin-deposit-preauthorized)
|
9
|
+
- [GET List Transactions for a Deposit Preauthorization](https://docs.mangopay.com/api-reference/transactions/list-transactions-deposit-preauthorization)
|
10
|
+
|
11
|
+
## [3.34.0] - 2025-05-14
|
12
|
+
### Added and refined
|
13
|
+
|
14
|
+
#### Hosted KYC/KYB endpoints
|
15
|
+
|
16
|
+
The following endpoints have been refined following the beta phase, and are now generally available:
|
17
|
+
- [POST Create an IDV Session](https://docs.mangopay.com/api-reference/idv-sessions/create-idv-session) (no changes)
|
18
|
+
- [GET View an IDV Session](https://docs.mangopay.com/api-reference/idv-sessions/view-idv-session) (includes `Checks` in response)
|
19
|
+
- [GET List IDV Sessions for a User](https://docs.mangopay.com/api-reference/idv-sessions/list-idv-sessions-user) (new endpoint)
|
20
|
+
|
21
|
+
The previously available endpoint GET View Checks for an IDV Session has been removed (as Checks were integrated into the GET by ID).
|
22
|
+
|
23
|
+
See the [guide](https://docs.mangopay.com/guides/users/verification/hosted) for more details.
|
24
|
+
|
25
|
+
#### Recipients
|
26
|
+
|
27
|
+
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).
|
28
|
+
|
29
|
+
### Added
|
30
|
+
|
31
|
+
- [GET List Deposit Preauthorizations for a Card](https://docs.mangopay.com/api-reference/deposit-preauthorizations/list-deposit-preauthorizations-card)
|
32
|
+
- [GET List Deposit Preauthorizations for a User](https://docs.mangopay.com/api-reference/deposit-preauthorizations/list-deposit-preauthorizations-user)
|
33
|
+
|
1
34
|
## [3.33.0] - 2025-04-29
|
2
35
|
### Added
|
3
36
|
|
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
|
@@ -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
|
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 = {})
|
data/lib/mangopay/version.rb
CHANGED
@@ -40,7 +40,7 @@ describe MangoPay::Client do
|
|
40
40
|
end
|
41
41
|
|
42
42
|
describe 'UPLOAD LOGO' do
|
43
|
-
|
43
|
+
xit 'accepts Base64 encoded file content' do
|
44
44
|
fnm = __FILE__.sub('.rb', '.png')
|
45
45
|
bts = File.open(fnm, 'rb') { |f| f.read }
|
46
46
|
b64 = Base64.encode64(bts)
|
@@ -48,7 +48,7 @@ describe MangoPay::Client do
|
|
48
48
|
expect(ret).to_not be_nil
|
49
49
|
end
|
50
50
|
|
51
|
-
|
51
|
+
xit 'accepts file path' do
|
52
52
|
fnm = __FILE__.sub('.rb', '.png')
|
53
53
|
ret = MangoPay::Client.upload_logo(nil, fnm)
|
54
54
|
expect(ret).to_not be_nil
|
@@ -24,6 +24,38 @@ describe MangoPay::Deposit do
|
|
24
24
|
|
25
25
|
assert_deposit(fetched_deposit, card_registration['CardId'], author["Id"])
|
26
26
|
end
|
27
|
+
|
28
|
+
it 'gets all deposits for a user' do
|
29
|
+
author = new_natural_user
|
30
|
+
card_registration = new_card_registration_completed
|
31
|
+
create_new_deposit(card_registration['CardId'], author['Id'])
|
32
|
+
|
33
|
+
result = MangoPay::Deposit.get_all_for_user(author['Id'])
|
34
|
+
expect(result).to be_kind_of(Array)
|
35
|
+
expect(result.count).to be > 0
|
36
|
+
end
|
37
|
+
|
38
|
+
it 'gets all deposits for a card' do
|
39
|
+
author = new_natural_user
|
40
|
+
card_registration = new_card_registration_completed
|
41
|
+
create_new_deposit(card_registration['CardId'], author['Id'])
|
42
|
+
|
43
|
+
result = MangoPay::Deposit.get_all_for_card(card_registration['CardId'])
|
44
|
+
expect(result).to be_kind_of(Array)
|
45
|
+
expect(result.count).to be > 0
|
46
|
+
end
|
47
|
+
|
48
|
+
it 'fetches transactions for a deposit' do
|
49
|
+
author = new_natural_user
|
50
|
+
wallet = new_wallet
|
51
|
+
card_registration = new_card_registration_completed
|
52
|
+
deposit = create_new_deposit(card_registration['CardId'], author['Id'])
|
53
|
+
create_new_payin_pre_authorized_deposit_direct(deposit['Id'], author['Id'], wallet['Id'])
|
54
|
+
|
55
|
+
transactions = MangoPay::Deposit.get_transactions(deposit['Id'])
|
56
|
+
expect(transactions).to be_kind_of(Array)
|
57
|
+
expect(transactions.count).to be > 0
|
58
|
+
end
|
27
59
|
end
|
28
60
|
|
29
61
|
# the Cancel flow will be teste manually for now
|
@@ -21,22 +21,17 @@ describe MangoPay::IdentityVerification do
|
|
21
21
|
expect(created['ReturnUrl']).to eq(fetched['ReturnUrl'])
|
22
22
|
expect(created['Status']).to eq(fetched['Status'])
|
23
23
|
end
|
24
|
-
end
|
25
24
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
# expect(checks['LastUpdate']).not_to be_nil
|
37
|
-
# expect(checks['Checks']).not_to be_nil
|
38
|
-
# end
|
39
|
-
# end
|
25
|
+
it 'fetches all identity verifications for a user' do
|
26
|
+
create_new_identity_verification
|
27
|
+
user = new_natural_user
|
28
|
+
fetched = MangoPay::IdentityVerification.get_all(user['Id'])
|
29
|
+
|
30
|
+
expect(fetched).not_to be_nil
|
31
|
+
expect(fetched).to be_kind_of(Array)
|
32
|
+
expect(fetched).not_to be_empty
|
33
|
+
end
|
34
|
+
end
|
40
35
|
|
41
36
|
def create_new_identity_verification
|
42
37
|
user = new_natural_user
|
@@ -45,7 +45,7 @@ describe MangoPay::PayIn::PreAuthorized::Direct, type: :feature do
|
|
45
45
|
it 'refunds a payin' do
|
46
46
|
payin = new_payin_preauthorized_direct
|
47
47
|
sleep(2)
|
48
|
-
refund = MangoPay::PayIn.refund(payin['Id'], {AuthorId: payin['AuthorId']})
|
48
|
+
refund = MangoPay::PayIn.refund(payin['Id'], { AuthorId: payin['AuthorId'] })
|
49
49
|
expect(refund['Id']).not_to be_nil
|
50
50
|
expect(refund['Status']).to eq('SUCCEEDED')
|
51
51
|
expect(refund['Type']).to eq('PAYOUT')
|
@@ -66,26 +66,52 @@ describe MangoPay::PayIn::PreAuthorized::Direct, type: :feature do
|
|
66
66
|
wallets_reload_and_check_amounts(wlt, 1000)
|
67
67
|
|
68
68
|
# refund the payin
|
69
|
-
refund = MangoPay::PayIn.refund(payin['Id'], {AuthorId: payin['AuthorId']})
|
69
|
+
refund = MangoPay::PayIn.refund(payin['Id'], { AuthorId: payin['AuthorId'] })
|
70
70
|
wallets_reload_and_check_amounts(wlt, 0)
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
deposit = create_new_deposit(card_registration['CardId'], author['Id'])
|
74
|
+
begin
|
75
|
+
describe 'CREATE AND VIEW PRE AUTHORIZED DEPOSIT' do
|
76
|
+
it 'creates a card direct pre authorized deposit payin' do
|
77
|
+
wallet = new_wallet
|
78
|
+
author = new_natural_user
|
79
|
+
card_registration = new_card_registration_completed
|
80
|
+
deposit = create_new_deposit(card_registration['CardId'], author['Id'])
|
82
81
|
|
83
|
-
|
82
|
+
created = create_new_payin_pre_authorized_deposit_direct(deposit['Id'], author['Id'], wallet['Id'])
|
84
83
|
|
85
|
-
|
86
|
-
|
87
|
-
|
84
|
+
expect(created['Id']).not_to be_nil
|
85
|
+
check_type_and_status(created)
|
86
|
+
expect(created['DepositId']).to eq(deposit['Id'])
|
87
|
+
end
|
88
|
+
|
89
|
+
it 'creates a card direct pre authorized deposit payin prior to complement' do
|
90
|
+
wallet = new_wallet
|
91
|
+
author = new_natural_user
|
92
|
+
card_registration = new_card_registration_completed
|
93
|
+
deposit = create_new_deposit(card_registration['CardId'], author['Id'])
|
94
|
+
|
95
|
+
created = create_new_deposit_pre_authorized_pay_in_prior_to_complement(deposit['Id'], author['Id'], wallet['Id'])
|
96
|
+
|
97
|
+
expect(created['Id']).not_to be_nil
|
98
|
+
check_type_and_status(created)
|
99
|
+
expect(created['DepositId']).to eq(deposit['Id'])
|
100
|
+
end
|
101
|
+
|
102
|
+
it 'creates a card direct pre authorized deposit payin complement' do
|
103
|
+
wallet = new_wallet
|
104
|
+
author = new_natural_user
|
105
|
+
card_registration = new_card_registration_completed
|
106
|
+
deposit = create_new_deposit(card_registration['CardId'], author['Id'])
|
107
|
+
MangoPay::Deposit.update(deposit['Id'], {PaymentStatus: 'NO_SHOW_REQUESTED'})
|
108
|
+
|
109
|
+
created = create_new_deposit_pre_authorized_pay_in_complement(deposit['Id'], author['Id'], wallet['Id'])
|
110
|
+
|
111
|
+
expect(created['Id']).not_to be_nil
|
112
|
+
check_type_and_status(created)
|
113
|
+
expect(created['DepositId']).to eq(deposit['Id'])
|
114
|
+
end
|
88
115
|
end
|
89
116
|
end
|
90
|
-
=end
|
91
117
|
end
|
@@ -30,7 +30,7 @@ describe MangoPay::Recipient do
|
|
30
30
|
|
31
31
|
describe 'GET Schema' do
|
32
32
|
it 'fetches schema for LocalBankTransfer, Individual' do
|
33
|
-
schema = MangoPay::Recipient.get_schema('LocalBankTransfer', 'Individual', 'GBP')
|
33
|
+
schema = MangoPay::Recipient.get_schema('LocalBankTransfer', 'Individual', 'GBP', 'GB')
|
34
34
|
expect(schema).not_to be_nil
|
35
35
|
expect(schema['DisplayName']).not_to be_nil
|
36
36
|
expect(schema['Currency']).not_to be_nil
|
@@ -42,10 +42,11 @@ describe MangoPay::Recipient do
|
|
42
42
|
expect(schema['LocalBankTransfer']).not_to be_nil
|
43
43
|
expect(schema['BusinessRecipient']).to be_nil
|
44
44
|
expect(schema['InternationalBankTransfer']).to be_nil
|
45
|
+
expect(schema['Country']).not_to be_nil
|
45
46
|
end
|
46
47
|
|
47
48
|
it 'fetches schema for InternationalBankTransfer, Business' do
|
48
|
-
schema = MangoPay::Recipient.get_schema('InternationalBankTransfer', 'Business', 'GBP')
|
49
|
+
schema = MangoPay::Recipient.get_schema('InternationalBankTransfer', 'Business', 'GBP', 'GB')
|
49
50
|
expect(schema).not_to be_nil
|
50
51
|
expect(schema['DisplayName']).not_to be_nil
|
51
52
|
expect(schema['Currency']).not_to be_nil
|
@@ -57,6 +58,7 @@ describe MangoPay::Recipient do
|
|
57
58
|
expect(schema['InternationalBankTransfer']).not_to be_nil
|
58
59
|
expect(schema['IndividualRecipient']).to be_nil
|
59
60
|
expect(schema['LocalBankTransfer']).to be_nil
|
61
|
+
expect(schema['Country']).not_to be_nil
|
60
62
|
end
|
61
63
|
end
|
62
64
|
|
@@ -110,4 +112,5 @@ def assert_recipient(recipient)
|
|
110
112
|
expect(recipient['LocalBankTransfer']).not_to be_nil
|
111
113
|
expect(recipient['RecipientScope']).not_to be_nil
|
112
114
|
expect(recipient['UserId']).not_to be_nil
|
115
|
+
expect(recipient['Country']).not_to be_nil
|
113
116
|
end
|
@@ -936,6 +936,28 @@ shared_context 'payins' do
|
|
936
936
|
)
|
937
937
|
end
|
938
938
|
|
939
|
+
def create_new_deposit_pre_authorized_pay_in_prior_to_complement(deposit_id, author_id, credited_wallet_id)
|
940
|
+
MangoPay::PayIn::PreAuthorized::Direct.create_deposit_preauthorized_pay_in_prior_to_complement(
|
941
|
+
AuthorId: author_id,
|
942
|
+
CreditedWalletId: credited_wallet_id,
|
943
|
+
DebitedFunds: { Currency: 'EUR', Amount: 1000 },
|
944
|
+
Fees: { Currency: 'EUR', Amount: 0 },
|
945
|
+
DepositId: deposit_id,
|
946
|
+
Tag: 'lorem ipsum'
|
947
|
+
)
|
948
|
+
end
|
949
|
+
|
950
|
+
def create_new_deposit_pre_authorized_pay_in_complement(deposit_id, author_id, credited_wallet_id)
|
951
|
+
MangoPay::PayIn::PreAuthorized::Direct.create_deposit_preauthorized_pay_in_complement(
|
952
|
+
AuthorId: author_id,
|
953
|
+
CreditedWalletId: credited_wallet_id,
|
954
|
+
DebitedFunds: { Currency: 'EUR', Amount: 1000 },
|
955
|
+
Fees: { Currency: 'EUR', Amount: 0 },
|
956
|
+
DepositId: deposit_id,
|
957
|
+
Tag: 'lorem ipsum'
|
958
|
+
)
|
959
|
+
end
|
960
|
+
|
939
961
|
###############################################
|
940
962
|
# bankwire/direct
|
941
963
|
###############################################
|
@@ -1251,6 +1273,7 @@ shared_context 'recipient' do
|
|
1251
1273
|
"PayoutMethodType": "LocalBankTransfer",
|
1252
1274
|
"RecipientType": "Individual",
|
1253
1275
|
"Currency": "GBP",
|
1276
|
+
"Country": "GB",
|
1254
1277
|
"IndividualRecipient": {
|
1255
1278
|
"FirstName": "Alex",
|
1256
1279
|
"LastName": "Smith",
|
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.35.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Geoffroy Lorieux
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2025-
|
12
|
+
date: 2025-05-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: multi_json
|