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,82 @@
|
|
1
|
+
describe MangoPay::PayIn::RecurringPayments, type: :feature do
|
2
|
+
include_context 'wallets'
|
3
|
+
include_context 'users'
|
4
|
+
include_context 'payins'
|
5
|
+
|
6
|
+
describe 'CREATE' do
|
7
|
+
it 'creates a recurring payment' do
|
8
|
+
cardreg = new_card_registration_completed
|
9
|
+
wallet = new_wallet
|
10
|
+
recurring = MangoPay::PayIn::RecurringPayments::Recurring.create(
|
11
|
+
AuthorId: new_natural_user['Id'],
|
12
|
+
CardId: cardreg['CardId'],
|
13
|
+
CreditedUserId: wallet['Owners'][0],
|
14
|
+
CreditedWalletId: wallet['Id'],
|
15
|
+
FirstTransactionDebitedFunds: {Currency: 'EUR', Amount: 10},
|
16
|
+
FirstTransactionFees: {Currency: 'EUR', Amount: 1},
|
17
|
+
Billing: {
|
18
|
+
Address: {
|
19
|
+
AddressLine1: 'AddressLine1',
|
20
|
+
AddressLine2: 'AddressLine2',
|
21
|
+
City: 'City',
|
22
|
+
Region: 'Region',
|
23
|
+
PostalCode: 'PostalCode',
|
24
|
+
Country: 'FR'
|
25
|
+
},
|
26
|
+
FirstName: 'Joe',
|
27
|
+
LastName: 'Blogs'
|
28
|
+
},
|
29
|
+
Shipping: {
|
30
|
+
Address: {
|
31
|
+
AddressLine1: 'AddressLine1',
|
32
|
+
AddressLine2: 'AddressLine2',
|
33
|
+
City: 'City',
|
34
|
+
Region: 'Region',
|
35
|
+
PostalCode: 'PostalCode',
|
36
|
+
Country: 'FR'
|
37
|
+
},
|
38
|
+
FirstName: 'Joe',
|
39
|
+
LastName: 'Blogs'
|
40
|
+
},
|
41
|
+
FreeCycles: 0
|
42
|
+
)
|
43
|
+
expect(recurring).not_to be_nil
|
44
|
+
expect(recurring['Status']).not_to be_nil
|
45
|
+
expect(recurring['Id']).not_to be_nil
|
46
|
+
expect(recurring['FreeCycles']).not_to be_nil
|
47
|
+
|
48
|
+
id = recurring['Id']
|
49
|
+
|
50
|
+
get = MangoPay::PayIn::RecurringPayments::Recurring.fetch(id)
|
51
|
+
expect(get).not_to be_nil
|
52
|
+
expect(get['FreeCycles']).not_to be_nil
|
53
|
+
|
54
|
+
cit = MangoPay::PayIn::RecurringPayments::CIT.create(
|
55
|
+
RecurringPayinRegistrationId: recurring['Id'],
|
56
|
+
IpAddress: "2001:0620:0000:0000:0211:24FF:FE80:C12C",
|
57
|
+
SecureModeReturnURL: "http://www.my-site.com/returnurl",
|
58
|
+
StatementDescriptor: "lorem",
|
59
|
+
Tag: "custom meta",
|
60
|
+
BrowserInfo: {
|
61
|
+
AcceptHeader: "text/html, application/xhtml+xml, application/xml;q=0.9, /;q=0.8",
|
62
|
+
JavaEnabled: true,
|
63
|
+
Language: "FR-FR",
|
64
|
+
ColorDepth: 4,
|
65
|
+
ScreenHeight: 1800,
|
66
|
+
ScreenWidth: 400,
|
67
|
+
JavascriptEnabled: true,
|
68
|
+
TimeZoneOffset: "+60",
|
69
|
+
UserAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 13_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148"
|
70
|
+
}
|
71
|
+
)
|
72
|
+
|
73
|
+
expect(cit).not_to be_nil
|
74
|
+
|
75
|
+
update = MangoPay::PayIn::RecurringPayments::Recurring.update(id, {
|
76
|
+
Status: 'Ended'
|
77
|
+
})
|
78
|
+
|
79
|
+
expect(update).not_to be_nil
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
describe MangoPay::Regulatory do
|
2
|
+
|
3
|
+
describe 'GET Country Authorizations' do
|
4
|
+
it 'can get country authorizations' do
|
5
|
+
country_authorizations = MangoPay::Regulatory.get_country_authorizations('FR')
|
6
|
+
|
7
|
+
expect(country_authorizations).not_to be_nil
|
8
|
+
expect(country_authorizations['CountryCode']).not_to be_nil
|
9
|
+
expect(country_authorizations['CountryName']).not_to be_nil
|
10
|
+
expect(country_authorizations['Authorization']).not_to be_nil
|
11
|
+
expect(country_authorizations['LastUpdate']).not_to be_nil
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
describe 'GET All Countries Authorizations' do
|
16
|
+
it 'can get all countries authorizations' do
|
17
|
+
country_authorizations = MangoPay::Regulatory.get_all_countries_authorizations
|
18
|
+
|
19
|
+
expect(country_authorizations).not_to be_nil
|
20
|
+
expect(country_authorizations[0]['CountryCode']).not_to be_nil
|
21
|
+
expect(country_authorizations[0]['CountryName']).not_to be_nil
|
22
|
+
expect(country_authorizations[0]['Authorization']).not_to be_nil
|
23
|
+
expect(country_authorizations[0]['LastUpdate']).not_to be_nil
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|