mangopay 3.4.0 → 3.26.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 +34 -0
- data/.github/workflows/ruby_ci.yml +30 -0
- data/CHANGELOG.md +249 -4
- data/README.md +19 -0
- data/lib/mangopay/authorization_token.rb +1 -1
- data/lib/mangopay/bankingaliases_iban.rb +2 -2
- data/lib/mangopay/card.rb +10 -0
- data/lib/mangopay/client.rb +0 -5
- data/lib/mangopay/conversion.rb +39 -0
- data/lib/mangopay/deposit.rb +20 -0
- data/lib/mangopay/dispute.rb +2 -2
- data/lib/mangopay/errors.rb +2 -2
- data/lib/mangopay/filter_parameters.rb +7 -2
- data/lib/mangopay/pay_in.rb +150 -1
- data/lib/mangopay/pay_out.rb +11 -0
- data/lib/mangopay/payment_method_metadata.rb +13 -0
- data/lib/mangopay/refund.rb +1 -0
- data/lib/mangopay/regulatory.rb +22 -0
- data/lib/mangopay/ubo_declaration.rb +6 -4
- data/lib/mangopay/version.rb +1 -1
- data/lib/mangopay.rb +102 -8
- data/spec/mangopay/bankingaliases_spec.rb +1 -1
- data/spec/mangopay/card_registration_spec.rb +17 -2
- data/spec/mangopay/client_spec.rb +12 -12
- data/spec/mangopay/configuration_spec.rb +98 -0
- data/spec/mangopay/conversion_spec.rb +64 -0
- data/spec/mangopay/deposit_spec.rb +75 -0
- data/spec/mangopay/kyc_document_spec.rb +1 -0
- data/spec/mangopay/payin_applepay_direct_spec.rb +1 -1
- data/spec/mangopay/payin_bancontact_web_spec.rb +30 -0
- data/spec/mangopay/payin_blik_web_spec.rb +32 -0
- data/spec/mangopay/payin_giropay_web_spec.rb +30 -0
- data/spec/mangopay/payin_googlepay_direct_spec.rb +21 -0
- data/spec/mangopay/payin_ideal_web_spec.rb +30 -0
- data/spec/mangopay/payin_klarna_web_spec.rb +32 -0
- data/spec/mangopay/payin_mbway_web_spec.rb +32 -0
- data/spec/mangopay/payin_multibanco_web_spec.rb +31 -0
- data/spec/mangopay/payin_payconiq_web_spec.rb +25 -0
- data/spec/mangopay/payin_paypal_web_spec.rb +21 -0
- data/spec/mangopay/payin_preauthorized_direct_spec.rb +21 -1
- data/spec/mangopay/payin_satispay_web_spec.rb +32 -0
- data/spec/mangopay/payment_method_metadata_spec.rb +15 -0
- data/spec/mangopay/payout_bankwire_spec.rb +20 -0
- data/spec/mangopay/preauthorization_spec.rb +1 -2
- data/spec/mangopay/recurring_payin_spec.rb +82 -0
- data/spec/mangopay/regulatory_spec.rb +26 -0
- data/spec/mangopay/shared_resources.rb +714 -219
- data/spec/mangopay/transaction_spec.rb +5 -0
- data/spec/mangopay/ubo_declaration_spec.rb +14 -3
- data/spec/mangopay/ubo_spec.rb +3 -3
- data/spec/mangopay/user_spec.rb +16 -1
- data/spec/mangopay/wallet_spec.rb +5 -0
- metadata +39 -4
- data/.travis.yml +0 -19
@@ -0,0 +1,64 @@
|
|
1
|
+
describe MangoPay::Conversion, type: :feature do
|
2
|
+
include_context 'instant_conversion'
|
3
|
+
|
4
|
+
describe 'GET CONVERSION RATE' do
|
5
|
+
it 'get a conversion rate' do
|
6
|
+
conversion_rate = get_conversion_rate('EUR','GBP')
|
7
|
+
|
8
|
+
expect(conversion_rate['ClientRate']).not_to be_nil
|
9
|
+
expect(conversion_rate['MarketRate']).not_to be_nil
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
describe 'CREATE INSTANT CONVERSION' do
|
14
|
+
it 'creates a new instant conversion' do
|
15
|
+
conversion = create_instant_conversion
|
16
|
+
|
17
|
+
expect(conversion['DebitedFunds']['Amount']).not_to be_nil
|
18
|
+
expect(conversion['CreditedFunds']['Amount']).not_to be_nil
|
19
|
+
expect(conversion['Fees']['Amount']).not_to be_nil
|
20
|
+
expect(conversion['Status']).equal? 'SUCCEEDED'
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
describe 'CREATE QUOTED CONVERSION' do
|
25
|
+
it 'creates a new quoted conversion' do
|
26
|
+
conversion = create_quoted_conversion
|
27
|
+
|
28
|
+
expect(conversion['DebitedFunds']['Amount']).not_to be_nil
|
29
|
+
expect(conversion['CreditedFunds']['Amount']).not_to be_nil
|
30
|
+
expect(conversion['Status']).equal? 'SUCCEEDED'
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
describe 'GET EXISTING CONVERSION' do
|
35
|
+
it 'get an existing conversion' do
|
36
|
+
conversion = create_instant_conversion
|
37
|
+
returned_conversion = get_conversion(conversion['Id'])
|
38
|
+
|
39
|
+
expect(returned_conversion['DebitedFunds']['Amount']).not_to be_nil
|
40
|
+
expect(returned_conversion['CreditedFunds']['Amount']).not_to be_nil
|
41
|
+
expect(conversion['Fees']['Amount']).not_to be_nil
|
42
|
+
expect(returned_conversion['Status']).equal? 'SUCCEEDED'
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
describe 'CREATE CONVERSION QUOTE' do
|
47
|
+
it 'create a conversion quote' do
|
48
|
+
conversion_quote = create_conversion_quote
|
49
|
+
expect(conversion_quote['DebitedFunds']).not_to be_nil
|
50
|
+
expect(conversion_quote['CreditedFunds']).not_to be_nil
|
51
|
+
expect(conversion_quote['Duration']).equal? 90
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
describe 'GET CONVERSION QUOTE' do
|
56
|
+
it 'get a conversion quote' do
|
57
|
+
conversion_quote = create_conversion_quote
|
58
|
+
returned_conversion_quote = get_conversion_quote(conversion_quote['Id'])
|
59
|
+
expect(returned_conversion_quote['DebitedFunds']).not_to be_nil
|
60
|
+
expect(returned_conversion_quote['CreditedFunds']).not_to be_nil
|
61
|
+
expect(returned_conversion_quote['Duration']).equal? 90
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
describe MangoPay::Deposit do
|
2
|
+
include_context 'users'
|
3
|
+
include_context 'payins'
|
4
|
+
|
5
|
+
describe 'CREATE' do
|
6
|
+
it 'creates a new deposit' do
|
7
|
+
author = new_natural_user
|
8
|
+
card_registration = new_card_registration_completed
|
9
|
+
deposit = create_new_deposit(card_registration['CardId'], author['Id'])
|
10
|
+
|
11
|
+
assert_deposit(deposit, card_registration['CardId'], author["Id"])
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
describe 'GET' do
|
16
|
+
it 'get an existing deposit' do
|
17
|
+
author = new_natural_user
|
18
|
+
card_registration = new_card_registration_completed
|
19
|
+
deposit = create_new_deposit(card_registration['CardId'], author['Id'])
|
20
|
+
|
21
|
+
assert_deposit(deposit, card_registration['CardId'], author["Id"])
|
22
|
+
|
23
|
+
fetched_deposit = MangoPay::Deposit.get(deposit['Id'])
|
24
|
+
|
25
|
+
assert_deposit(fetched_deposit, card_registration['CardId'], author["Id"])
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
# the Cancel flow will be teste manually for now
|
30
|
+
=begin
|
31
|
+
describe 'CANCEL' do
|
32
|
+
it 'cancel an existing deposit' do
|
33
|
+
author = new_natural_user
|
34
|
+
card_registration = new_card_registration_completed
|
35
|
+
deposit = create_new_deposit(card_registration['CardId'], author['Id'])
|
36
|
+
|
37
|
+
assert_deposit(deposit, card_registration['CardId'], author["Id"])
|
38
|
+
expect(deposit['Status']).to eq('CREATED')
|
39
|
+
expect(deposit['PaymentStatus']).to eq('WAITING')
|
40
|
+
|
41
|
+
MangoPay::Deposit.cancel(deposit['Id'])
|
42
|
+
|
43
|
+
updated_deposit = MangoPay::Deposit.get(deposit['Id'])
|
44
|
+
|
45
|
+
assert_deposit(updated_deposit, card_registration['CardId'], author["Id"])
|
46
|
+
expect(updated_deposit['Status']).to eq('SUCCEEDED')
|
47
|
+
expect(updated_deposit['PaymentStatus']).to eq('CANCELED')
|
48
|
+
end
|
49
|
+
end
|
50
|
+
=end
|
51
|
+
end
|
52
|
+
|
53
|
+
|
54
|
+
def assert_deposit(deposit, card_reg_id, author_id)
|
55
|
+
expect(deposit['Id']).not_to be_nil
|
56
|
+
expect(deposit['CreationDate']).not_to be_nil
|
57
|
+
expect(deposit['ExpirationDate']).not_to be_nil
|
58
|
+
expect(deposit['AuthorId']).not_to be_nil
|
59
|
+
expect(deposit['DebitedFunds']).not_to be_nil
|
60
|
+
expect(deposit['Status']).not_to be_nil
|
61
|
+
expect(deposit['PaymentStatus']).not_to be_nil
|
62
|
+
expect(deposit['PayinsLinked']).not_to be_nil
|
63
|
+
expect(deposit['CardId']).not_to be_nil
|
64
|
+
expect(deposit['CardId']).to eq(card_reg_id)
|
65
|
+
expect(deposit['AuthorId']).to eq(author_id)
|
66
|
+
expect(deposit['SecureModeReturnURL']).not_to be_nil
|
67
|
+
expect(deposit['PaymentType']).not_to be_nil
|
68
|
+
expect(deposit['ExecutionType']).not_to be_nil
|
69
|
+
expect(deposit['StatementDescriptor']).not_to be_nil
|
70
|
+
expect(deposit['Culture']).not_to be_nil
|
71
|
+
expect(deposit['BrowserInfo']).not_to be_nil
|
72
|
+
expect(deposit['IpAddress']).not_to be_nil
|
73
|
+
expect(deposit['Billing']).not_to be_nil
|
74
|
+
expect(deposit['Shipping']).not_to be_nil
|
75
|
+
end
|
@@ -11,7 +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
|
-
|
14
|
+
pending("no cards to test for")
|
15
15
|
created = new_payin_applepay_direct
|
16
16
|
expect(created['Id']).not_to be_nil
|
17
17
|
check_type_and_status(created)
|
@@ -0,0 +1,30 @@
|
|
1
|
+
describe MangoPay::PayIn::Bancontact::Web, type: :feature do
|
2
|
+
include_context 'wallets'
|
3
|
+
include_context 'payins'
|
4
|
+
|
5
|
+
def check_type_and_status(payin)
|
6
|
+
expect(payin['Type']).to eq('PAYIN')
|
7
|
+
expect(payin['Nature']).to eq('REGULAR')
|
8
|
+
expect(payin['PaymentType']).to eq('BCMC')
|
9
|
+
expect(payin['ExecutionType']).to eq('WEB')
|
10
|
+
expect(payin['Status']).to eq('CREATED')
|
11
|
+
end
|
12
|
+
|
13
|
+
describe 'CREATE' do
|
14
|
+
it 'creates a bancontact web payin' do
|
15
|
+
created = new_payin_bancontact_web
|
16
|
+
expect(created['Id']).not_to be_nil
|
17
|
+
check_type_and_status(created)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
describe 'FETCH' do
|
22
|
+
it 'fetches a payin' do
|
23
|
+
created = new_payin_bancontact_web
|
24
|
+
fetched = MangoPay::PayIn.fetch(created['Id'])
|
25
|
+
expect(fetched['Id']).to eq(created['Id'])
|
26
|
+
check_type_and_status(created)
|
27
|
+
check_type_and_status(fetched)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
describe MangoPay::PayIn::Blik::Web, type: :feature do
|
2
|
+
include_context 'wallets'
|
3
|
+
include_context 'payins'
|
4
|
+
|
5
|
+
def check_type_and_status(payin)
|
6
|
+
expect(payin['Type']).to eq('PAYIN')
|
7
|
+
expect(payin['Nature']).to eq('REGULAR')
|
8
|
+
expect(payin['PaymentType']).to eq('BLIK')
|
9
|
+
expect(payin['ExecutionType']).to eq('WEB')
|
10
|
+
expect(payin['Status']).to eq('CREATED')
|
11
|
+
end
|
12
|
+
|
13
|
+
describe 'CREATE' do
|
14
|
+
it 'creates a blik web payin' do
|
15
|
+
created = new_payin_blik_web
|
16
|
+
expect(created['Id']).not_to be_nil
|
17
|
+
expect(created['ReturnURL']).not_to be_nil
|
18
|
+
check_type_and_status(created)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
describe 'FETCH' do
|
23
|
+
it 'fetches a payin' do
|
24
|
+
created = new_payin_blik_web
|
25
|
+
fetched = MangoPay::PayIn.fetch(created['Id'])
|
26
|
+
expect(fetched['Id']).to eq(created['Id'])
|
27
|
+
check_type_and_status(created)
|
28
|
+
check_type_and_status(fetched)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
describe MangoPay::PayIn::Giropay::Web, type: :feature do
|
2
|
+
include_context 'wallets'
|
3
|
+
include_context 'payins'
|
4
|
+
|
5
|
+
def check_type_and_status(payin)
|
6
|
+
expect(payin['Type']).to eq('PAYIN')
|
7
|
+
expect(payin['Nature']).to eq('REGULAR')
|
8
|
+
expect(payin['PaymentType']).to eq('GIROPAY')
|
9
|
+
expect(payin['ExecutionType']).to eq('WEB')
|
10
|
+
expect(payin['Status']).to eq('CREATED')
|
11
|
+
end
|
12
|
+
|
13
|
+
describe 'CREATE' do
|
14
|
+
it 'creates a giropay web payin' do
|
15
|
+
created = new_payin_giropay_web
|
16
|
+
expect(created['Id']).not_to be_nil
|
17
|
+
check_type_and_status(created)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
describe 'FETCH' do
|
22
|
+
it 'fetches a payin' do
|
23
|
+
created = new_payin_giropay_web
|
24
|
+
fetched = MangoPay::PayIn.fetch(created['Id'])
|
25
|
+
expect(fetched['Id']).to eq(created['Id'])
|
26
|
+
check_type_and_status(created)
|
27
|
+
check_type_and_status(fetched)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
describe MangoPay::PayIn::GooglePay::Direct, type: :feature do
|
2
|
+
include_context 'payins'
|
3
|
+
|
4
|
+
def check_type_and_status(payin)
|
5
|
+
expect(payin['Type']).to eq('PAYIN')
|
6
|
+
expect(payin['Nature']).to eq('REGULAR')
|
7
|
+
expect(payin['PaymentType']).to eq('GOOGLE_PAY')
|
8
|
+
expect(payin['ExecutionType']).to eq('DIRECT')
|
9
|
+
expect(payin['Status']).to eq('CREATED')
|
10
|
+
end
|
11
|
+
|
12
|
+
describe 'CREATE' do
|
13
|
+
it 'creates a googlepay direct payin' do
|
14
|
+
pending("Cannot be tested due to impossibility to generate payment_data in test")
|
15
|
+
created = new_payin_googlepay_direct
|
16
|
+
expect(created['Id']).not_to be_nil
|
17
|
+
check_type_and_status(created)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
@@ -0,0 +1,30 @@
|
|
1
|
+
describe MangoPay::PayIn::Ideal::Web, type: :feature do
|
2
|
+
include_context 'wallets'
|
3
|
+
include_context 'payins'
|
4
|
+
|
5
|
+
def check_type_and_status(payin)
|
6
|
+
expect(payin['Type']).to eq('PAYIN')
|
7
|
+
expect(payin['Nature']).to eq('REGULAR')
|
8
|
+
expect(payin['PaymentType']).to eq('IDEAL')
|
9
|
+
expect(payin['ExecutionType']).to eq('WEB')
|
10
|
+
expect(payin['Status']).to eq('CREATED')
|
11
|
+
end
|
12
|
+
|
13
|
+
describe 'CREATE' do
|
14
|
+
it 'creates a ideal web payin' do
|
15
|
+
created = new_payin_ideal_web
|
16
|
+
expect(created['Id']).not_to be_nil
|
17
|
+
check_type_and_status(created)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
describe 'FETCH' do
|
22
|
+
it 'fetches a payin' do
|
23
|
+
created = new_payin_ideal_web
|
24
|
+
fetched = MangoPay::PayIn.fetch(created['Id'])
|
25
|
+
expect(fetched['Id']).to eq(created['Id'])
|
26
|
+
check_type_and_status(created)
|
27
|
+
check_type_and_status(fetched)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
describe MangoPay::PayIn::Klarna::Web, type: :feature do
|
2
|
+
include_context 'wallets'
|
3
|
+
include_context 'payins'
|
4
|
+
|
5
|
+
def check_type_and_status(payin)
|
6
|
+
expect(payin['Type']).to eq('PAYIN')
|
7
|
+
expect(payin['Nature']).to eq('REGULAR')
|
8
|
+
expect(payin['PaymentType']).to eq('KLARNA')
|
9
|
+
expect(payin['ExecutionType']).to eq('WEB')
|
10
|
+
expect(payin['Status']).to eq('CREATED')
|
11
|
+
end
|
12
|
+
|
13
|
+
describe 'CREATE' do
|
14
|
+
it 'creates a klarna web payin' do
|
15
|
+
created = new_payin_klarna_web
|
16
|
+
expect(created['Id']).not_to be_nil
|
17
|
+
expect(created['ReturnURL']).not_to be_nil
|
18
|
+
check_type_and_status(created)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
describe 'FETCH' do
|
23
|
+
it 'fetches a payin' do
|
24
|
+
created = new_payin_klarna_web
|
25
|
+
fetched = MangoPay::PayIn.fetch(created['Id'])
|
26
|
+
expect(fetched['Id']).to eq(created['Id'])
|
27
|
+
check_type_and_status(created)
|
28
|
+
check_type_and_status(fetched)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
@@ -0,0 +1,32 @@
|
|
1
|
+
describe MangoPay::PayIn::Mbway::Web, type: :feature do
|
2
|
+
include_context 'wallets'
|
3
|
+
include_context 'payins'
|
4
|
+
|
5
|
+
def check_type_and_status(payin)
|
6
|
+
expect(payin['Type']).to eq('PAYIN')
|
7
|
+
expect(payin['Nature']).to eq('REGULAR')
|
8
|
+
expect(payin['PaymentType']).to eq('MBWAY')
|
9
|
+
expect(payin['ExecutionType']).to eq('WEB')
|
10
|
+
expect(payin['Status']).to eq('CREATED')
|
11
|
+
end
|
12
|
+
|
13
|
+
describe 'CREATE' do
|
14
|
+
it 'creates a mbway web payin' do
|
15
|
+
created = new_payin_mbway_web
|
16
|
+
expect(created['Id']).not_to be_nil
|
17
|
+
expect(created['Phone']).not_to be_nil
|
18
|
+
check_type_and_status(created)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
describe 'FETCH' do
|
23
|
+
it 'fetches a payin' do
|
24
|
+
created = new_payin_mbway_web
|
25
|
+
fetched = MangoPay::PayIn.fetch(created['Id'])
|
26
|
+
expect(fetched['Id']).to eq(created['Id'])
|
27
|
+
check_type_and_status(created)
|
28
|
+
check_type_and_status(fetched)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
describe MangoPay::PayIn::Multibanco::Web, type: :feature do
|
2
|
+
include_context 'wallets'
|
3
|
+
include_context 'payins'
|
4
|
+
|
5
|
+
def check_type_and_status(payin)
|
6
|
+
expect(payin['Type']).to eq('PAYIN')
|
7
|
+
expect(payin['Nature']).to eq('REGULAR')
|
8
|
+
expect(payin['PaymentType']).to eq('MULTIBANCO')
|
9
|
+
expect(payin['ExecutionType']).to eq('WEB')
|
10
|
+
expect(payin['Status']).to eq('CREATED')
|
11
|
+
end
|
12
|
+
|
13
|
+
describe 'CREATE' do
|
14
|
+
it 'creates a multibanco web payin' do
|
15
|
+
created = new_payin_multibanco_web
|
16
|
+
expect(created['Id']).not_to be_nil
|
17
|
+
expect(created['ReturnURL']).not_to be_nil
|
18
|
+
check_type_and_status(created)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
describe 'FETCH' do
|
23
|
+
it 'fetches a payin' do
|
24
|
+
created = new_payin_multibanco_web
|
25
|
+
fetched = MangoPay::PayIn.fetch(created['Id'])
|
26
|
+
expect(fetched['Id']).to eq(created['Id'])
|
27
|
+
check_type_and_status(created)
|
28
|
+
check_type_and_status(fetched)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
describe MangoPay::PayIn::Payconiq::Web, type: :feature do
|
2
|
+
include_context 'payins'
|
3
|
+
|
4
|
+
def check_type_and_status(payin)
|
5
|
+
expect(payin['Type']).to eq('PAYIN')
|
6
|
+
expect(payin['Nature']).to eq('REGULAR')
|
7
|
+
expect(payin['PaymentType']).to eq('PAYCONIQ')
|
8
|
+
expect(payin['ExecutionType']).to eq('WEB')
|
9
|
+
|
10
|
+
# not SUCCEEDED yet: waiting for processing
|
11
|
+
expect(payin['Status']).to eq('CREATED')
|
12
|
+
expect(payin['ResultCode']).to be_nil
|
13
|
+
expect(payin['ResultMessage']).to be_nil
|
14
|
+
expect(payin['ExecutionDate']).to be_nil
|
15
|
+
end
|
16
|
+
|
17
|
+
describe 'CREATE' do
|
18
|
+
it 'creates a payconiq web payin' do
|
19
|
+
created = new_payin_payconiq_web
|
20
|
+
expect(created['Id']).not_to be_nil
|
21
|
+
check_type_and_status(created)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
@@ -22,6 +22,14 @@ describe MangoPay::PayIn::PayPal::Web, type: :feature do
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
+
describe 'CREATE V2' do
|
26
|
+
it 'creates a paypal web v2 payin' do
|
27
|
+
created = new_payin_paypal_web_v2
|
28
|
+
expect(created['Id']).not_to be_nil
|
29
|
+
check_type_and_status(created)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
25
33
|
describe "FETCH" do
|
26
34
|
it 'FETCHES a payIn with PayPal account email' do
|
27
35
|
payin_id = "54088959"
|
@@ -47,4 +55,17 @@ describe MangoPay::PayIn::PayPal::Web, type: :feature do
|
|
47
55
|
end
|
48
56
|
end
|
49
57
|
|
58
|
+
describe 'FETCH V2' do
|
59
|
+
it 'fetches a payin' do
|
60
|
+
created = new_payin_paypal_web_v2
|
61
|
+
fetched = MangoPay::PayIn.fetch(created['Id'])
|
62
|
+
expect(fetched['Id']).to eq(created['Id'])
|
63
|
+
expect(fetched['CreationDate']).to eq(created['CreationDate'])
|
64
|
+
expect(fetched['CreditedFunds']).to eq(created['CreditedFunds'])
|
65
|
+
expect(fetched['CreditedWalletId']).to eq(created['CreditedWalletId'])
|
66
|
+
check_type_and_status(created)
|
67
|
+
check_type_and_status(fetched)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
50
71
|
end
|
@@ -1,7 +1,8 @@
|
|
1
1
|
describe MangoPay::PayIn::PreAuthorized::Direct, type: :feature do
|
2
2
|
include_context 'wallets'
|
3
3
|
include_context 'payins'
|
4
|
-
|
4
|
+
include_context 'users'
|
5
|
+
|
5
6
|
def check_type_and_status(payin)
|
6
7
|
expect(payin['Type']).to eq('PAYIN')
|
7
8
|
expect(payin['Nature']).to eq('REGULAR')
|
@@ -18,6 +19,8 @@ describe MangoPay::PayIn::PreAuthorized::Direct, type: :feature do
|
|
18
19
|
describe 'CREATE' do
|
19
20
|
it 'creates a preauthorized direct payin' do
|
20
21
|
created = new_payin_preauthorized_direct
|
22
|
+
# wait for the transactions to be created
|
23
|
+
sleep(2)
|
21
24
|
transactions = MangoPay::PreAuthorization.transactions(created['PreauthorizationId'])
|
22
25
|
expect(created['Id']).not_to be_nil
|
23
26
|
expect(transactions[0]['Status']).to eq('SUCCEEDED')
|
@@ -67,4 +70,21 @@ describe MangoPay::PayIn::PreAuthorized::Direct, type: :feature do
|
|
67
70
|
end
|
68
71
|
end
|
69
72
|
|
73
|
+
# this flow is tested manually for the moment
|
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'])
|
81
|
+
|
82
|
+
created = create_new_payin_pre_authorized_deposit_direct(deposit['Id'], author['Id'], wallet['Id'])
|
83
|
+
|
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
|
+
end
|
89
|
+
=end
|
70
90
|
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
describe MangoPay::PayIn::Satispay::Web, type: :feature do
|
2
|
+
include_context 'wallets'
|
3
|
+
include_context 'payins'
|
4
|
+
|
5
|
+
def check_type_and_status(payin)
|
6
|
+
expect(payin['Type']).to eq('PAYIN')
|
7
|
+
expect(payin['Nature']).to eq('REGULAR')
|
8
|
+
expect(payin['PaymentType']).to eq('SATISPAY')
|
9
|
+
expect(payin['ExecutionType']).to eq('WEB')
|
10
|
+
expect(payin['Status']).to eq('CREATED')
|
11
|
+
end
|
12
|
+
|
13
|
+
describe 'CREATE' do
|
14
|
+
it 'creates a satispay web payin' do
|
15
|
+
created = new_payin_satispay_web
|
16
|
+
expect(created['Id']).not_to be_nil
|
17
|
+
expect(created['Country']).not_to be_nil
|
18
|
+
check_type_and_status(created)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
describe 'FETCH' do
|
23
|
+
it 'fetches a payin' do
|
24
|
+
created = new_payin_satispay_web
|
25
|
+
fetched = MangoPay::PayIn.fetch(created['Id'])
|
26
|
+
expect(fetched['Id']).to eq(created['Id'])
|
27
|
+
check_type_and_status(created)
|
28
|
+
check_type_and_status(fetched)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
describe MangoPay::PaymentMethodMetadata, type: :feature do
|
2
|
+
include_context 'payment_method_metadata'
|
3
|
+
|
4
|
+
describe 'GET PAYMENT METHOD METADATA' do
|
5
|
+
it 'gets a new payment method metadata' do
|
6
|
+
metadata = get_payment_method_metadata
|
7
|
+
|
8
|
+
expect(metadata).not_to be_nil
|
9
|
+
expect(metadata['IssuerCountryCode']).not_to be_nil
|
10
|
+
expect(metadata['IssuingBank']).not_to be_nil
|
11
|
+
expect(metadata['BinData']).not_to be_nil
|
12
|
+
expect(metadata['BinData'][0]['CardType']).not_to be_nil
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -49,6 +49,26 @@ describe MangoPay::PayOut::BankWire, type: :feature do
|
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
52
|
+
describe 'Check Eligibility' do
|
53
|
+
it 'checks the eligibility of a payout' do
|
54
|
+
created = new_payout_bankwire
|
55
|
+
|
56
|
+
eligibility = MangoPay::PayOut::InstantPayoutEligibility::Reachability.create(
|
57
|
+
AuthorId: created['AuthorId'],
|
58
|
+
DebitedFunds: {
|
59
|
+
Amount: 10,
|
60
|
+
Currency: 'EUR'
|
61
|
+
},
|
62
|
+
PayoutModeRequested: 'INSTANT_PAYMENT',
|
63
|
+
BankAccountId: created['BankAccountId'],
|
64
|
+
DebitedWalletId: created['DebitedWalletId']
|
65
|
+
)
|
66
|
+
|
67
|
+
expect(created).not_to be_nil
|
68
|
+
expect(eligibility).not_to be_nil
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
52
72
|
describe 'FETCH' do
|
53
73
|
it 'fetches a payout' do
|
54
74
|
created = new_payout_bankwire
|
@@ -7,7 +7,6 @@ describe MangoPay::PreAuthorization do
|
|
7
7
|
cardreg = new_card_registration_completed
|
8
8
|
created = new_card_preauthorization
|
9
9
|
expect(created['Id']).not_to be_nil
|
10
|
-
expect(created['Id'].to_i).to be > 0
|
11
10
|
expect(created['CardId']).to eq(cardreg['CardId'])
|
12
11
|
expect(created['AuthorId']).to eq(new_natural_user["Id"])
|
13
12
|
expect(created['PayInId']).to be_nil
|
@@ -15,7 +14,7 @@ describe MangoPay::PreAuthorization do
|
|
15
14
|
expect(created['PaymentStatus']).to eq('WAITING')
|
16
15
|
expect(created['PaymentType']).to eq('CARD')
|
17
16
|
expect(created['ExecutionType']).to eq('DIRECT')
|
18
|
-
expect(created['Requested3DSVersion']).to eq('
|
17
|
+
expect(created['Requested3DSVersion']).to eq('V2_1')
|
19
18
|
end
|
20
19
|
end
|
21
20
|
|