adyen-ruby-api-library 6.2.0 → 7.0.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/CODEOWNERS +1 -1
- data/.github/workflows/codeql.yml +41 -0
- data/.github/workflows/ruby.yml +1 -1
- data/.github/workflows/rubygems_release.yml +1 -1
- data/.gitignore +3 -0
- data/Makefile +72 -0
- data/README.md +20 -18
- data/lib/adyen/client.rb +82 -42
- data/lib/adyen/errors.rb +2 -2
- data/lib/adyen/services/balanceControlService.rb +28 -0
- data/lib/adyen/services/balancePlatform/account_holders_api.rb +63 -0
- data/lib/adyen/services/balancePlatform/balance_accounts_api.rb +123 -0
- data/lib/adyen/services/balancePlatform/bank_account_validation_api.rb +27 -0
- data/lib/adyen/services/balancePlatform/grant_accounts_api.rb +27 -0
- data/lib/adyen/services/balancePlatform/grant_offers_api.rb +39 -0
- data/lib/adyen/services/balancePlatform/payment_instrument_groups_api.rb +51 -0
- data/lib/adyen/services/balancePlatform/payment_instruments_api.rb +75 -0
- data/lib/adyen/services/balancePlatform/platform_api.rb +39 -0
- data/lib/adyen/services/balancePlatform/transaction_rules_api.rb +63 -0
- data/lib/adyen/services/balancePlatform.rb +61 -0
- data/lib/adyen/services/binLookup.rb +40 -0
- data/lib/adyen/services/checkout/classic_checkout_sdk_api.rb +39 -0
- data/lib/adyen/services/checkout/modifications_api.rb +87 -0
- data/lib/adyen/services/checkout/orders_api.rb +51 -0
- data/lib/adyen/services/checkout/payment_links_api.rb +51 -0
- data/lib/adyen/services/checkout/payments_api.rb +87 -0
- data/lib/adyen/services/checkout/recurring_api.rb +39 -0
- data/lib/adyen/services/checkout/utility_api.rb +39 -0
- data/lib/adyen/services/checkout.rb +39 -180
- data/lib/adyen/services/dataProtection.rb +28 -0
- data/lib/adyen/services/legalEntityManagement/business_lines_api.rb +63 -0
- data/lib/adyen/services/legalEntityManagement/documents_api.rb +63 -0
- data/lib/adyen/services/legalEntityManagement/hosted_onboarding_api.rb +51 -0
- data/lib/adyen/services/legalEntityManagement/legal_entities_api.rb +75 -0
- data/lib/adyen/services/legalEntityManagement/pci_questionnaires_api.rb +63 -0
- data/lib/adyen/services/legalEntityManagement/terms_of_service_api.rb +51 -0
- data/lib/adyen/services/legalEntityManagement/transfer_instruments_api.rb +63 -0
- data/lib/adyen/services/legalEntityManagement.rb +51 -0
- data/lib/adyen/services/management/account_company_level_api.rb +51 -0
- data/lib/adyen/services/management/account_merchant_level_api.rb +63 -0
- data/lib/adyen/services/management/account_store_level_api.rb +111 -0
- data/lib/adyen/services/management/allowed_origins_company_level_api.rb +63 -0
- data/lib/adyen/services/management/allowed_origins_merchant_level_api.rb +63 -0
- data/lib/adyen/services/management/api_credentials_company_level_api.rb +63 -0
- data/lib/adyen/services/management/api_credentials_merchant_level_api.rb +63 -0
- data/lib/adyen/services/management/api_key_company_level_api.rb +27 -0
- data/lib/adyen/services/management/api_key_merchant_level_api.rb +27 -0
- data/lib/adyen/services/management/client_key_company_level_api.rb +27 -0
- data/lib/adyen/services/management/client_key_merchant_level_api.rb +27 -0
- data/lib/adyen/services/management/my_api_credential_api.rb +75 -0
- data/lib/adyen/services/management/payment_methods_merchant_level_api.rb +87 -0
- data/lib/adyen/services/management/payout_settings_merchant_level_api.rb +75 -0
- data/lib/adyen/services/management/terminal_actions_company_level_api.rb +63 -0
- data/lib/adyen/services/management/terminal_actions_terminal_level_api.rb +27 -0
- data/lib/adyen/services/management/terminal_orders_company_level_api.rb +135 -0
- data/lib/adyen/services/management/terminal_orders_merchant_level_api.rb +135 -0
- data/lib/adyen/services/management/terminal_settings_company_level_api.rb +63 -0
- data/lib/adyen/services/management/terminal_settings_merchant_level_api.rb +63 -0
- data/lib/adyen/services/management/terminal_settings_store_level_api.rb +111 -0
- data/lib/adyen/services/management/terminal_settings_terminal_level_api.rb +63 -0
- data/lib/adyen/services/management/terminals_terminal_level_api.rb +27 -0
- data/lib/adyen/services/management/users_company_level_api.rb +63 -0
- data/lib/adyen/services/management/users_merchant_level_api.rb +63 -0
- data/lib/adyen/services/management/webhooks_company_level_api.rb +99 -0
- data/lib/adyen/services/management/webhooks_merchant_level_api.rb +99 -0
- data/lib/adyen/services/management.rb +151 -0
- data/lib/adyen/services/payment.rb +172 -0
- data/lib/adyen/services/payout/initialization_api.rb +51 -0
- data/lib/adyen/services/payout/instant_payouts_api.rb +27 -0
- data/lib/adyen/services/payout/reviewing_api.rb +39 -0
- data/lib/adyen/services/payout.rb +31 -0
- data/lib/adyen/services/posTerminalManagement.rb +76 -0
- data/lib/adyen/services/recurring.rb +81 -13
- data/lib/adyen/services/service.rb +6 -1
- data/lib/adyen/services/storedValue.rb +88 -0
- data/lib/adyen/services/transfers/transactions_api.rb +39 -0
- data/lib/adyen/services/transfers/transfers_api.rb +27 -0
- data/lib/adyen/services/transfers.rb +26 -0
- data/lib/adyen/utils/hmac_validator.rb +2 -3
- data/lib/adyen/version.rb +2 -2
- data/lib/adyen-ruby-api-library.rb +11 -5
- data/spec/account_spec.rb +1 -1
- data/spec/balance_control_spec.rb +44 -0
- data/spec/balance_platform_spec.rb +123 -0
- data/spec/bin_lookup_spec.rb +68 -10
- data/spec/checkout_spec.rb +85 -62
- data/spec/client_spec.rb +89 -10
- data/spec/errors_spec.rb +1 -1
- data/spec/fund_spec.rb +1 -1
- data/spec/hop_spec.rb +1 -1
- data/spec/lem_spec.rb +68 -0
- data/spec/management_spec.rb +68 -0
- data/spec/mocks/requests/BalanceControl/balance_transfer.json +10 -0
- data/spec/mocks/requests/BalancePlatform/create_account_holder.json +5 -0
- data/spec/mocks/requests/BalancePlatform/update_account_holder.json +10 -0
- data/spec/mocks/requests/LegalEntityManagement/create_business_line.json +15 -0
- data/spec/mocks/requests/Management/create_store.json +15 -0
- data/spec/mocks/requests/Recurring/create_permit.json +6 -0
- data/spec/mocks/requests/StoredValue/issue_giftcard.json +12 -0
- data/spec/mocks/requests/Transfers/get_transactions.json +82 -0
- data/spec/mocks/requests/Transfers/make_transfer.json +32 -0
- data/spec/mocks/responses/BalanceControl/balance_transfer.json +14 -0
- data/spec/mocks/responses/BalancePlatform/create_account_holder.json +41 -0
- data/spec/mocks/responses/BalancePlatform/get_balance_account.json +15 -0
- data/spec/mocks/responses/BalancePlatform/update_account_holder.json +16 -0
- data/spec/mocks/responses/Checkout/stored_payment_methods.json +1 -0
- data/spec/mocks/responses/LegalEntityManagement/create_business_line.json +17 -0
- data/spec/mocks/responses/Management/create_store.json +23 -0
- data/spec/mocks/responses/Management/get_companies.json +42 -0
- data/spec/mocks/responses/Recurring/create_permit.json +4 -0
- data/spec/mocks/responses/StoredValue/issue_giftcard.json +13 -0
- data/spec/mocks/responses/Transfers/get_transactions.json +82 -0
- data/spec/mocks/responses/Transfers/make_transfer.json +36 -0
- data/spec/mocks/responses/Webhooks/backslash_notification.json +41 -0
- data/spec/mocks/responses/Webhooks/colon_notification.json +41 -0
- data/spec/mocks/responses/Webhooks/forwardslash_notification.json +41 -0
- data/spec/mocks/responses/Webhooks/mixed_notification.json +41 -0
- data/spec/notification_spec.rb +1 -1
- data/spec/payments_spec.rb +41 -23
- data/spec/payouts_spec.rb +43 -16
- data/spec/pos_terminal_management_spec.rb +46 -0
- data/spec/recurring_spec.rb +2 -2
- data/spec/spec_helper.rb +0 -10
- data/spec/stored_value_spec.rb +43 -0
- data/spec/transfers_spec.rb +63 -0
- data/spec/utils/hmac_validator_spec.rb +20 -6
- data/templates/api-single.mustache +29 -0
- data/templates/api-small.mustache +37 -0
- data/templates/api.mustache +36 -0
- data/templates/config.yaml +10 -0
- metadata +107 -11
- data/lib/adyen/services/bin_lookup.rb +0 -18
- data/lib/adyen/services/data_protection.rb +0 -17
- data/lib/adyen/services/payments.rb +0 -34
- data/lib/adyen/services/payouts.rb +0 -22
- data/lib/adyen/services/postfmapi.rb +0 -19
- data/spec/mocks/requests/Recurring/store_token.json +0 -15
- data/spec/mocks/responses/Recurring/store_token.json +0 -7
- data/spec/postfmapi_spec.rb +0 -16
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
require_relative '../service'
|
|
2
|
+
module Adyen
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class PaymentsApi < Service
|
|
6
|
+
attr_accessor :service, :version
|
|
7
|
+
|
|
8
|
+
def initialize(client, version = DEFAULT_VERSION)
|
|
9
|
+
@service = "Checkout"
|
|
10
|
+
@client = client
|
|
11
|
+
@version = version
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def card_details(request, headers: {} )
|
|
15
|
+
"""
|
|
16
|
+
Get the list of brands on the card
|
|
17
|
+
"""
|
|
18
|
+
endpoint = "/cardDetails".gsub(/{.+?}/, '%s')
|
|
19
|
+
endpoint = endpoint.gsub(/^\//, "")
|
|
20
|
+
endpoint = endpoint % []
|
|
21
|
+
|
|
22
|
+
action = { method: "post", url: endpoint}
|
|
23
|
+
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def donations(request, headers: {} )
|
|
27
|
+
"""
|
|
28
|
+
Start a transaction for donations
|
|
29
|
+
"""
|
|
30
|
+
endpoint = "/donations".gsub(/{.+?}/, '%s')
|
|
31
|
+
endpoint = endpoint.gsub(/^\//, "")
|
|
32
|
+
endpoint = endpoint % []
|
|
33
|
+
|
|
34
|
+
action = { method: "post", url: endpoint}
|
|
35
|
+
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def payment_methods(request, headers: {} )
|
|
39
|
+
"""
|
|
40
|
+
Get a list of available payment methods
|
|
41
|
+
"""
|
|
42
|
+
endpoint = "/paymentMethods".gsub(/{.+?}/, '%s')
|
|
43
|
+
endpoint = endpoint.gsub(/^\//, "")
|
|
44
|
+
endpoint = endpoint % []
|
|
45
|
+
|
|
46
|
+
action = { method: "post", url: endpoint}
|
|
47
|
+
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def payments(request, headers: {} )
|
|
51
|
+
"""
|
|
52
|
+
Start a transaction
|
|
53
|
+
"""
|
|
54
|
+
endpoint = "/payments".gsub(/{.+?}/, '%s')
|
|
55
|
+
endpoint = endpoint.gsub(/^\//, "")
|
|
56
|
+
endpoint = endpoint % []
|
|
57
|
+
|
|
58
|
+
action = { method: "post", url: endpoint}
|
|
59
|
+
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def payments_details(request, headers: {} )
|
|
63
|
+
"""
|
|
64
|
+
Submit details for a payment
|
|
65
|
+
"""
|
|
66
|
+
endpoint = "/payments/details".gsub(/{.+?}/, '%s')
|
|
67
|
+
endpoint = endpoint.gsub(/^\//, "")
|
|
68
|
+
endpoint = endpoint % []
|
|
69
|
+
|
|
70
|
+
action = { method: "post", url: endpoint}
|
|
71
|
+
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
def sessions(request, headers: {} )
|
|
75
|
+
"""
|
|
76
|
+
Create a payment session
|
|
77
|
+
"""
|
|
78
|
+
endpoint = "/sessions".gsub(/{.+?}/, '%s')
|
|
79
|
+
endpoint = endpoint.gsub(/^\//, "")
|
|
80
|
+
endpoint = endpoint % []
|
|
81
|
+
|
|
82
|
+
action = { method: "post", url: endpoint}
|
|
83
|
+
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
end
|
|
87
|
+
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
require_relative '../service'
|
|
2
|
+
module Adyen
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class RecurringApi < Service
|
|
6
|
+
attr_accessor :service, :version
|
|
7
|
+
|
|
8
|
+
def initialize(client, version = DEFAULT_VERSION)
|
|
9
|
+
@service = "Checkout"
|
|
10
|
+
@client = client
|
|
11
|
+
@version = version
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def delete_token_for_stored_payment_details(recurringId, headers: {} , queryParams: {})
|
|
15
|
+
"""
|
|
16
|
+
Delete a token for stored payment details
|
|
17
|
+
"""
|
|
18
|
+
endpoint = "/storedPaymentMethods/{recurringId}".gsub(/{.+?}/, '%s')
|
|
19
|
+
endpoint = endpoint.gsub(/^\//, "")
|
|
20
|
+
endpoint = endpoint % [recurringId]
|
|
21
|
+
endpoint = endpoint + create_query_string(queryParams)
|
|
22
|
+
action = { method: "delete", url: endpoint}
|
|
23
|
+
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def get_tokens_for_stored_payment_details(headers: {} , queryParams: {})
|
|
27
|
+
"""
|
|
28
|
+
Get tokens for stored payment details
|
|
29
|
+
"""
|
|
30
|
+
endpoint = "/storedPaymentMethods".gsub(/{.+?}/, '%s')
|
|
31
|
+
endpoint = endpoint.gsub(/^\//, "")
|
|
32
|
+
endpoint = endpoint % []
|
|
33
|
+
endpoint = endpoint + create_query_string(queryParams)
|
|
34
|
+
action = { method: "get", url: endpoint}
|
|
35
|
+
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
require_relative '../service'
|
|
2
|
+
module Adyen
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class UtilityApi < Service
|
|
6
|
+
attr_accessor :service, :version
|
|
7
|
+
|
|
8
|
+
def initialize(client, version = DEFAULT_VERSION)
|
|
9
|
+
@service = "Checkout"
|
|
10
|
+
@client = client
|
|
11
|
+
@version = version
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def get_apple_pay_session(request, headers: {} )
|
|
15
|
+
"""
|
|
16
|
+
Get an Apple Pay session
|
|
17
|
+
"""
|
|
18
|
+
endpoint = "/applePay/sessions".gsub(/{.+?}/, '%s')
|
|
19
|
+
endpoint = endpoint.gsub(/^\//, "")
|
|
20
|
+
endpoint = endpoint % []
|
|
21
|
+
|
|
22
|
+
action = { method: "post", url: endpoint}
|
|
23
|
+
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def origin_keys(request, headers: {} )
|
|
27
|
+
"""
|
|
28
|
+
Create originKey values for domains
|
|
29
|
+
"""
|
|
30
|
+
endpoint = "/originKeys".gsub(/{.+?}/, '%s')
|
|
31
|
+
endpoint = endpoint.gsub(/^\//, "")
|
|
32
|
+
endpoint = endpoint % []
|
|
33
|
+
|
|
34
|
+
action = { method: "post", url: endpoint}
|
|
35
|
+
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -1,192 +1,51 @@
|
|
|
1
|
-
require_relative
|
|
1
|
+
require_relative 'checkout/classic_checkout_sdk_api'
|
|
2
|
+
require_relative 'checkout/modifications_api'
|
|
3
|
+
require_relative 'checkout/orders_api'
|
|
4
|
+
require_relative 'checkout/payment_links_api'
|
|
5
|
+
require_relative 'checkout/payments_api'
|
|
6
|
+
require_relative 'checkout/recurring_api'
|
|
7
|
+
require_relative 'checkout/utility_api'
|
|
2
8
|
|
|
3
9
|
module Adyen
|
|
4
|
-
|
|
5
|
-
DEFAULT_VERSION = 68
|
|
10
|
+
|
|
6
11
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
class Checkout
|
|
13
|
+
attr_accessor :service, :version
|
|
14
|
+
|
|
15
|
+
DEFAULT_VERSION = 70
|
|
16
|
+
def initialize(client, version = DEFAULT_VERSION)
|
|
17
|
+
@service = "Checkout"
|
|
18
|
+
@client = client
|
|
19
|
+
@version = version
|
|
20
|
+
end
|
|
14
21
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
22
|
+
def classic_checkout_sdk_api
|
|
23
|
+
@classic_checkout_sdk_api ||= Adyen::ClassicCheckoutSDKApi.new(@client, @version)
|
|
24
|
+
end
|
|
18
25
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
# This method can't be dynamically defined because
|
|
23
|
-
# it needs to be both a method and a class
|
|
24
|
-
# to enable payments() and payments.detail(),
|
|
25
|
-
# which is accomplished via an argument length checker
|
|
26
|
-
# and the CheckoutDetail class below
|
|
27
|
-
def payments(*args)
|
|
28
|
-
case args.size
|
|
29
|
-
when 0
|
|
30
|
-
Adyen::CheckoutDetail.new(@client, @version)
|
|
31
|
-
else
|
|
32
|
-
action = "payments"
|
|
33
|
-
args[1] ||= {} # optional headers arg
|
|
34
|
-
@client.call_adyen_api(@service, action, args[0], args[1], @version, true)
|
|
35
|
-
end
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
def payment_links(*args)
|
|
39
|
-
case args.size
|
|
40
|
-
when 0
|
|
41
|
-
Adyen::CheckoutLink.new(@client, @version)
|
|
42
|
-
else
|
|
43
|
-
action = "paymentLinks"
|
|
44
|
-
args[1] ||= {} # optional headers arg
|
|
45
|
-
@client.call_adyen_api(@service, action, args[0], args[1], @version, true)
|
|
46
|
-
end
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
def payment_methods(*args)
|
|
50
|
-
case args.size
|
|
51
|
-
when 0
|
|
52
|
-
Adyen::CheckoutMethod.new(@client, @version)
|
|
53
|
-
else
|
|
54
|
-
action = "paymentMethods"
|
|
55
|
-
args[1] ||= {} # optional headers arg
|
|
56
|
-
@client.call_adyen_api(@service, action, args[0], args[1], @version)
|
|
57
|
-
end
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
def orders(*args)
|
|
61
|
-
case args.size
|
|
62
|
-
when 0
|
|
63
|
-
Adyen::CheckoutOrder.new(@client, @version)
|
|
64
|
-
else
|
|
65
|
-
action = "orders"
|
|
66
|
-
args[1] ||= {} # optional headers arg
|
|
67
|
-
@client.call_adyen_api(@service, action, args[0], args[1], @version)
|
|
68
|
-
end
|
|
69
|
-
end
|
|
70
|
-
|
|
71
|
-
def apple_pay
|
|
72
|
-
@apple_pay ||= Adyen::CheckoutApplePay.new(@client, @version)
|
|
73
|
-
end
|
|
26
|
+
def modifications_api
|
|
27
|
+
@modifications_api ||= Adyen::ModificationsApi.new(@client, @version)
|
|
28
|
+
end
|
|
74
29
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
end
|
|
79
|
-
|
|
80
|
-
class CheckoutDetail < Service
|
|
81
|
-
def initialize(client, version = DEFAULT_VERSION)
|
|
82
|
-
@service = "Checkout"
|
|
83
|
-
@client = client
|
|
84
|
-
@version = version
|
|
85
|
-
end
|
|
30
|
+
def orders_api
|
|
31
|
+
@orders_api ||= Adyen::OrdersApi.new(@client, @version)
|
|
32
|
+
end
|
|
86
33
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
end
|
|
34
|
+
def payment_links_api
|
|
35
|
+
@payment_links_api ||= Adyen::PaymentLinksApi.new(@client, @version)
|
|
36
|
+
end
|
|
91
37
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
end
|
|
96
|
-
end
|
|
38
|
+
def payments_api
|
|
39
|
+
@payments_api ||= Adyen::PaymentsApi.new(@client, @version)
|
|
40
|
+
end
|
|
97
41
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
@client = client
|
|
102
|
-
@version = version
|
|
103
|
-
end
|
|
42
|
+
def recurring_api
|
|
43
|
+
@recurring_api ||= Adyen::RecurringApi.new(@client, @version)
|
|
44
|
+
end
|
|
104
45
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
end
|
|
109
|
-
|
|
110
|
-
def update(linkId, request, headers = {})
|
|
111
|
-
action = { method: 'patch', url: "paymentLinks/" + linkId }
|
|
112
|
-
@client.call_adyen_api(@service, action, request, headers, @version, false)
|
|
113
|
-
end
|
|
114
|
-
end
|
|
115
|
-
|
|
116
|
-
class CheckoutMethod < Service
|
|
117
|
-
def initialize(client, version = DEFAULT_VERSION)
|
|
118
|
-
@service = "Checkout"
|
|
119
|
-
@client = client
|
|
120
|
-
@version = version
|
|
121
|
-
end
|
|
122
|
-
|
|
123
|
-
def balance(request, headers = {})
|
|
124
|
-
action = "paymentMethods/balance"
|
|
125
|
-
@client.call_adyen_api(@service, action, request, headers, @version, true)
|
|
126
|
-
end
|
|
127
|
-
end
|
|
128
|
-
|
|
129
|
-
class CheckoutOrder < Service
|
|
130
|
-
def initialize(client, version = DEFAULT_VERSION)
|
|
131
|
-
@service = "Checkout"
|
|
132
|
-
@client = client
|
|
133
|
-
@version = version
|
|
134
|
-
end
|
|
135
|
-
|
|
136
|
-
def cancel(request, headers = {})
|
|
137
|
-
action = "orders/cancel"
|
|
138
|
-
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
139
|
-
end
|
|
140
|
-
end
|
|
141
|
-
|
|
142
|
-
class CheckoutApplePay < Service
|
|
143
|
-
def initialize(client, version = DEFAULT_VERSION)
|
|
144
|
-
@service = "Checkout"
|
|
145
|
-
@client = client
|
|
146
|
-
@version = version
|
|
147
|
-
end
|
|
148
|
-
|
|
149
|
-
def sessions(request, headers = {})
|
|
150
|
-
action = "applePay/sessions"
|
|
151
|
-
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
152
|
-
end
|
|
153
|
-
end
|
|
154
|
-
|
|
155
|
-
class Modifications < Service
|
|
156
|
-
def initialize(client, version = DEFAULT_VERSION)
|
|
157
|
-
@service = "Checkout"
|
|
158
|
-
@client = client
|
|
159
|
-
@version = version
|
|
160
|
-
end
|
|
161
|
-
|
|
162
|
-
def capture(linkId, request, headers = {})
|
|
163
|
-
action = "payments/" + linkId + "/captures"
|
|
164
|
-
@client.call_adyen_api(@service, action, request, headers, @version, false)
|
|
165
|
-
end
|
|
166
|
-
|
|
167
|
-
def cancel(linkId, request, headers = {})
|
|
168
|
-
action = "payments/" + linkId + "/cancels"
|
|
169
|
-
@client.call_adyen_api(@service, action, request, headers, @version, false)
|
|
170
|
-
end
|
|
171
|
-
|
|
172
|
-
def genericCancel(request, headers = {})
|
|
173
|
-
action = "cancels"
|
|
174
|
-
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
175
|
-
end
|
|
176
|
-
|
|
177
|
-
def refund(linkId, request, headers = {})
|
|
178
|
-
action = "payments/" + linkId + "/refunds"
|
|
179
|
-
@client.call_adyen_api(@service, action, request, headers, @version, false)
|
|
180
|
-
end
|
|
181
|
-
|
|
182
|
-
def reversal(linkId, request, headers = {})
|
|
183
|
-
action = "payments/" + linkId + "/reversals"
|
|
184
|
-
@client.call_adyen_api(@service, action, request, headers, @version, false)
|
|
185
|
-
end
|
|
46
|
+
def utility_api
|
|
47
|
+
@utility_api ||= Adyen::UtilityApi.new(@client, @version)
|
|
48
|
+
end
|
|
186
49
|
|
|
187
|
-
def amountUpdate(linkId, request, headers = {})
|
|
188
|
-
action = "payments/" + linkId + "/amountUpdates"
|
|
189
|
-
@client.call_adyen_api(@service, action, request, headers, @version, false)
|
|
190
50
|
end
|
|
191
|
-
|
|
192
|
-
end
|
|
51
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
require_relative './service'
|
|
2
|
+
module Adyen
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class DataProtection < Service
|
|
6
|
+
attr_accessor :service, :version
|
|
7
|
+
DEFAULT_VERSION = 1
|
|
8
|
+
|
|
9
|
+
def initialize(client, version = DEFAULT_VERSION)
|
|
10
|
+
@service = "DataProtection"
|
|
11
|
+
@client = client
|
|
12
|
+
@version = version
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def request_subject_erasure(request, headers: {} )
|
|
16
|
+
"""
|
|
17
|
+
Submit a Subject Erasure Request.
|
|
18
|
+
"""
|
|
19
|
+
endpoint = "/requestSubjectErasure".gsub(/{.+?}/, '%s')
|
|
20
|
+
endpoint = endpoint.gsub(/^\//, "")
|
|
21
|
+
endpoint = endpoint % []
|
|
22
|
+
|
|
23
|
+
action = { method: "post", url: endpoint}
|
|
24
|
+
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
require_relative '../service'
|
|
2
|
+
module Adyen
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class BusinessLinesApi < Service
|
|
6
|
+
attr_accessor :service, :version
|
|
7
|
+
|
|
8
|
+
def initialize(client, version = DEFAULT_VERSION)
|
|
9
|
+
@service = "LegalEntityManagement"
|
|
10
|
+
@client = client
|
|
11
|
+
@version = version
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def delete_business_line(id, headers: {} )
|
|
15
|
+
"""
|
|
16
|
+
Delete a business line
|
|
17
|
+
"""
|
|
18
|
+
endpoint = "/businessLines/{id}".gsub(/{.+?}/, '%s')
|
|
19
|
+
endpoint = endpoint.gsub(/^\//, "")
|
|
20
|
+
endpoint = endpoint % [id]
|
|
21
|
+
|
|
22
|
+
action = { method: "delete", url: endpoint}
|
|
23
|
+
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def get_business_line(id, headers: {} )
|
|
27
|
+
"""
|
|
28
|
+
Get a business line
|
|
29
|
+
"""
|
|
30
|
+
endpoint = "/businessLines/{id}".gsub(/{.+?}/, '%s')
|
|
31
|
+
endpoint = endpoint.gsub(/^\//, "")
|
|
32
|
+
endpoint = endpoint % [id]
|
|
33
|
+
|
|
34
|
+
action = { method: "get", url: endpoint}
|
|
35
|
+
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def update_business_line(request, id, headers: {} )
|
|
39
|
+
"""
|
|
40
|
+
Update a business line
|
|
41
|
+
"""
|
|
42
|
+
endpoint = "/businessLines/{id}".gsub(/{.+?}/, '%s')
|
|
43
|
+
endpoint = endpoint.gsub(/^\//, "")
|
|
44
|
+
endpoint = endpoint % [id]
|
|
45
|
+
|
|
46
|
+
action = { method: "patch", url: endpoint}
|
|
47
|
+
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def create_business_line(request, headers: {} )
|
|
51
|
+
"""
|
|
52
|
+
Create a business line
|
|
53
|
+
"""
|
|
54
|
+
endpoint = "/businessLines".gsub(/{.+?}/, '%s')
|
|
55
|
+
endpoint = endpoint.gsub(/^\//, "")
|
|
56
|
+
endpoint = endpoint % []
|
|
57
|
+
|
|
58
|
+
action = { method: "post", url: endpoint}
|
|
59
|
+
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
end
|
|
63
|
+
end
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
require_relative '../service'
|
|
2
|
+
module Adyen
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class DocumentsApi < Service
|
|
6
|
+
attr_accessor :service, :version
|
|
7
|
+
|
|
8
|
+
def initialize(client, version = DEFAULT_VERSION)
|
|
9
|
+
@service = "LegalEntityManagement"
|
|
10
|
+
@client = client
|
|
11
|
+
@version = version
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def delete_document(id, headers: {} )
|
|
15
|
+
"""
|
|
16
|
+
Delete a document
|
|
17
|
+
"""
|
|
18
|
+
endpoint = "/documents/{id}".gsub(/{.+?}/, '%s')
|
|
19
|
+
endpoint = endpoint.gsub(/^\//, "")
|
|
20
|
+
endpoint = endpoint % [id]
|
|
21
|
+
|
|
22
|
+
action = { method: "delete", url: endpoint}
|
|
23
|
+
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def get_document(id, headers: {} )
|
|
27
|
+
"""
|
|
28
|
+
Get a document
|
|
29
|
+
"""
|
|
30
|
+
endpoint = "/documents/{id}".gsub(/{.+?}/, '%s')
|
|
31
|
+
endpoint = endpoint.gsub(/^\//, "")
|
|
32
|
+
endpoint = endpoint % [id]
|
|
33
|
+
|
|
34
|
+
action = { method: "get", url: endpoint}
|
|
35
|
+
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def update_document(request, id, headers: {} )
|
|
39
|
+
"""
|
|
40
|
+
Update a document
|
|
41
|
+
"""
|
|
42
|
+
endpoint = "/documents/{id}".gsub(/{.+?}/, '%s')
|
|
43
|
+
endpoint = endpoint.gsub(/^\//, "")
|
|
44
|
+
endpoint = endpoint % [id]
|
|
45
|
+
|
|
46
|
+
action = { method: "patch", url: endpoint}
|
|
47
|
+
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def upload_document_for_verification_checks(request, headers: {} )
|
|
51
|
+
"""
|
|
52
|
+
Upload a document for verification checks
|
|
53
|
+
"""
|
|
54
|
+
endpoint = "/documents".gsub(/{.+?}/, '%s')
|
|
55
|
+
endpoint = endpoint.gsub(/^\//, "")
|
|
56
|
+
endpoint = endpoint % []
|
|
57
|
+
|
|
58
|
+
action = { method: "post", url: endpoint}
|
|
59
|
+
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
end
|
|
63
|
+
end
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
require_relative '../service'
|
|
2
|
+
module Adyen
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class HostedOnboardingApi < Service
|
|
6
|
+
attr_accessor :service, :version
|
|
7
|
+
|
|
8
|
+
def initialize(client, version = DEFAULT_VERSION)
|
|
9
|
+
@service = "LegalEntityManagement"
|
|
10
|
+
@client = client
|
|
11
|
+
@version = version
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def list_hosted_onboarding_page_themes(headers: {} )
|
|
15
|
+
"""
|
|
16
|
+
Get a list of hosted onboarding page themes
|
|
17
|
+
"""
|
|
18
|
+
endpoint = "/themes".gsub(/{.+?}/, '%s')
|
|
19
|
+
endpoint = endpoint.gsub(/^\//, "")
|
|
20
|
+
endpoint = endpoint % []
|
|
21
|
+
|
|
22
|
+
action = { method: "get", url: endpoint}
|
|
23
|
+
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def get_onboarding_link_theme(id, headers: {} )
|
|
27
|
+
"""
|
|
28
|
+
Get an onboarding link theme
|
|
29
|
+
"""
|
|
30
|
+
endpoint = "/themes/{id}".gsub(/{.+?}/, '%s')
|
|
31
|
+
endpoint = endpoint.gsub(/^\//, "")
|
|
32
|
+
endpoint = endpoint % [id]
|
|
33
|
+
|
|
34
|
+
action = { method: "get", url: endpoint}
|
|
35
|
+
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def get_link_to_adyenhosted_onboarding_page(request, id, headers: {} )
|
|
39
|
+
"""
|
|
40
|
+
Get a link to an Adyen-hosted onboarding page
|
|
41
|
+
"""
|
|
42
|
+
endpoint = "/legalEntities/{id}/onboardingLinks".gsub(/{.+?}/, '%s')
|
|
43
|
+
endpoint = endpoint.gsub(/^\//, "")
|
|
44
|
+
endpoint = endpoint % [id]
|
|
45
|
+
|
|
46
|
+
action = { method: "post", url: endpoint}
|
|
47
|
+
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
end
|
|
51
|
+
end
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
require_relative '../service'
|
|
2
|
+
module Adyen
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class LegalEntitiesApi < Service
|
|
6
|
+
attr_accessor :service, :version
|
|
7
|
+
|
|
8
|
+
def initialize(client, version = DEFAULT_VERSION)
|
|
9
|
+
@service = "LegalEntityManagement"
|
|
10
|
+
@client = client
|
|
11
|
+
@version = version
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def get_legal_entity(id, headers: {} )
|
|
15
|
+
"""
|
|
16
|
+
Get a legal entity
|
|
17
|
+
"""
|
|
18
|
+
endpoint = "/legalEntities/{id}".gsub(/{.+?}/, '%s')
|
|
19
|
+
endpoint = endpoint.gsub(/^\//, "")
|
|
20
|
+
endpoint = endpoint % [id]
|
|
21
|
+
|
|
22
|
+
action = { method: "get", url: endpoint}
|
|
23
|
+
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def get_all_business_lines_under_legal_entity(id, headers: {} )
|
|
27
|
+
"""
|
|
28
|
+
Get all business lines under a legal entity
|
|
29
|
+
"""
|
|
30
|
+
endpoint = "/legalEntities/{id}/businessLines".gsub(/{.+?}/, '%s')
|
|
31
|
+
endpoint = endpoint.gsub(/^\//, "")
|
|
32
|
+
endpoint = endpoint % [id]
|
|
33
|
+
|
|
34
|
+
action = { method: "get", url: endpoint}
|
|
35
|
+
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def update_legal_entity(request, id, headers: {} )
|
|
39
|
+
"""
|
|
40
|
+
Update a legal entity
|
|
41
|
+
"""
|
|
42
|
+
endpoint = "/legalEntities/{id}".gsub(/{.+?}/, '%s')
|
|
43
|
+
endpoint = endpoint.gsub(/^\//, "")
|
|
44
|
+
endpoint = endpoint % [id]
|
|
45
|
+
|
|
46
|
+
action = { method: "patch", url: endpoint}
|
|
47
|
+
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def create_legal_entity(request, headers: {} )
|
|
51
|
+
"""
|
|
52
|
+
Create a legal entity
|
|
53
|
+
"""
|
|
54
|
+
endpoint = "/legalEntities".gsub(/{.+?}/, '%s')
|
|
55
|
+
endpoint = endpoint.gsub(/^\//, "")
|
|
56
|
+
endpoint = endpoint % []
|
|
57
|
+
|
|
58
|
+
action = { method: "post", url: endpoint}
|
|
59
|
+
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def check_legal_entitys_verification_errors(id, headers: {} )
|
|
63
|
+
"""
|
|
64
|
+
Check a legal entity's verification errors
|
|
65
|
+
"""
|
|
66
|
+
endpoint = "/legalEntities/{id}/checkVerificationErrors".gsub(/{.+?}/, '%s')
|
|
67
|
+
endpoint = endpoint.gsub(/^\//, "")
|
|
68
|
+
endpoint = endpoint % [id]
|
|
69
|
+
|
|
70
|
+
action = { method: "post", url: endpoint}
|
|
71
|
+
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
end
|
|
75
|
+
end
|