adyen-ruby-api-library 11.2.0 → 12.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 +4 -4
- data/.github/workflows/release.yml +1 -1
- data/.github/workflows/ruby.yml +3 -3
- data/.github/workflows/rubygems_release.yml +1 -1
- data/.github/workflows/stale.yml +1 -1
- data/Gemfile +2 -2
- data/README.md +30 -7
- data/VERSION +1 -1
- data/adyen-ruby-api-library.gemspec +1 -1
- data/lib/adyen/client.rb +10 -16
- data/lib/adyen/deprecation.rb +34 -0
- data/lib/adyen/services/balanceControl/balance_control_api.rb +3 -3
- data/lib/adyen/services/balancePlatform/account_holders_api.rb +14 -18
- data/lib/adyen/services/balancePlatform/authorized_card_users_api.rb +4 -12
- data/lib/adyen/services/balancePlatform/balance_accounts_api.rb +5 -65
- data/lib/adyen/services/balancePlatform/balances_api.rb +5 -15
- data/lib/adyen/services/balancePlatform/bank_account_validation_api.rb +1 -3
- data/lib/adyen/services/balancePlatform/card_orders_api.rb +2 -6
- data/lib/adyen/services/balancePlatform/custom_payout_schedules_sweeps_api.rb +56 -0
- data/lib/adyen/services/balancePlatform/direct_debit_mandates_api.rb +48 -0
- data/lib/adyen/services/balancePlatform/grant_accounts_api.rb +3 -3
- data/lib/adyen/services/balancePlatform/grant_offers_api.rb +6 -6
- data/lib/adyen/services/balancePlatform/manage_card_pin_api.rb +3 -9
- data/lib/adyen/services/balancePlatform/manage_sca_devices_api.rb +6 -18
- data/lib/adyen/services/balancePlatform/managed_payout_schedules_api.rb +80 -0
- data/lib/adyen/services/balancePlatform/network_tokens_api.rb +2 -6
- data/lib/adyen/services/balancePlatform/payment_instrument_groups_api.rb +3 -9
- data/lib/adyen/services/balancePlatform/payment_instruments_api.rb +9 -27
- data/lib/adyen/services/balancePlatform/platform_api.rb +3 -9
- data/lib/adyen/services/balancePlatform/recurring_top_ups_api.rb +48 -0
- data/lib/adyen/services/balancePlatform/sca_association_management_api.rb +3 -9
- data/lib/adyen/services/balancePlatform/sca_device_management_api.rb +11 -9
- data/lib/adyen/services/balancePlatform/transaction_rules_api.rb +4 -12
- data/lib/adyen/services/balancePlatform/transfer_limits_balance_account_level_api.rb +6 -18
- data/lib/adyen/services/balancePlatform/transfer_limits_balance_platform_level_api.rb +4 -12
- data/lib/adyen/services/balancePlatform/transfer_routes_api.rb +1 -3
- data/lib/adyen/services/balancePlatform.rb +20 -0
- data/lib/adyen/services/binLookup/bin_lookup_api.rb +2 -6
- data/lib/adyen/services/capital/dynamic_offers_api.rb +40 -0
- data/lib/adyen/services/capital/grant_accounts_api.rb +1 -3
- data/lib/adyen/services/capital/grant_offers_api.rb +4 -8
- data/lib/adyen/services/capital/grants_api.rb +6 -18
- data/lib/adyen/services/capital.rb +5 -0
- data/lib/adyen/services/checkout/donations_api.rb +2 -6
- data/lib/adyen/services/checkout/modifications_api.rb +6 -18
- data/lib/adyen/services/checkout/orders_api.rb +3 -9
- data/lib/adyen/services/checkout/payment_links_api.rb +3 -9
- data/lib/adyen/services/checkout/payments_api.rb +14 -18
- data/lib/adyen/services/checkout/recurring_api.rb +4 -12
- data/lib/adyen/services/checkout/utility_api.rb +6 -12
- data/lib/adyen/services/checkout.rb +1 -1
- data/lib/adyen/services/dataProtection/data_protection_api.rb +1 -3
- data/lib/adyen/services/disputes/disputes_api.rb +5 -15
- data/lib/adyen/services/legalEntityManagement/business_lines_api.rb +4 -12
- data/lib/adyen/services/legalEntityManagement/documents_api.rb +4 -12
- data/lib/adyen/services/legalEntityManagement/hosted_onboarding_api.rb +3 -9
- data/lib/adyen/services/legalEntityManagement/legal_entities_api.rb +7 -21
- data/lib/adyen/services/legalEntityManagement/pci_questionnaires_api.rb +5 -15
- data/lib/adyen/services/legalEntityManagement/tax_e_delivery_consent_api.rb +2 -6
- data/lib/adyen/services/legalEntityManagement/terms_of_service_api.rb +5 -15
- data/lib/adyen/services/legalEntityManagement/transfer_instruments_api.rb +4 -12
- data/lib/adyen/services/management/account_company_level_api.rb +3 -9
- data/lib/adyen/services/management/account_merchant_level_api.rb +4 -12
- data/lib/adyen/services/management/account_store_level_api.rb +8 -24
- data/lib/adyen/services/management/allowed_origins_company_level_api.rb +4 -12
- data/lib/adyen/services/management/allowed_origins_merchant_level_api.rb +4 -12
- data/lib/adyen/services/management/android_files_company_level_api.rb +6 -18
- data/lib/adyen/services/management/api_credentials_company_level_api.rb +4 -12
- data/lib/adyen/services/management/api_credentials_merchant_level_api.rb +4 -12
- data/lib/adyen/services/management/api_key_company_level_api.rb +1 -3
- data/lib/adyen/services/management/api_key_merchant_level_api.rb +1 -3
- data/lib/adyen/services/management/client_key_company_level_api.rb +1 -3
- data/lib/adyen/services/management/client_key_merchant_level_api.rb +1 -3
- data/lib/adyen/services/management/donation_campaigns_api.rb +64 -0
- data/lib/adyen/services/management/my_api_credential_api.rb +6 -18
- data/lib/adyen/services/management/payment_methods_merchant_level_api.rb +6 -18
- data/lib/adyen/services/management/payout_settings_merchant_level_api.rb +5 -15
- data/lib/adyen/services/management/split_configuration_merchant_level_api.rb +9 -27
- data/lib/adyen/services/management/terminal_actions_company_level_api.rb +2 -6
- data/lib/adyen/services/management/terminal_actions_terminal_level_api.rb +1 -3
- data/lib/adyen/services/management/terminal_orders_company_level_api.rb +10 -30
- data/lib/adyen/services/management/terminal_orders_merchant_level_api.rb +10 -30
- data/lib/adyen/services/management/terminal_settings_company_level_api.rb +4 -12
- data/lib/adyen/services/management/terminal_settings_merchant_level_api.rb +4 -12
- data/lib/adyen/services/management/terminal_settings_store_level_api.rb +8 -24
- data/lib/adyen/services/management/terminal_settings_terminal_level_api.rb +4 -12
- data/lib/adyen/services/management/terminals_terminal_level_api.rb +2 -6
- data/lib/adyen/services/management/users_company_level_api.rb +4 -12
- data/lib/adyen/services/management/users_merchant_level_api.rb +4 -12
- data/lib/adyen/services/management/webhooks_company_level_api.rb +7 -21
- data/lib/adyen/services/management/webhooks_merchant_level_api.rb +7 -21
- data/lib/adyen/services/management.rb +5 -0
- data/lib/adyen/services/payment/modifications_api.rb +10 -24
- data/lib/adyen/services/payment/payments_api.rb +5 -15
- data/lib/adyen/services/paymentsApp/payments_app_api.rb +5 -15
- data/lib/adyen/services/payout/initialization_api.rb +3 -9
- data/lib/adyen/services/payout/instant_payouts_api.rb +1 -3
- data/lib/adyen/services/payout/reviewing_api.rb +2 -6
- data/lib/adyen/services/posMobile/pos_mobile_api.rb +6 -3
- data/lib/adyen/services/posTerminalManagement.rb +10 -0
- data/lib/adyen/services/recurring/recurring_api.rb +10 -18
- data/lib/adyen/services/service.rb +12 -2
- data/lib/adyen/services/sessionAuthentication/session_authentication_api.rb +1 -3
- data/lib/adyen/services/storedValue/stored_value_api.rb +6 -18
- data/lib/adyen/services/transfers/capital_api.rb +9 -9
- data/lib/adyen/services/transfers/cash_out_api.rb +24 -0
- data/lib/adyen/services/transfers/transactions_api.rb +2 -6
- data/lib/adyen/services/transfers/transfers_api.rb +6 -18
- data/lib/adyen/services/transfers.rb +5 -0
- data/lib/adyen/utils/hmac_validator.rb +15 -18
- data/lib/adyen/version.rb +1 -1
- data/sdk-generation-log/balancecontrol.json +8 -0
- data/sdk-generation-log/balanceplatform.json +8 -0
- data/sdk-generation-log/binlookup.json +8 -0
- data/sdk-generation-log/capital.json +8 -0
- data/sdk-generation-log/checkout.json +8 -0
- data/sdk-generation-log/dataprotection.json +8 -0
- data/sdk-generation-log/disputes.json +8 -0
- data/sdk-generation-log/legalentitymanagement.json +8 -0
- data/sdk-generation-log/management.json +8 -0
- data/sdk-generation-log/payment.json +8 -0
- data/sdk-generation-log/paymentsapp.json +8 -0
- data/sdk-generation-log/payout.json +8 -0
- data/sdk-generation-log/posmobile.json +8 -0
- data/sdk-generation-log/recurring.json +8 -0
- data/sdk-generation-log/sessionauthentication.json +8 -0
- data/sdk-generation-log/storedvalue.json +8 -0
- data/sdk-generation-log/transfers.json +8 -0
- data/spec/balance_control_spec.rb +41 -0
- data/spec/balance_platform_spec.rb +609 -4
- data/spec/capital_spec.rb +82 -0
- data/spec/checkout-oauth_spec.rb +220 -10
- data/spec/checkout_spec.rb +245 -10
- data/spec/client_spec.rb +23 -5
- data/spec/deprecation_spec.rb +112 -0
- data/spec/management_spec.rb +184 -0
- data/spec/mocks/requests/BalancePlatform/apply_managed_schedule.json +14 -0
- data/spec/mocks/requests/BalancePlatform/begin_sca_device_registration.json +4 -0
- data/spec/mocks/requests/BalancePlatform/create_recurring_top_up.json +21 -0
- data/spec/mocks/requests/BalancePlatform/create_sweep.json +10 -0
- data/spec/mocks/requests/BalancePlatform/finish_sca_device_registration.json +3 -0
- data/spec/mocks/requests/BalancePlatform/submit_sca_association.json +8 -0
- data/spec/mocks/requests/BalancePlatform/update_balance_account_managed_schedule.json +5 -0
- data/spec/mocks/requests/BalancePlatform/update_mandate.json +14 -0
- data/spec/mocks/requests/BalancePlatform/update_recurring_top_ups.json +3 -0
- data/spec/mocks/requests/BalancePlatform/update_sweep.json +6 -0
- data/spec/mocks/requests/Checkout/amount_updates.json +1 -1
- data/spec/mocks/requests/Checkout/card_details.json +3 -0
- data/spec/mocks/requests/Checkout/create_stored_payment_method.json +10 -0
- data/spec/mocks/requests/Checkout/donation_campaigns.json +4 -0
- data/spec/mocks/requests/Checkout/donations.json +9 -0
- data/spec/mocks/requests/Checkout/orders.json +5 -3
- data/spec/mocks/requests/Checkout/payment-details.json +2 -14
- data/spec/mocks/requests/Checkout/payment_methods_balance.json +5 -2
- data/spec/mocks/requests/Checkout/payments.json +9 -10
- data/spec/mocks/requests/Checkout/paypal_update_order.json +5 -0
- data/spec/mocks/requests/Checkout/reversals.json +3 -0
- data/spec/mocks/requests/Checkout/update_session.json +7 -0
- data/spec/mocks/requests/Management/create_donation_campaign.json +7 -0
- data/spec/mocks/requests/Management/list_nonprofits.json +5 -0
- data/spec/mocks/requests/Management/update_donation_campaign.json +6 -0
- data/spec/mocks/requests/Transfers/initiate_cashout.json +12 -0
- data/spec/mocks/responses/BalancePlatform/apply_managed_schedule.json +17 -0
- data/spec/mocks/responses/BalancePlatform/begin_sca_device_registration.json +8 -0
- data/spec/mocks/responses/BalancePlatform/create_recurring_top_up.json +23 -0
- data/spec/mocks/responses/BalancePlatform/create_sweep.json +12 -0
- data/spec/mocks/responses/BalancePlatform/finish_sca_device_registration.json +7 -0
- data/spec/mocks/responses/BalancePlatform/get_all_sweeps_for_balance_account.json +31 -0
- data/spec/mocks/responses/BalancePlatform/get_balance_account_managed_schedule_by_id.json +17 -0
- data/spec/mocks/responses/BalancePlatform/get_balance_account_managed_schedules.json +26 -0
- data/spec/mocks/responses/BalancePlatform/get_balance_platform_managed_schedule_by_id.json +27 -0
- data/spec/mocks/responses/BalancePlatform/get_balance_platform_managed_schedules.json +31 -0
- data/spec/mocks/responses/BalancePlatform/get_list_of_mandates.json +19 -0
- data/spec/mocks/responses/BalancePlatform/get_mandate_by_id.json +14 -0
- data/spec/mocks/responses/BalancePlatform/get_payout_schedule_executions.json +21 -0
- data/spec/mocks/responses/BalancePlatform/get_recurring_top_ups.json +35 -0
- data/spec/mocks/responses/BalancePlatform/get_sweep.json +12 -0
- data/spec/mocks/responses/BalancePlatform/get_tax_form_summary.json +17 -0
- data/spec/mocks/responses/BalancePlatform/submit_sca_association.json +10 -0
- data/spec/mocks/responses/BalancePlatform/update_balance_account_managed_schedule.json +18 -0
- data/spec/mocks/responses/BalancePlatform/update_recurring_top_ups.json +23 -0
- data/spec/mocks/responses/BalancePlatform/update_sweep.json +12 -0
- data/spec/mocks/responses/Capital/calculate-preliminary-offer-from-dynamic-offer.json +16 -0
- data/spec/mocks/responses/Capital/create-static-offer-from-dynamic-offer.json +9 -0
- data/spec/mocks/responses/Capital/get-all-dynamic-offers.json +18 -0
- data/spec/mocks/responses/Checkout/amount_updates.json +1 -1
- data/spec/mocks/responses/Checkout/card_details.json +5 -0
- data/spec/mocks/responses/Checkout/create_stored_payment_method.json +5 -0
- data/spec/mocks/responses/Checkout/donation_campaigns.json +1 -0
- data/spec/mocks/responses/Checkout/donations.json +5 -0
- data/spec/mocks/responses/Checkout/orders.json +6 -1
- data/spec/mocks/responses/Checkout/orders_cancel.json +1 -1
- data/spec/mocks/responses/Checkout/payment-details.json +2 -13
- data/spec/mocks/responses/Checkout/payment_links.json +3 -0
- data/spec/mocks/responses/Checkout/payment_methods.json +2 -2
- data/spec/mocks/responses/Checkout/payment_methods_balance.json +5 -1
- data/spec/mocks/responses/Checkout/payments.json +4 -94
- data/spec/mocks/responses/Checkout/paypal_update_order.json +4 -0
- data/spec/mocks/responses/Checkout/reversals.json +6 -0
- data/spec/mocks/responses/Checkout/update_session.json +3 -0
- data/spec/mocks/responses/Management/donation_campaign.json +13 -0
- data/spec/mocks/responses/Management/list_donation_campaigns.json +19 -0
- data/spec/mocks/responses/Management/list_nonprofits.json +34 -0
- data/spec/mocks/responses/Transfers/initiate_cashout.json +31 -0
- data/spec/service_spec.rb +40 -0
- data/spec/spec_helper.rb +2 -2
- data/spec/transfers_spec.rb +28 -0
- data/spec/utils/consumer_smoke.rb +23 -0
- data/spec/utils/hmac_validator_spec.rb +55 -0
- data/templates/api-small.mustache +4 -4
- data/templates/api.mustache +4 -4
- metadata +84 -2
|
@@ -14,9 +14,7 @@ module Adyen
|
|
|
14
14
|
|
|
15
15
|
# Create a new user
|
|
16
16
|
def create_new_user(request, merchant_id, headers: {})
|
|
17
|
-
endpoint = '/merchants/{merchantId}/users'
|
|
18
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
19
|
-
endpoint = format(endpoint, merchant_id)
|
|
17
|
+
endpoint = build_endpoint('/merchants/{merchantId}/users', merchant_id)
|
|
20
18
|
|
|
21
19
|
action = { method: 'post', url: endpoint }
|
|
22
20
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
@@ -24,9 +22,7 @@ module Adyen
|
|
|
24
22
|
|
|
25
23
|
# Get user details
|
|
26
24
|
def get_user_details(merchant_id, user_id, headers: {})
|
|
27
|
-
endpoint = '/merchants/{merchantId}/users/{userId}'
|
|
28
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
29
|
-
endpoint = format(endpoint, merchant_id, user_id)
|
|
25
|
+
endpoint = build_endpoint('/merchants/{merchantId}/users/{userId}', merchant_id, user_id)
|
|
30
26
|
|
|
31
27
|
action = { method: 'get', url: endpoint }
|
|
32
28
|
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
@@ -34,9 +30,7 @@ module Adyen
|
|
|
34
30
|
|
|
35
31
|
# Get a list of users
|
|
36
32
|
def list_users(merchant_id, headers: {}, query_params: {})
|
|
37
|
-
endpoint = '/merchants/{merchantId}/users'
|
|
38
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
39
|
-
endpoint = format(endpoint, merchant_id)
|
|
33
|
+
endpoint = build_endpoint('/merchants/{merchantId}/users', merchant_id)
|
|
40
34
|
endpoint += create_query_string(query_params)
|
|
41
35
|
action = { method: 'get', url: endpoint }
|
|
42
36
|
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
@@ -44,9 +38,7 @@ module Adyen
|
|
|
44
38
|
|
|
45
39
|
# Update a user
|
|
46
40
|
def update_user(request, merchant_id, user_id, headers: {})
|
|
47
|
-
endpoint = '/merchants/{merchantId}/users/{userId}'
|
|
48
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
49
|
-
endpoint = format(endpoint, merchant_id, user_id)
|
|
41
|
+
endpoint = build_endpoint('/merchants/{merchantId}/users/{userId}', merchant_id, user_id)
|
|
50
42
|
|
|
51
43
|
action = { method: 'patch', url: endpoint }
|
|
52
44
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
@@ -14,9 +14,7 @@ module Adyen
|
|
|
14
14
|
|
|
15
15
|
# Generate an HMAC key
|
|
16
16
|
def generate_hmac_key(company_id, webhook_id, headers: {})
|
|
17
|
-
endpoint = '/companies/{companyId}/webhooks/{webhookId}/generateHmac'
|
|
18
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
19
|
-
endpoint = format(endpoint, company_id, webhook_id)
|
|
17
|
+
endpoint = build_endpoint('/companies/{companyId}/webhooks/{webhookId}/generateHmac', company_id, webhook_id)
|
|
20
18
|
|
|
21
19
|
action = { method: 'post', url: endpoint }
|
|
22
20
|
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
@@ -24,9 +22,7 @@ module Adyen
|
|
|
24
22
|
|
|
25
23
|
# Get a webhook
|
|
26
24
|
def get_webhook(company_id, webhook_id, headers: {})
|
|
27
|
-
endpoint = '/companies/{companyId}/webhooks/{webhookId}'
|
|
28
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
29
|
-
endpoint = format(endpoint, company_id, webhook_id)
|
|
25
|
+
endpoint = build_endpoint('/companies/{companyId}/webhooks/{webhookId}', company_id, webhook_id)
|
|
30
26
|
|
|
31
27
|
action = { method: 'get', url: endpoint }
|
|
32
28
|
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
@@ -34,9 +30,7 @@ module Adyen
|
|
|
34
30
|
|
|
35
31
|
# List all webhooks
|
|
36
32
|
def list_all_webhooks(company_id, headers: {}, query_params: {})
|
|
37
|
-
endpoint = '/companies/{companyId}/webhooks'
|
|
38
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
39
|
-
endpoint = format(endpoint, company_id)
|
|
33
|
+
endpoint = build_endpoint('/companies/{companyId}/webhooks', company_id)
|
|
40
34
|
endpoint += create_query_string(query_params)
|
|
41
35
|
action = { method: 'get', url: endpoint }
|
|
42
36
|
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
@@ -44,9 +38,7 @@ module Adyen
|
|
|
44
38
|
|
|
45
39
|
# Remove a webhook
|
|
46
40
|
def remove_webhook(company_id, webhook_id, headers: {})
|
|
47
|
-
endpoint = '/companies/{companyId}/webhooks/{webhookId}'
|
|
48
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
49
|
-
endpoint = format(endpoint, company_id, webhook_id)
|
|
41
|
+
endpoint = build_endpoint('/companies/{companyId}/webhooks/{webhookId}', company_id, webhook_id)
|
|
50
42
|
|
|
51
43
|
action = { method: 'delete', url: endpoint }
|
|
52
44
|
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
@@ -54,9 +46,7 @@ module Adyen
|
|
|
54
46
|
|
|
55
47
|
# Set up a webhook
|
|
56
48
|
def set_up_webhook(request, company_id, headers: {})
|
|
57
|
-
endpoint = '/companies/{companyId}/webhooks'
|
|
58
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
59
|
-
endpoint = format(endpoint, company_id)
|
|
49
|
+
endpoint = build_endpoint('/companies/{companyId}/webhooks', company_id)
|
|
60
50
|
|
|
61
51
|
action = { method: 'post', url: endpoint }
|
|
62
52
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
@@ -64,9 +54,7 @@ module Adyen
|
|
|
64
54
|
|
|
65
55
|
# Test a webhook
|
|
66
56
|
def test_webhook(request, company_id, webhook_id, headers: {})
|
|
67
|
-
endpoint = '/companies/{companyId}/webhooks/{webhookId}/test'
|
|
68
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
69
|
-
endpoint = format(endpoint, company_id, webhook_id)
|
|
57
|
+
endpoint = build_endpoint('/companies/{companyId}/webhooks/{webhookId}/test', company_id, webhook_id)
|
|
70
58
|
|
|
71
59
|
action = { method: 'post', url: endpoint }
|
|
72
60
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
@@ -74,9 +62,7 @@ module Adyen
|
|
|
74
62
|
|
|
75
63
|
# Update a webhook
|
|
76
64
|
def update_webhook(request, company_id, webhook_id, headers: {})
|
|
77
|
-
endpoint = '/companies/{companyId}/webhooks/{webhookId}'
|
|
78
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
79
|
-
endpoint = format(endpoint, company_id, webhook_id)
|
|
65
|
+
endpoint = build_endpoint('/companies/{companyId}/webhooks/{webhookId}', company_id, webhook_id)
|
|
80
66
|
|
|
81
67
|
action = { method: 'patch', url: endpoint }
|
|
82
68
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
@@ -14,9 +14,7 @@ module Adyen
|
|
|
14
14
|
|
|
15
15
|
# Generate an HMAC key
|
|
16
16
|
def generate_hmac_key(merchant_id, webhook_id, headers: {})
|
|
17
|
-
endpoint = '/merchants/{merchantId}/webhooks/{webhookId}/generateHmac'
|
|
18
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
19
|
-
endpoint = format(endpoint, merchant_id, webhook_id)
|
|
17
|
+
endpoint = build_endpoint('/merchants/{merchantId}/webhooks/{webhookId}/generateHmac', merchant_id, webhook_id)
|
|
20
18
|
|
|
21
19
|
action = { method: 'post', url: endpoint }
|
|
22
20
|
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
@@ -24,9 +22,7 @@ module Adyen
|
|
|
24
22
|
|
|
25
23
|
# Get a webhook
|
|
26
24
|
def get_webhook(merchant_id, webhook_id, headers: {})
|
|
27
|
-
endpoint = '/merchants/{merchantId}/webhooks/{webhookId}'
|
|
28
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
29
|
-
endpoint = format(endpoint, merchant_id, webhook_id)
|
|
25
|
+
endpoint = build_endpoint('/merchants/{merchantId}/webhooks/{webhookId}', merchant_id, webhook_id)
|
|
30
26
|
|
|
31
27
|
action = { method: 'get', url: endpoint }
|
|
32
28
|
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
@@ -34,9 +30,7 @@ module Adyen
|
|
|
34
30
|
|
|
35
31
|
# List all webhooks
|
|
36
32
|
def list_all_webhooks(merchant_id, headers: {}, query_params: {})
|
|
37
|
-
endpoint = '/merchants/{merchantId}/webhooks'
|
|
38
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
39
|
-
endpoint = format(endpoint, merchant_id)
|
|
33
|
+
endpoint = build_endpoint('/merchants/{merchantId}/webhooks', merchant_id)
|
|
40
34
|
endpoint += create_query_string(query_params)
|
|
41
35
|
action = { method: 'get', url: endpoint }
|
|
42
36
|
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
@@ -44,9 +38,7 @@ module Adyen
|
|
|
44
38
|
|
|
45
39
|
# Remove a webhook
|
|
46
40
|
def remove_webhook(merchant_id, webhook_id, headers: {})
|
|
47
|
-
endpoint = '/merchants/{merchantId}/webhooks/{webhookId}'
|
|
48
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
49
|
-
endpoint = format(endpoint, merchant_id, webhook_id)
|
|
41
|
+
endpoint = build_endpoint('/merchants/{merchantId}/webhooks/{webhookId}', merchant_id, webhook_id)
|
|
50
42
|
|
|
51
43
|
action = { method: 'delete', url: endpoint }
|
|
52
44
|
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
@@ -54,9 +46,7 @@ module Adyen
|
|
|
54
46
|
|
|
55
47
|
# Set up a webhook
|
|
56
48
|
def set_up_webhook(request, merchant_id, headers: {})
|
|
57
|
-
endpoint = '/merchants/{merchantId}/webhooks'
|
|
58
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
59
|
-
endpoint = format(endpoint, merchant_id)
|
|
49
|
+
endpoint = build_endpoint('/merchants/{merchantId}/webhooks', merchant_id)
|
|
60
50
|
|
|
61
51
|
action = { method: 'post', url: endpoint }
|
|
62
52
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
@@ -64,9 +54,7 @@ module Adyen
|
|
|
64
54
|
|
|
65
55
|
# Test a webhook
|
|
66
56
|
def test_webhook(request, merchant_id, webhook_id, headers: {})
|
|
67
|
-
endpoint = '/merchants/{merchantId}/webhooks/{webhookId}/test'
|
|
68
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
69
|
-
endpoint = format(endpoint, merchant_id, webhook_id)
|
|
57
|
+
endpoint = build_endpoint('/merchants/{merchantId}/webhooks/{webhookId}/test', merchant_id, webhook_id)
|
|
70
58
|
|
|
71
59
|
action = { method: 'post', url: endpoint }
|
|
72
60
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
@@ -74,9 +62,7 @@ module Adyen
|
|
|
74
62
|
|
|
75
63
|
# Update a webhook
|
|
76
64
|
def update_webhook(request, merchant_id, webhook_id, headers: {})
|
|
77
|
-
endpoint = '/merchants/{merchantId}/webhooks/{webhookId}'
|
|
78
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
79
|
-
endpoint = format(endpoint, merchant_id, webhook_id)
|
|
65
|
+
endpoint = build_endpoint('/merchants/{merchantId}/webhooks/{webhookId}', merchant_id, webhook_id)
|
|
80
66
|
|
|
81
67
|
action = { method: 'patch', url: endpoint }
|
|
82
68
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
@@ -10,6 +10,7 @@ require_relative 'management/allowed_origins_merchant_level_api'
|
|
|
10
10
|
require_relative 'management/android_files_company_level_api'
|
|
11
11
|
require_relative 'management/client_key_company_level_api'
|
|
12
12
|
require_relative 'management/client_key_merchant_level_api'
|
|
13
|
+
require_relative 'management/donation_campaigns_api'
|
|
13
14
|
require_relative 'management/my_api_credential_api'
|
|
14
15
|
require_relative 'management/payment_methods_merchant_level_api'
|
|
15
16
|
require_relative 'management/payout_settings_merchant_level_api'
|
|
@@ -92,6 +93,10 @@ module Adyen
|
|
|
92
93
|
@client_key_merchant_level_api ||= Adyen::ClientKeyMerchantLevelApi.new(@client, @version)
|
|
93
94
|
end
|
|
94
95
|
|
|
96
|
+
def donation_campaigns_api
|
|
97
|
+
@donation_campaigns_api ||= Adyen::DonationCampaignsApi.new(@client, @version)
|
|
98
|
+
end
|
|
99
|
+
|
|
95
100
|
def my_api_credential_api
|
|
96
101
|
@my_api_credential_api ||= Adyen::MyAPICredentialApi.new(@client, @version)
|
|
97
102
|
end
|
|
@@ -14,9 +14,7 @@ module Adyen
|
|
|
14
14
|
|
|
15
15
|
# Change the authorised amount
|
|
16
16
|
def adjust_authorisation(request, headers: {})
|
|
17
|
-
endpoint = '/adjustAuthorisation'
|
|
18
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
19
|
-
endpoint = format(endpoint)
|
|
17
|
+
endpoint = build_endpoint('/adjustAuthorisation')
|
|
20
18
|
|
|
21
19
|
action = { method: 'post', url: endpoint }
|
|
22
20
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
@@ -24,9 +22,7 @@ module Adyen
|
|
|
24
22
|
|
|
25
23
|
# Cancel an authorisation
|
|
26
24
|
def cancel(request, headers: {})
|
|
27
|
-
endpoint = '/cancel'
|
|
28
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
29
|
-
endpoint = format(endpoint)
|
|
25
|
+
endpoint = build_endpoint('/cancel')
|
|
30
26
|
|
|
31
27
|
action = { method: 'post', url: endpoint }
|
|
32
28
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
@@ -34,9 +30,7 @@ module Adyen
|
|
|
34
30
|
|
|
35
31
|
# Cancel or refund a payment
|
|
36
32
|
def cancel_or_refund(request, headers: {})
|
|
37
|
-
endpoint = '/cancelOrRefund'
|
|
38
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
39
|
-
endpoint = format(endpoint)
|
|
33
|
+
endpoint = build_endpoint('/cancelOrRefund')
|
|
40
34
|
|
|
41
35
|
action = { method: 'post', url: endpoint }
|
|
42
36
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
@@ -44,9 +38,7 @@ module Adyen
|
|
|
44
38
|
|
|
45
39
|
# Capture an authorisation
|
|
46
40
|
def capture(request, headers: {})
|
|
47
|
-
endpoint = '/capture'
|
|
48
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
49
|
-
endpoint = format(endpoint)
|
|
41
|
+
endpoint = build_endpoint('/capture')
|
|
50
42
|
|
|
51
43
|
action = { method: 'post', url: endpoint }
|
|
52
44
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
@@ -55,10 +47,10 @@ module Adyen
|
|
|
55
47
|
# Create a donation
|
|
56
48
|
#
|
|
57
49
|
# Deprecated
|
|
50
|
+
# @deprecated
|
|
58
51
|
def donate(request, headers: {})
|
|
59
|
-
|
|
60
|
-
endpoint =
|
|
61
|
-
endpoint = format(endpoint)
|
|
52
|
+
Adyen::Deprecation.warn(:donate)
|
|
53
|
+
endpoint = build_endpoint('/donate')
|
|
62
54
|
|
|
63
55
|
action = { method: 'post', url: endpoint }
|
|
64
56
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
@@ -66,9 +58,7 @@ module Adyen
|
|
|
66
58
|
|
|
67
59
|
# Refund a captured payment
|
|
68
60
|
def refund(request, headers: {})
|
|
69
|
-
endpoint = '/refund'
|
|
70
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
71
|
-
endpoint = format(endpoint)
|
|
61
|
+
endpoint = build_endpoint('/refund')
|
|
72
62
|
|
|
73
63
|
action = { method: 'post', url: endpoint }
|
|
74
64
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
@@ -76,9 +66,7 @@ module Adyen
|
|
|
76
66
|
|
|
77
67
|
# Cancel an authorisation using your reference
|
|
78
68
|
def technical_cancel(request, headers: {})
|
|
79
|
-
endpoint = '/technicalCancel'
|
|
80
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
81
|
-
endpoint = format(endpoint)
|
|
69
|
+
endpoint = build_endpoint('/technicalCancel')
|
|
82
70
|
|
|
83
71
|
action = { method: 'post', url: endpoint }
|
|
84
72
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
@@ -86,9 +74,7 @@ module Adyen
|
|
|
86
74
|
|
|
87
75
|
# Cancel an in-person refund
|
|
88
76
|
def void_pending_refund(request, headers: {})
|
|
89
|
-
endpoint = '/voidPendingRefund'
|
|
90
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
91
|
-
endpoint = format(endpoint)
|
|
77
|
+
endpoint = build_endpoint('/voidPendingRefund')
|
|
92
78
|
|
|
93
79
|
action = { method: 'post', url: endpoint }
|
|
94
80
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
@@ -14,9 +14,7 @@ module Adyen
|
|
|
14
14
|
|
|
15
15
|
# Create an authorisation
|
|
16
16
|
def authorise(request, headers: {})
|
|
17
|
-
endpoint = '/authorise'
|
|
18
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
19
|
-
endpoint = format(endpoint)
|
|
17
|
+
endpoint = build_endpoint('/authorise')
|
|
20
18
|
|
|
21
19
|
action = { method: 'post', url: endpoint }
|
|
22
20
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
@@ -24,9 +22,7 @@ module Adyen
|
|
|
24
22
|
|
|
25
23
|
# Complete a 3DS authorisation
|
|
26
24
|
def authorise3d(request, headers: {})
|
|
27
|
-
endpoint = '/authorise3d'
|
|
28
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
29
|
-
endpoint = format(endpoint)
|
|
25
|
+
endpoint = build_endpoint('/authorise3d')
|
|
30
26
|
|
|
31
27
|
action = { method: 'post', url: endpoint }
|
|
32
28
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
@@ -34,9 +30,7 @@ module Adyen
|
|
|
34
30
|
|
|
35
31
|
# Complete a 3DS2 authorisation
|
|
36
32
|
def authorise3ds2(request, headers: {})
|
|
37
|
-
endpoint = '/authorise3ds2'
|
|
38
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
39
|
-
endpoint = format(endpoint)
|
|
33
|
+
endpoint = build_endpoint('/authorise3ds2')
|
|
40
34
|
|
|
41
35
|
action = { method: 'post', url: endpoint }
|
|
42
36
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
@@ -44,9 +38,7 @@ module Adyen
|
|
|
44
38
|
|
|
45
39
|
# Get the 3DS authentication result
|
|
46
40
|
def get_authentication_result(request, headers: {})
|
|
47
|
-
endpoint = '/getAuthenticationResult'
|
|
48
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
49
|
-
endpoint = format(endpoint)
|
|
41
|
+
endpoint = build_endpoint('/getAuthenticationResult')
|
|
50
42
|
|
|
51
43
|
action = { method: 'post', url: endpoint }
|
|
52
44
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
@@ -54,9 +46,7 @@ module Adyen
|
|
|
54
46
|
|
|
55
47
|
# Get the 3DS2 authentication result
|
|
56
48
|
def retrieve3ds2_result(request, headers: {})
|
|
57
|
-
endpoint = '/retrieve3ds2Result'
|
|
58
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
59
|
-
endpoint = format(endpoint)
|
|
49
|
+
endpoint = build_endpoint('/retrieve3ds2Result')
|
|
60
50
|
|
|
61
51
|
action = { method: 'post', url: endpoint }
|
|
62
52
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
@@ -14,9 +14,7 @@ module Adyen
|
|
|
14
14
|
|
|
15
15
|
# Create a boarding token - merchant level
|
|
16
16
|
def generate_payments_app_boarding_token_for_merchant(request, merchant_id, headers: {})
|
|
17
|
-
endpoint = '/merchants/{merchantId}/generatePaymentsAppBoardingToken'
|
|
18
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
19
|
-
endpoint = format(endpoint, merchant_id)
|
|
17
|
+
endpoint = build_endpoint('/merchants/{merchantId}/generatePaymentsAppBoardingToken', merchant_id)
|
|
20
18
|
|
|
21
19
|
action = { method: 'post', url: endpoint }
|
|
22
20
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
@@ -24,9 +22,7 @@ module Adyen
|
|
|
24
22
|
|
|
25
23
|
# Create a boarding token - store level
|
|
26
24
|
def generate_payments_app_boarding_token_for_store(request, merchant_id, store_id, headers: {})
|
|
27
|
-
endpoint = '/merchants/{merchantId}/stores/{storeId}/generatePaymentsAppBoardingToken'
|
|
28
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
29
|
-
endpoint = format(endpoint, merchant_id, store_id)
|
|
25
|
+
endpoint = build_endpoint('/merchants/{merchantId}/stores/{storeId}/generatePaymentsAppBoardingToken', merchant_id, store_id)
|
|
30
26
|
|
|
31
27
|
action = { method: 'post', url: endpoint }
|
|
32
28
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
@@ -34,9 +30,7 @@ module Adyen
|
|
|
34
30
|
|
|
35
31
|
# Get a list of Payments Apps - merchant level
|
|
36
32
|
def list_payments_app_for_merchant(merchant_id, headers: {}, query_params: {})
|
|
37
|
-
endpoint = '/merchants/{merchantId}/paymentsApps'
|
|
38
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
39
|
-
endpoint = format(endpoint, merchant_id)
|
|
33
|
+
endpoint = build_endpoint('/merchants/{merchantId}/paymentsApps', merchant_id)
|
|
40
34
|
endpoint += create_query_string(query_params)
|
|
41
35
|
action = { method: 'get', url: endpoint }
|
|
42
36
|
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
@@ -44,9 +38,7 @@ module Adyen
|
|
|
44
38
|
|
|
45
39
|
# Get a list of Payments Apps - store level
|
|
46
40
|
def list_payments_app_for_store(merchant_id, store_id, headers: {}, query_params: {})
|
|
47
|
-
endpoint = '/merchants/{merchantId}/stores/{storeId}/paymentsApps'
|
|
48
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
49
|
-
endpoint = format(endpoint, merchant_id, store_id)
|
|
41
|
+
endpoint = build_endpoint('/merchants/{merchantId}/stores/{storeId}/paymentsApps', merchant_id, store_id)
|
|
50
42
|
endpoint += create_query_string(query_params)
|
|
51
43
|
action = { method: 'get', url: endpoint }
|
|
52
44
|
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
@@ -54,9 +46,7 @@ module Adyen
|
|
|
54
46
|
|
|
55
47
|
# Revoke Payments App instance authentication
|
|
56
48
|
def revoke_payments_app(merchant_id, installation_id, headers: {})
|
|
57
|
-
endpoint = '/merchants/{merchantId}/paymentsApps/{installationId}/revoke'
|
|
58
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
59
|
-
endpoint = format(endpoint, merchant_id, installation_id)
|
|
49
|
+
endpoint = build_endpoint('/merchants/{merchantId}/paymentsApps/{installationId}/revoke', merchant_id, installation_id)
|
|
60
50
|
|
|
61
51
|
action = { method: 'post', url: endpoint }
|
|
62
52
|
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
@@ -14,9 +14,7 @@ module Adyen
|
|
|
14
14
|
|
|
15
15
|
# Store payout details
|
|
16
16
|
def store_detail(request, headers: {})
|
|
17
|
-
endpoint = '/storeDetail'
|
|
18
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
19
|
-
endpoint = format(endpoint)
|
|
17
|
+
endpoint = build_endpoint('/storeDetail')
|
|
20
18
|
|
|
21
19
|
action = { method: 'post', url: endpoint }
|
|
22
20
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
@@ -24,9 +22,7 @@ module Adyen
|
|
|
24
22
|
|
|
25
23
|
# Store details and submit a payout
|
|
26
24
|
def store_detail_and_submit_third_party(request, headers: {})
|
|
27
|
-
endpoint = '/storeDetailAndSubmitThirdParty'
|
|
28
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
29
|
-
endpoint = format(endpoint)
|
|
25
|
+
endpoint = build_endpoint('/storeDetailAndSubmitThirdParty')
|
|
30
26
|
|
|
31
27
|
action = { method: 'post', url: endpoint }
|
|
32
28
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
@@ -34,9 +30,7 @@ module Adyen
|
|
|
34
30
|
|
|
35
31
|
# Submit a payout
|
|
36
32
|
def submit_third_party(request, headers: {})
|
|
37
|
-
endpoint = '/submitThirdParty'
|
|
38
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
39
|
-
endpoint = format(endpoint)
|
|
33
|
+
endpoint = build_endpoint('/submitThirdParty')
|
|
40
34
|
|
|
41
35
|
action = { method: 'post', url: endpoint }
|
|
42
36
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
@@ -14,9 +14,7 @@ module Adyen
|
|
|
14
14
|
|
|
15
15
|
# Make an instant card payout
|
|
16
16
|
def payout(request, headers: {})
|
|
17
|
-
endpoint = '/payout'
|
|
18
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
19
|
-
endpoint = format(endpoint)
|
|
17
|
+
endpoint = build_endpoint('/payout')
|
|
20
18
|
|
|
21
19
|
action = { method: 'post', url: endpoint }
|
|
22
20
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
@@ -14,9 +14,7 @@ module Adyen
|
|
|
14
14
|
|
|
15
15
|
# Confirm a payout
|
|
16
16
|
def confirm_third_party(request, headers: {})
|
|
17
|
-
endpoint = '/confirmThirdParty'
|
|
18
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
19
|
-
endpoint = format(endpoint)
|
|
17
|
+
endpoint = build_endpoint('/confirmThirdParty')
|
|
20
18
|
|
|
21
19
|
action = { method: 'post', url: endpoint }
|
|
22
20
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
@@ -24,9 +22,7 @@ module Adyen
|
|
|
24
22
|
|
|
25
23
|
# Cancel a payout
|
|
26
24
|
def decline_third_party(request, headers: {})
|
|
27
|
-
endpoint = '/declineThirdParty'
|
|
28
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
29
|
-
endpoint = format(endpoint)
|
|
25
|
+
endpoint = build_endpoint('/declineThirdParty')
|
|
30
26
|
|
|
31
27
|
action = { method: 'post', url: endpoint }
|
|
32
28
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
@@ -13,10 +13,13 @@ module Adyen
|
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
# Create a communication session
|
|
16
|
+
#
|
|
17
|
+
# Deprecated since POS Mobile API v68
|
|
18
|
+
# Use POST [/auth/certificate](https://docs.adyen.com/api-explorer/softpos-configuration-api/latest/post/auth/certificate) to establish secure communications.
|
|
19
|
+
# @deprecated
|
|
16
20
|
def create_communication_session(request, headers: {})
|
|
17
|
-
|
|
18
|
-
endpoint =
|
|
19
|
-
endpoint = format(endpoint)
|
|
21
|
+
Adyen::Deprecation.warn(:create_communication_session, since: 'POS Mobile API v68', message: 'Use POST [/auth/certificate](https://docs.adyen.com/api-explorer/softpos-configuration-api/latest/post/auth/certificate) to establish secure communications.')
|
|
22
|
+
endpoint = build_endpoint('/sessions')
|
|
20
23
|
|
|
21
24
|
action = { method: 'post', url: endpoint }
|
|
22
25
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
@@ -17,7 +17,9 @@ module Adyen
|
|
|
17
17
|
#
|
|
18
18
|
# Deprecated since POS Terminal Management API v1
|
|
19
19
|
# Use [Management API](https://docs.adyen.com/api-explorer/Management/latest/overview).
|
|
20
|
+
# @deprecated
|
|
20
21
|
def assign_terminals(request, headers: {})
|
|
22
|
+
Adyen::Deprecation.warn(:assign_terminals, since: 'POS Terminal Management API v1', message: "Use [Management API](https://docs.adyen.com/api-explorer/Management/latest/overview).")
|
|
21
23
|
endpoint = '/assignTerminals'.gsub(/{.+?}/, '%s')
|
|
22
24
|
endpoint = endpoint.gsub(%r{^/}, '')
|
|
23
25
|
endpoint = format(endpoint)
|
|
@@ -30,7 +32,9 @@ module Adyen
|
|
|
30
32
|
#
|
|
31
33
|
# Deprecated since POS Terminal Management API v1
|
|
32
34
|
# Use [Management API](https://docs.adyen.com/api-explorer/Management/latest/overview).
|
|
35
|
+
# @deprecated
|
|
33
36
|
def find_terminal(request, headers: {})
|
|
37
|
+
Adyen::Deprecation.warn(:find_terminal, since: 'POS Terminal Management API v1', message: "Use [Management API](https://docs.adyen.com/api-explorer/Management/latest/overview).")
|
|
34
38
|
endpoint = '/findTerminal'.gsub(/{.+?}/, '%s')
|
|
35
39
|
endpoint = endpoint.gsub(%r{^/}, '')
|
|
36
40
|
endpoint = format(endpoint)
|
|
@@ -43,7 +47,9 @@ module Adyen
|
|
|
43
47
|
#
|
|
44
48
|
# Deprecated since POS Terminal Management API v1
|
|
45
49
|
# Use [Management API](https://docs.adyen.com/api-explorer/Management/latest/overview).
|
|
50
|
+
# @deprecated
|
|
46
51
|
def get_stores_under_account(request, headers: {})
|
|
52
|
+
Adyen::Deprecation.warn(:get_stores_under_account, since: 'POS Terminal Management API v1', message: "Use [Management API](https://docs.adyen.com/api-explorer/Management/latest/overview).")
|
|
47
53
|
endpoint = '/getStoresUnderAccount'.gsub(/{.+?}/, '%s')
|
|
48
54
|
endpoint = endpoint.gsub(%r{^/}, '')
|
|
49
55
|
endpoint = format(endpoint)
|
|
@@ -56,7 +62,9 @@ module Adyen
|
|
|
56
62
|
#
|
|
57
63
|
# Deprecated since POS Terminal Management API v1
|
|
58
64
|
# Use [Management API](https://docs.adyen.com/api-explorer/Management/latest/overview).
|
|
65
|
+
# @deprecated
|
|
59
66
|
def get_terminal_details(request, headers: {})
|
|
67
|
+
Adyen::Deprecation.warn(:get_terminal_details, since: 'POS Terminal Management API v1', message: "Use [Management API](https://docs.adyen.com/api-explorer/Management/latest/overview).")
|
|
60
68
|
endpoint = '/getTerminalDetails'.gsub(/{.+?}/, '%s')
|
|
61
69
|
endpoint = endpoint.gsub(%r{^/}, '')
|
|
62
70
|
endpoint = format(endpoint)
|
|
@@ -69,7 +77,9 @@ module Adyen
|
|
|
69
77
|
#
|
|
70
78
|
# Deprecated since POS Terminal Management API v1
|
|
71
79
|
# Use [Management API](https://docs.adyen.com/api-explorer/Management/latest/overview).
|
|
80
|
+
# @deprecated
|
|
72
81
|
def get_terminals_under_account(request, headers: {})
|
|
82
|
+
Adyen::Deprecation.warn(:get_terminals_under_account, since: 'POS Terminal Management API v1', message: "Use [Management API](https://docs.adyen.com/api-explorer/Management/latest/overview).")
|
|
73
83
|
endpoint = '/getTerminalsUnderAccount'.gsub(/{.+?}/, '%s')
|
|
74
84
|
endpoint = endpoint.gsub(%r{^/}, '')
|
|
75
85
|
endpoint = format(endpoint)
|
|
@@ -15,10 +15,10 @@ module Adyen
|
|
|
15
15
|
# Create new permits linked to a recurring contract.
|
|
16
16
|
#
|
|
17
17
|
# Deprecated since Adyen Recurring API v68
|
|
18
|
+
# @deprecated
|
|
18
19
|
def create_permit(request, headers: {})
|
|
19
|
-
|
|
20
|
-
endpoint =
|
|
21
|
-
endpoint = format(endpoint)
|
|
20
|
+
Adyen::Deprecation.warn(:create_permit, since: 'Adyen Recurring API v68')
|
|
21
|
+
endpoint = build_endpoint('/createPermit')
|
|
22
22
|
|
|
23
23
|
action = { method: 'post', url: endpoint }
|
|
24
24
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
@@ -26,9 +26,7 @@ module Adyen
|
|
|
26
26
|
|
|
27
27
|
# Disable stored payment details
|
|
28
28
|
def disable(request, headers: {})
|
|
29
|
-
endpoint = '/disable'
|
|
30
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
31
|
-
endpoint = format(endpoint)
|
|
29
|
+
endpoint = build_endpoint('/disable')
|
|
32
30
|
|
|
33
31
|
action = { method: 'post', url: endpoint }
|
|
34
32
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
@@ -37,10 +35,10 @@ module Adyen
|
|
|
37
35
|
# Disable an existing permit.
|
|
38
36
|
#
|
|
39
37
|
# Deprecated since Adyen Recurring API v68
|
|
38
|
+
# @deprecated
|
|
40
39
|
def disable_permit(request, headers: {})
|
|
41
|
-
|
|
42
|
-
endpoint =
|
|
43
|
-
endpoint = format(endpoint)
|
|
40
|
+
Adyen::Deprecation.warn(:disable_permit, since: 'Adyen Recurring API v68')
|
|
41
|
+
endpoint = build_endpoint('/disablePermit')
|
|
44
42
|
|
|
45
43
|
action = { method: 'post', url: endpoint }
|
|
46
44
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
@@ -48,9 +46,7 @@ module Adyen
|
|
|
48
46
|
|
|
49
47
|
# Get stored payment details
|
|
50
48
|
def list_recurring_details(request, headers: {})
|
|
51
|
-
endpoint = '/listRecurringDetails'
|
|
52
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
53
|
-
endpoint = format(endpoint)
|
|
49
|
+
endpoint = build_endpoint('/listRecurringDetails')
|
|
54
50
|
|
|
55
51
|
action = { method: 'post', url: endpoint }
|
|
56
52
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
@@ -58,9 +54,7 @@ module Adyen
|
|
|
58
54
|
|
|
59
55
|
# Ask issuer to notify the shopper
|
|
60
56
|
def notify_shopper(request, headers: {})
|
|
61
|
-
endpoint = '/notifyShopper'
|
|
62
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
63
|
-
endpoint = format(endpoint)
|
|
57
|
+
endpoint = build_endpoint('/notifyShopper')
|
|
64
58
|
|
|
65
59
|
action = { method: 'post', url: endpoint }
|
|
66
60
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
@@ -68,9 +62,7 @@ module Adyen
|
|
|
68
62
|
|
|
69
63
|
# Schedule running the Account Updater
|
|
70
64
|
def schedule_account_updater(request, headers: {})
|
|
71
|
-
endpoint = '/scheduleAccountUpdater'
|
|
72
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
73
|
-
endpoint = format(endpoint)
|
|
65
|
+
endpoint = build_endpoint('/scheduleAccountUpdater')
|
|
74
66
|
|
|
75
67
|
action = { method: 'post', url: endpoint }
|
|
76
68
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
require_relative '../deprecation'
|
|
2
|
+
|
|
1
3
|
module Adyen
|
|
2
4
|
class Service
|
|
3
5
|
attr_accessor :service, :version
|
|
@@ -27,8 +29,16 @@ module Adyen
|
|
|
27
29
|
end
|
|
28
30
|
|
|
29
31
|
# create query parameter from a hash
|
|
30
|
-
def create_query_string(
|
|
31
|
-
|
|
32
|
+
def create_query_string(params)
|
|
33
|
+
return '' if params.empty?
|
|
34
|
+
"?#{URI.encode_www_form(params)}"
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
private
|
|
38
|
+
|
|
39
|
+
def build_endpoint(path, *params)
|
|
40
|
+
endpoint = path.gsub('%', '%%').gsub(/{.+?}/, '%s').delete_prefix('/')
|
|
41
|
+
format(endpoint, *params)
|
|
32
42
|
end
|
|
33
43
|
end
|
|
34
44
|
end
|