adyen-ruby-api-library 11.2.0 → 11.3.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.
Files changed (131) hide show
  1. checksums.yaml +4 -4
  2. data/.github/CODEOWNERS +1 -1
  3. data/.github/workflows/codeql.yml +4 -4
  4. data/.github/workflows/release.yml +1 -1
  5. data/.github/workflows/ruby.yml +1 -1
  6. data/.github/workflows/rubygems_release.yml +1 -1
  7. data/.github/workflows/stale.yml +1 -1
  8. data/VERSION +1 -1
  9. data/lib/adyen/client.rb +4 -5
  10. data/lib/adyen/services/balanceControl/balance_control_api.rb +1 -3
  11. data/lib/adyen/services/balancePlatform/account_holders_api.rb +14 -18
  12. data/lib/adyen/services/balancePlatform/authorized_card_users_api.rb +4 -12
  13. data/lib/adyen/services/balancePlatform/balance_accounts_api.rb +10 -30
  14. data/lib/adyen/services/balancePlatform/balances_api.rb +5 -15
  15. data/lib/adyen/services/balancePlatform/bank_account_validation_api.rb +1 -3
  16. data/lib/adyen/services/balancePlatform/card_orders_api.rb +2 -6
  17. data/lib/adyen/services/balancePlatform/direct_debit_mandates_api.rb +48 -0
  18. data/lib/adyen/services/balancePlatform/grant_accounts_api.rb +1 -3
  19. data/lib/adyen/services/balancePlatform/grant_offers_api.rb +2 -6
  20. data/lib/adyen/services/balancePlatform/manage_card_pin_api.rb +3 -9
  21. data/lib/adyen/services/balancePlatform/manage_sca_devices_api.rb +6 -18
  22. data/lib/adyen/services/balancePlatform/network_tokens_api.rb +2 -6
  23. data/lib/adyen/services/balancePlatform/payment_instrument_groups_api.rb +3 -9
  24. data/lib/adyen/services/balancePlatform/payment_instruments_api.rb +9 -27
  25. data/lib/adyen/services/balancePlatform/platform_api.rb +3 -9
  26. data/lib/adyen/services/balancePlatform/sca_association_management_api.rb +3 -9
  27. data/lib/adyen/services/balancePlatform/sca_device_management_api.rb +3 -9
  28. data/lib/adyen/services/balancePlatform/transaction_rules_api.rb +4 -12
  29. data/lib/adyen/services/balancePlatform/transfer_limits_balance_account_level_api.rb +6 -18
  30. data/lib/adyen/services/balancePlatform/transfer_limits_balance_platform_level_api.rb +4 -12
  31. data/lib/adyen/services/balancePlatform/transfer_routes_api.rb +1 -3
  32. data/lib/adyen/services/balancePlatform.rb +5 -0
  33. data/lib/adyen/services/binLookup/bin_lookup_api.rb +2 -6
  34. data/lib/adyen/services/capital/dynamic_offers_api.rb +40 -0
  35. data/lib/adyen/services/capital/grant_accounts_api.rb +1 -3
  36. data/lib/adyen/services/capital/grant_offers_api.rb +4 -8
  37. data/lib/adyen/services/capital/grants_api.rb +6 -18
  38. data/lib/adyen/services/capital.rb +5 -0
  39. data/lib/adyen/services/checkout/donations_api.rb +2 -6
  40. data/lib/adyen/services/checkout/modifications_api.rb +6 -18
  41. data/lib/adyen/services/checkout/orders_api.rb +3 -9
  42. data/lib/adyen/services/checkout/payment_links_api.rb +3 -9
  43. data/lib/adyen/services/checkout/payments_api.rb +6 -18
  44. data/lib/adyen/services/checkout/recurring_api.rb +4 -12
  45. data/lib/adyen/services/checkout/utility_api.rb +4 -12
  46. data/lib/adyen/services/dataProtection/data_protection_api.rb +1 -3
  47. data/lib/adyen/services/disputes/disputes_api.rb +5 -15
  48. data/lib/adyen/services/legalEntityManagement/business_lines_api.rb +4 -12
  49. data/lib/adyen/services/legalEntityManagement/documents_api.rb +4 -12
  50. data/lib/adyen/services/legalEntityManagement/hosted_onboarding_api.rb +3 -9
  51. data/lib/adyen/services/legalEntityManagement/legal_entities_api.rb +7 -21
  52. data/lib/adyen/services/legalEntityManagement/pci_questionnaires_api.rb +5 -15
  53. data/lib/adyen/services/legalEntityManagement/tax_e_delivery_consent_api.rb +2 -6
  54. data/lib/adyen/services/legalEntityManagement/terms_of_service_api.rb +5 -15
  55. data/lib/adyen/services/legalEntityManagement/transfer_instruments_api.rb +4 -12
  56. data/lib/adyen/services/management/account_company_level_api.rb +3 -9
  57. data/lib/adyen/services/management/account_merchant_level_api.rb +4 -12
  58. data/lib/adyen/services/management/account_store_level_api.rb +8 -24
  59. data/lib/adyen/services/management/allowed_origins_company_level_api.rb +4 -12
  60. data/lib/adyen/services/management/allowed_origins_merchant_level_api.rb +4 -12
  61. data/lib/adyen/services/management/android_files_company_level_api.rb +6 -18
  62. data/lib/adyen/services/management/api_credentials_company_level_api.rb +4 -12
  63. data/lib/adyen/services/management/api_credentials_merchant_level_api.rb +4 -12
  64. data/lib/adyen/services/management/api_key_company_level_api.rb +1 -3
  65. data/lib/adyen/services/management/api_key_merchant_level_api.rb +1 -3
  66. data/lib/adyen/services/management/client_key_company_level_api.rb +1 -3
  67. data/lib/adyen/services/management/client_key_merchant_level_api.rb +1 -3
  68. data/lib/adyen/services/management/my_api_credential_api.rb +6 -18
  69. data/lib/adyen/services/management/payment_methods_merchant_level_api.rb +6 -18
  70. data/lib/adyen/services/management/payout_settings_merchant_level_api.rb +5 -15
  71. data/lib/adyen/services/management/split_configuration_merchant_level_api.rb +9 -27
  72. data/lib/adyen/services/management/terminal_actions_company_level_api.rb +2 -6
  73. data/lib/adyen/services/management/terminal_actions_terminal_level_api.rb +1 -3
  74. data/lib/adyen/services/management/terminal_orders_company_level_api.rb +10 -30
  75. data/lib/adyen/services/management/terminal_orders_merchant_level_api.rb +10 -30
  76. data/lib/adyen/services/management/terminal_settings_company_level_api.rb +4 -12
  77. data/lib/adyen/services/management/terminal_settings_merchant_level_api.rb +4 -12
  78. data/lib/adyen/services/management/terminal_settings_store_level_api.rb +8 -24
  79. data/lib/adyen/services/management/terminal_settings_terminal_level_api.rb +4 -12
  80. data/lib/adyen/services/management/terminals_terminal_level_api.rb +2 -6
  81. data/lib/adyen/services/management/users_company_level_api.rb +4 -12
  82. data/lib/adyen/services/management/users_merchant_level_api.rb +4 -12
  83. data/lib/adyen/services/management/webhooks_company_level_api.rb +7 -21
  84. data/lib/adyen/services/management/webhooks_merchant_level_api.rb +7 -21
  85. data/lib/adyen/services/payment/modifications_api.rb +8 -24
  86. data/lib/adyen/services/payment/payments_api.rb +5 -15
  87. data/lib/adyen/services/paymentsApp/payments_app_api.rb +5 -15
  88. data/lib/adyen/services/payout/initialization_api.rb +3 -9
  89. data/lib/adyen/services/payout/instant_payouts_api.rb +1 -3
  90. data/lib/adyen/services/payout/reviewing_api.rb +2 -6
  91. data/lib/adyen/services/posMobile/pos_mobile_api.rb +1 -3
  92. data/lib/adyen/services/recurring/recurring_api.rb +6 -18
  93. data/lib/adyen/services/service.rb +10 -2
  94. data/lib/adyen/services/sessionAuthentication/session_authentication_api.rb +1 -3
  95. data/lib/adyen/services/storedValue/stored_value_api.rb +6 -18
  96. data/lib/adyen/services/transfers/capital_api.rb +3 -9
  97. data/lib/adyen/services/transfers/transactions_api.rb +2 -6
  98. data/lib/adyen/services/transfers/transfers_api.rb +6 -18
  99. data/lib/adyen/utils/hmac_validator.rb +0 -1
  100. data/lib/adyen/version.rb +1 -1
  101. data/sdk-generation-log/balancecontrol.json +8 -0
  102. data/sdk-generation-log/balanceplatform.json +8 -0
  103. data/sdk-generation-log/binlookup.json +8 -0
  104. data/sdk-generation-log/capital.json +8 -0
  105. data/sdk-generation-log/checkout.json +8 -0
  106. data/sdk-generation-log/dataprotection.json +8 -0
  107. data/sdk-generation-log/disputes.json +8 -0
  108. data/sdk-generation-log/legalentitymanagement.json +8 -0
  109. data/sdk-generation-log/management.json +8 -0
  110. data/sdk-generation-log/payment.json +8 -0
  111. data/sdk-generation-log/paymentsapp.json +8 -0
  112. data/sdk-generation-log/payout.json +8 -0
  113. data/sdk-generation-log/posmobile.json +8 -0
  114. data/sdk-generation-log/recurring.json +8 -0
  115. data/sdk-generation-log/sessionauthentication.json +8 -0
  116. data/sdk-generation-log/storedvalue.json +8 -0
  117. data/sdk-generation-log/transfers.json +8 -0
  118. data/spec/balance_platform_spec.rb +111 -0
  119. data/spec/capital_spec.rb +82 -0
  120. data/spec/client_spec.rb +22 -0
  121. data/spec/mocks/requests/BalancePlatform/update_mandate.json +14 -0
  122. data/spec/mocks/responses/BalancePlatform/get_list_of_mandates.json +19 -0
  123. data/spec/mocks/responses/BalancePlatform/get_mandate_by_id.json +14 -0
  124. data/spec/mocks/responses/BalancePlatform/get_tax_form_summary.json +17 -0
  125. data/spec/mocks/responses/Capital/calculate-preliminary-offer-from-dynamic-offer.json +16 -0
  126. data/spec/mocks/responses/Capital/create-static-offer-from-dynamic-offer.json +9 -0
  127. data/spec/mocks/responses/Capital/get-all-dynamic-offers.json +18 -0
  128. data/spec/service_spec.rb +40 -0
  129. data/templates/api-small.mustache +1 -3
  130. data/templates/api.mustache +1 -3
  131. metadata +27 -1
@@ -14,9 +14,7 @@ module Adyen
14
14
 
15
15
  # Cancel an authorised payment
16
16
  def cancel_authorised_payment(request, headers: {})
17
- endpoint = '/cancels'.gsub(/{.+?}/, '%s')
18
- endpoint = endpoint.gsub(%r{^/}, '')
19
- endpoint = format(endpoint)
17
+ endpoint = build_endpoint('/cancels')
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 authorised payment
26
24
  def cancel_authorised_payment_by_psp_reference(request, payment_psp_reference, headers: {})
27
- endpoint = '/payments/{paymentPspReference}/cancels'.gsub(/{.+?}/, '%s')
28
- endpoint = endpoint.gsub(%r{^/}, '')
29
- endpoint = format(endpoint, payment_psp_reference)
25
+ endpoint = build_endpoint('/payments/{paymentPspReference}/cancels', payment_psp_reference)
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
  # Capture an authorised payment
36
32
  def capture_authorised_payment(request, payment_psp_reference, headers: {})
37
- endpoint = '/payments/{paymentPspReference}/captures'.gsub(/{.+?}/, '%s')
38
- endpoint = endpoint.gsub(%r{^/}, '')
39
- endpoint = format(endpoint, payment_psp_reference)
33
+ endpoint = build_endpoint('/payments/{paymentPspReference}/captures', payment_psp_reference)
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
  # Refund a captured payment
46
40
  def refund_captured_payment(request, payment_psp_reference, headers: {})
47
- endpoint = '/payments/{paymentPspReference}/refunds'.gsub(/{.+?}/, '%s')
48
- endpoint = endpoint.gsub(%r{^/}, '')
49
- endpoint = format(endpoint, payment_psp_reference)
41
+ endpoint = build_endpoint('/payments/{paymentPspReference}/refunds', payment_psp_reference)
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
  # Refund or cancel a payment
56
48
  def refund_or_cancel_payment(request, payment_psp_reference, headers: {})
57
- endpoint = '/payments/{paymentPspReference}/reversals'.gsub(/{.+?}/, '%s')
58
- endpoint = endpoint.gsub(%r{^/}, '')
59
- endpoint = format(endpoint, payment_psp_reference)
49
+ endpoint = build_endpoint('/payments/{paymentPspReference}/reversals', payment_psp_reference)
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
  # Update an authorised amount
66
56
  def update_authorised_amount(request, payment_psp_reference, headers: {})
67
- endpoint = '/payments/{paymentPspReference}/amountUpdates'.gsub(/{.+?}/, '%s')
68
- endpoint = endpoint.gsub(%r{^/}, '')
69
- endpoint = format(endpoint, payment_psp_reference)
57
+ endpoint = build_endpoint('/payments/{paymentPspReference}/amountUpdates', payment_psp_reference)
70
58
 
71
59
  action = { method: 'post', url: endpoint }
72
60
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -14,9 +14,7 @@ module Adyen
14
14
 
15
15
  # Cancel an order
16
16
  def cancel_order(request, headers: {})
17
- endpoint = '/orders/cancel'.gsub(/{.+?}/, '%s')
18
- endpoint = endpoint.gsub(%r{^/}, '')
19
- endpoint = format(endpoint)
17
+ endpoint = build_endpoint('/orders/cancel')
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 the balance of a gift card
26
24
  def get_balance_of_gift_card(request, headers: {})
27
- endpoint = '/paymentMethods/balance'.gsub(/{.+?}/, '%s')
28
- endpoint = endpoint.gsub(%r{^/}, '')
29
- endpoint = format(endpoint)
25
+ endpoint = build_endpoint('/paymentMethods/balance')
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
  # Create an order
36
32
  def orders(request, headers: {})
37
- endpoint = '/orders'.gsub(/{.+?}/, '%s')
38
- endpoint = endpoint.gsub(%r{^/}, '')
39
- endpoint = format(endpoint)
33
+ endpoint = build_endpoint('/orders')
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
  # Get a payment link
16
16
  def get_payment_link(link_id, headers: {})
17
- endpoint = '/paymentLinks/{linkId}'.gsub(/{.+?}/, '%s')
18
- endpoint = endpoint.gsub(%r{^/}, '')
19
- endpoint = format(endpoint, link_id)
17
+ endpoint = build_endpoint('/paymentLinks/{linkId}', link_id)
20
18
 
21
19
  action = { method: 'get', url: endpoint }
22
20
  @client.call_adyen_api(@service, action, {}, headers, @version)
@@ -24,9 +22,7 @@ module Adyen
24
22
 
25
23
  # Create a payment link
26
24
  def payment_links(request, headers: {})
27
- endpoint = '/paymentLinks'.gsub(/{.+?}/, '%s')
28
- endpoint = endpoint.gsub(%r{^/}, '')
29
- endpoint = format(endpoint)
25
+ endpoint = build_endpoint('/paymentLinks')
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
  # Update the status of a payment link
36
32
  def update_payment_link(request, link_id, headers: {})
37
- endpoint = '/paymentLinks/{linkId}'.gsub(/{.+?}/, '%s')
38
- endpoint = endpoint.gsub(%r{^/}, '')
39
- endpoint = format(endpoint, link_id)
33
+ endpoint = build_endpoint('/paymentLinks/{linkId}', link_id)
40
34
 
41
35
  action = { method: 'patch', url: endpoint }
42
36
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -14,9 +14,7 @@ module Adyen
14
14
 
15
15
  # Get the brands and other details of a card
16
16
  def card_details(request, headers: {})
17
- endpoint = '/cardDetails'.gsub(/{.+?}/, '%s')
18
- endpoint = endpoint.gsub(%r{^/}, '')
19
- endpoint = format(endpoint)
17
+ endpoint = build_endpoint('/cardDetails')
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 the result of a payment session
26
24
  def get_result_of_payment_session(session_id, headers: {}, query_params: {})
27
- endpoint = '/sessions/{sessionId}'.gsub(/{.+?}/, '%s')
28
- endpoint = endpoint.gsub(%r{^/}, '')
29
- endpoint = format(endpoint, session_id)
25
+ endpoint = build_endpoint('/sessions/{sessionId}', session_id)
30
26
  endpoint += create_query_string(query_params)
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 available payment methods
36
32
  def payment_methods(request, headers: {})
37
- endpoint = '/paymentMethods'.gsub(/{.+?}/, '%s')
38
- endpoint = endpoint.gsub(%r{^/}, '')
39
- endpoint = format(endpoint)
33
+ endpoint = build_endpoint('/paymentMethods')
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
  # Start a transaction
46
40
  def payments(request, headers: {})
47
- endpoint = '/payments'.gsub(/{.+?}/, '%s')
48
- endpoint = endpoint.gsub(%r{^/}, '')
49
- endpoint = format(endpoint)
41
+ endpoint = build_endpoint('/payments')
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
  # Submit details for a payment
56
48
  def payments_details(request, headers: {})
57
- endpoint = '/payments/details'.gsub(/{.+?}/, '%s')
58
- endpoint = endpoint.gsub(%r{^/}, '')
59
- endpoint = format(endpoint)
49
+ endpoint = build_endpoint('/payments/details')
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
  # Create a payment session
66
56
  def sessions(request, headers: {})
67
- endpoint = '/sessions'.gsub(/{.+?}/, '%s')
68
- endpoint = endpoint.gsub(%r{^/}, '')
69
- endpoint = format(endpoint)
57
+ endpoint = build_endpoint('/sessions')
70
58
 
71
59
  action = { method: 'post', url: endpoint }
72
60
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -14,9 +14,7 @@ module Adyen
14
14
 
15
15
  # Delete a token for stored payment details
16
16
  def delete_token_for_stored_payment_details(stored_payment_method_id, headers: {}, query_params: {})
17
- endpoint = '/storedPaymentMethods/{storedPaymentMethodId}'.gsub(/{.+?}/, '%s')
18
- endpoint = endpoint.gsub(%r{^/}, '')
19
- endpoint = format(endpoint, stored_payment_method_id)
17
+ endpoint = build_endpoint('/storedPaymentMethods/{storedPaymentMethodId}', stored_payment_method_id)
20
18
  endpoint += create_query_string(query_params)
21
19
  action = { method: 'delete', url: endpoint }
22
20
  @client.call_adyen_api(@service, action, {}, headers, @version)
@@ -24,9 +22,7 @@ module Adyen
24
22
 
25
23
  # Forward stored payment details
26
24
  def forward(request, headers: {})
27
- endpoint = '/forward'.gsub(/{.+?}/, '%s')
28
- endpoint = endpoint.gsub(%r{^/}, '')
29
- endpoint = format(endpoint)
25
+ endpoint = build_endpoint('/forward')
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 tokens for stored payment details
36
32
  def get_tokens_for_stored_payment_details(headers: {}, query_params: {})
37
- endpoint = '/storedPaymentMethods'.gsub(/{.+?}/, '%s')
38
- endpoint = endpoint.gsub(%r{^/}, '')
39
- endpoint = format(endpoint)
33
+ endpoint = build_endpoint('/storedPaymentMethods')
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
  # Create a token to store payment details
46
40
  def stored_payment_methods(request, headers: {})
47
- endpoint = '/storedPaymentMethods'.gsub(/{.+?}/, '%s')
48
- endpoint = endpoint.gsub(%r{^/}, '')
49
- endpoint = format(endpoint)
41
+ endpoint = build_endpoint('/storedPaymentMethods')
50
42
 
51
43
  action = { method: 'post', url: endpoint }
52
44
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -14,9 +14,7 @@ module Adyen
14
14
 
15
15
  # Get an Apple Pay session
16
16
  def get_apple_pay_session(request, headers: {})
17
- endpoint = '/applePay/sessions'.gsub(/{.+?}/, '%s')
18
- endpoint = endpoint.gsub(%r{^/}, '')
19
- endpoint = format(endpoint)
17
+ endpoint = build_endpoint('/applePay/sessions')
20
18
 
21
19
  action = { method: 'post', url: endpoint }
22
20
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -26,9 +24,7 @@ module Adyen
26
24
  #
27
25
  # Deprecated since Adyen Checkout API v67
28
26
  def origin_keys(request, headers: {})
29
- endpoint = '/originKeys'.gsub(/{.+?}/, '%s')
30
- endpoint = endpoint.gsub(%r{^/}, '')
31
- endpoint = format(endpoint)
27
+ endpoint = build_endpoint('/originKeys')
32
28
 
33
29
  action = { method: 'post', url: endpoint }
34
30
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -36,9 +32,7 @@ module Adyen
36
32
 
37
33
  # Updates the order for PayPal Express Checkout
38
34
  def updates_order_for_paypal_express_checkout(request, headers: {})
39
- endpoint = '/paypal/updateOrder'.gsub(/{.+?}/, '%s')
40
- endpoint = endpoint.gsub(%r{^/}, '')
41
- endpoint = format(endpoint)
35
+ endpoint = build_endpoint('/paypal/updateOrder')
42
36
 
43
37
  action = { method: 'post', url: endpoint }
44
38
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -46,9 +40,7 @@ module Adyen
46
40
 
47
41
  # Validates shopper Id
48
42
  def validate_shopper_id(request, headers: {})
49
- endpoint = '/validateShopperId'.gsub(/{.+?}/, '%s')
50
- endpoint = endpoint.gsub(%r{^/}, '')
51
- endpoint = format(endpoint)
43
+ endpoint = build_endpoint('/validateShopperId')
52
44
 
53
45
  action = { method: 'post', url: endpoint }
54
46
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -14,9 +14,7 @@ module Adyen
14
14
 
15
15
  # Submit a Subject Erasure Request.
16
16
  def request_subject_erasure(request, headers: {})
17
- endpoint = '/requestSubjectErasure'.gsub(/{.+?}/, '%s')
18
- endpoint = endpoint.gsub(%r{^/}, '')
19
- endpoint = format(endpoint)
17
+ endpoint = build_endpoint('/requestSubjectErasure')
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
  # Accept a dispute
16
16
  def accept_dispute(request, headers: {})
17
- endpoint = '/acceptDispute'.gsub(/{.+?}/, '%s')
18
- endpoint = endpoint.gsub(%r{^/}, '')
19
- endpoint = format(endpoint)
17
+ endpoint = build_endpoint('/acceptDispute')
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
  # Defend a dispute
26
24
  def defend_dispute(request, headers: {})
27
- endpoint = '/defendDispute'.gsub(/{.+?}/, '%s')
28
- endpoint = endpoint.gsub(%r{^/}, '')
29
- endpoint = format(endpoint)
25
+ endpoint = build_endpoint('/defendDispute')
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
  # Delete a defense document
36
32
  def delete_dispute_defense_document(request, headers: {})
37
- endpoint = '/deleteDisputeDefenseDocument'.gsub(/{.+?}/, '%s')
38
- endpoint = endpoint.gsub(%r{^/}, '')
39
- endpoint = format(endpoint)
33
+ endpoint = build_endpoint('/deleteDisputeDefenseDocument')
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 applicable defense reasons
46
40
  def retrieve_applicable_defense_reasons(request, headers: {})
47
- endpoint = '/retrieveApplicableDefenseReasons'.gsub(/{.+?}/, '%s')
48
- endpoint = endpoint.gsub(%r{^/}, '')
49
- endpoint = format(endpoint)
41
+ endpoint = build_endpoint('/retrieveApplicableDefenseReasons')
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
  # Supply a defense document
56
48
  def supply_defense_document(request, headers: {})
57
- endpoint = '/supplyDefenseDocument'.gsub(/{.+?}/, '%s')
58
- endpoint = endpoint.gsub(%r{^/}, '')
59
- endpoint = format(endpoint)
49
+ endpoint = build_endpoint('/supplyDefenseDocument')
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 business line
16
16
  def create_business_line(request, headers: {})
17
- endpoint = '/businessLines'.gsub(/{.+?}/, '%s')
18
- endpoint = endpoint.gsub(%r{^/}, '')
19
- endpoint = format(endpoint)
17
+ endpoint = build_endpoint('/businessLines')
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
  # Delete a business line
26
24
  def delete_business_line(id, headers: {})
27
- endpoint = '/businessLines/{id}'.gsub(/{.+?}/, '%s')
28
- endpoint = endpoint.gsub(%r{^/}, '')
29
- endpoint = format(endpoint, id)
25
+ endpoint = build_endpoint('/businessLines/{id}', id)
30
26
 
31
27
  action = { method: 'delete', url: endpoint }
32
28
  @client.call_adyen_api(@service, action, {}, headers, @version)
@@ -34,9 +30,7 @@ module Adyen
34
30
 
35
31
  # Get a business line
36
32
  def get_business_line(id, headers: {})
37
- endpoint = '/businessLines/{id}'.gsub(/{.+?}/, '%s')
38
- endpoint = endpoint.gsub(%r{^/}, '')
39
- endpoint = format(endpoint, id)
33
+ endpoint = build_endpoint('/businessLines/{id}', id)
40
34
 
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 business line
46
40
  def update_business_line(request, id, headers: {})
47
- endpoint = '/businessLines/{id}'.gsub(/{.+?}/, '%s')
48
- endpoint = endpoint.gsub(%r{^/}, '')
49
- endpoint = format(endpoint, id)
41
+ endpoint = build_endpoint('/businessLines/{id}', 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
  # Delete a document
16
16
  def delete_document(id, headers: {})
17
- endpoint = '/documents/{id}'.gsub(/{.+?}/, '%s')
18
- endpoint = endpoint.gsub(%r{^/}, '')
19
- endpoint = format(endpoint, id)
17
+ endpoint = build_endpoint('/documents/{id}', id)
20
18
 
21
19
  action = { method: 'delete', url: endpoint }
22
20
  @client.call_adyen_api(@service, action, {}, headers, @version)
@@ -24,9 +22,7 @@ module Adyen
24
22
 
25
23
  # Get a document
26
24
  def get_document(id, headers: {}, query_params: {})
27
- endpoint = '/documents/{id}'.gsub(/{.+?}/, '%s')
28
- endpoint = endpoint.gsub(%r{^/}, '')
29
- endpoint = format(endpoint, id)
25
+ endpoint = build_endpoint('/documents/{id}', id)
30
26
  endpoint += create_query_string(query_params)
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
  # Update a document
36
32
  def update_document(request, id, headers: {})
37
- endpoint = '/documents/{id}'.gsub(/{.+?}/, '%s')
38
- endpoint = endpoint.gsub(%r{^/}, '')
39
- endpoint = format(endpoint, id)
33
+ endpoint = build_endpoint('/documents/{id}', id)
40
34
 
41
35
  action = { method: 'patch', url: endpoint }
42
36
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -44,9 +38,7 @@ module Adyen
44
38
 
45
39
  # Upload a document for verification checks
46
40
  def upload_document_for_verification_checks(request, headers: {})
47
- endpoint = '/documents'.gsub(/{.+?}/, '%s')
48
- endpoint = endpoint.gsub(%r{^/}, '')
49
- endpoint = format(endpoint)
41
+ endpoint = build_endpoint('/documents')
50
42
 
51
43
  action = { method: 'post', url: endpoint }
52
44
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -14,9 +14,7 @@ module Adyen
14
14
 
15
15
  # Get a link to an Adyen-hosted onboarding page
16
16
  def get_link_to_adyenhosted_onboarding_page(request, id, headers: {})
17
- endpoint = '/legalEntities/{id}/onboardingLinks'.gsub(/{.+?}/, '%s')
18
- endpoint = endpoint.gsub(%r{^/}, '')
19
- endpoint = format(endpoint, id)
17
+ endpoint = build_endpoint('/legalEntities/{id}/onboardingLinks', 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 an onboarding link theme
26
24
  def get_onboarding_link_theme(id, headers: {})
27
- endpoint = '/themes/{id}'.gsub(/{.+?}/, '%s')
28
- endpoint = endpoint.gsub(%r{^/}, '')
29
- endpoint = format(endpoint, id)
25
+ endpoint = build_endpoint('/themes/{id}', 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 hosted onboarding page themes
36
32
  def list_hosted_onboarding_page_themes(headers: {})
37
- endpoint = '/themes'.gsub(/{.+?}/, '%s')
38
- endpoint = endpoint.gsub(%r{^/}, '')
39
- endpoint = format(endpoint)
33
+ endpoint = build_endpoint('/themes')
40
34
 
41
35
  action = { method: 'get', url: endpoint }
42
36
  @client.call_adyen_api(@service, action, {}, headers, @version)
@@ -14,9 +14,7 @@ module Adyen
14
14
 
15
15
  # Check a legal entity's verification errors
16
16
  def check_legal_entitys_verification_errors(id, headers: {})
17
- endpoint = '/legalEntities/{id}/checkVerificationErrors'.gsub(/{.+?}/, '%s')
18
- endpoint = endpoint.gsub(%r{^/}, '')
19
- endpoint = format(endpoint, id)
17
+ endpoint = build_endpoint('/legalEntities/{id}/checkVerificationErrors', 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
  # Confirm data review
26
24
  def confirm_data_review(id, headers: {})
27
- endpoint = '/legalEntities/{id}/confirmDataReview'.gsub(/{.+?}/, '%s')
28
- endpoint = endpoint.gsub(%r{^/}, '')
29
- endpoint = format(endpoint, id)
25
+ endpoint = build_endpoint('/legalEntities/{id}/confirmDataReview', id)
30
26
 
31
27
  action = { method: 'post', url: endpoint }
32
28
  @client.call_adyen_api(@service, action, {}, headers, @version)
@@ -34,9 +30,7 @@ module Adyen
34
30
 
35
31
  # Create a legal entity
36
32
  def create_legal_entity(request, headers: {})
37
- endpoint = '/legalEntities'.gsub(/{.+?}/, '%s')
38
- endpoint = endpoint.gsub(%r{^/}, '')
39
- endpoint = format(endpoint)
33
+ endpoint = build_endpoint('/legalEntities')
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 all business lines under a legal entity
46
40
  def get_all_business_lines_under_legal_entity(id, headers: {})
47
- endpoint = '/legalEntities/{id}/businessLines'.gsub(/{.+?}/, '%s')
48
- endpoint = endpoint.gsub(%r{^/}, '')
49
- endpoint = format(endpoint, id)
41
+ endpoint = build_endpoint('/legalEntities/{id}/businessLines', id)
50
42
 
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
  # Get a legal entity
56
48
  def get_legal_entity(id, headers: {})
57
- endpoint = '/legalEntities/{id}'.gsub(/{.+?}/, '%s')
58
- endpoint = endpoint.gsub(%r{^/}, '')
59
- endpoint = format(endpoint, id)
49
+ endpoint = build_endpoint('/legalEntities/{id}', id)
60
50
 
61
51
  action = { method: 'get', url: endpoint }
62
52
  @client.call_adyen_api(@service, action, {}, headers, @version)
@@ -64,9 +54,7 @@ module Adyen
64
54
 
65
55
  # Request periodic data review.
66
56
  def request_periodic_review(id, headers: {})
67
- endpoint = '/legalEntities/{id}/requestPeriodicReview'.gsub(/{.+?}/, '%s')
68
- endpoint = endpoint.gsub(%r{^/}, '')
69
- endpoint = format(endpoint, id)
57
+ endpoint = build_endpoint('/legalEntities/{id}/requestPeriodicReview', id)
70
58
 
71
59
  action = { method: 'post', url: endpoint }
72
60
  @client.call_adyen_api(@service, action, {}, headers, @version)
@@ -74,9 +62,7 @@ module Adyen
74
62
 
75
63
  # Update a legal entity
76
64
  def update_legal_entity(request, id, headers: {})
77
- endpoint = '/legalEntities/{id}'.gsub(/{.+?}/, '%s')
78
- endpoint = endpoint.gsub(%r{^/}, '')
79
- endpoint = format(endpoint, id)
65
+ endpoint = build_endpoint('/legalEntities/{id}', 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
  # Calculate PCI status of a legal entity
16
16
  def calculate_pci_status_of_legal_entity(request, id, headers: {})
17
- endpoint = '/legalEntities/{id}/pciQuestionnaires/signingRequired'.gsub(/{.+?}/, '%s')
18
- endpoint = endpoint.gsub(%r{^/}, '')
19
- endpoint = format(endpoint, id)
17
+ endpoint = build_endpoint('/legalEntities/{id}/pciQuestionnaires/signingRequired', 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
  # Generate PCI questionnaire
26
24
  def generate_pci_questionnaire(request, id, headers: {})
27
- endpoint = '/legalEntities/{id}/pciQuestionnaires/generatePciTemplates'.gsub(/{.+?}/, '%s')
28
- endpoint = endpoint.gsub(%r{^/}, '')
29
- endpoint = format(endpoint, id)
25
+ endpoint = build_endpoint('/legalEntities/{id}/pciQuestionnaires/generatePciTemplates', 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 PCI questionnaire
36
32
  def get_pci_questionnaire(id, pciid, headers: {})
37
- endpoint = '/legalEntities/{id}/pciQuestionnaires/{pciid}'.gsub(/{.+?}/, '%s')
38
- endpoint = endpoint.gsub(%r{^/}, '')
39
- endpoint = format(endpoint, id, pciid)
33
+ endpoint = build_endpoint('/legalEntities/{id}/pciQuestionnaires/{pciid}', id, pciid)
40
34
 
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 PCI questionnaire details
46
40
  def get_pci_questionnaire_details(id, headers: {})
47
- endpoint = '/legalEntities/{id}/pciQuestionnaires'.gsub(/{.+?}/, '%s')
48
- endpoint = endpoint.gsub(%r{^/}, '')
49
- endpoint = format(endpoint, id)
41
+ endpoint = build_endpoint('/legalEntities/{id}/pciQuestionnaires', id)
50
42
 
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
  # Sign PCI questionnaire
56
48
  def sign_pci_questionnaire(request, id, headers: {})
57
- endpoint = '/legalEntities/{id}/pciQuestionnaires/signPciTemplates'.gsub(/{.+?}/, '%s')
58
- endpoint = endpoint.gsub(%r{^/}, '')
59
- endpoint = format(endpoint, id)
49
+ endpoint = build_endpoint('/legalEntities/{id}/pciQuestionnaires/signPciTemplates', id)
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
  # Check the status of consent for electronic delivery of tax forms
16
16
  def check_status_of_consent_for_electronic_delivery_of_tax_forms(id, headers: {})
17
- endpoint = '/legalEntities/{id}/checkTaxElectronicDeliveryConsent'.gsub(/{.+?}/, '%s')
18
- endpoint = endpoint.gsub(%r{^/}, '')
19
- endpoint = format(endpoint, id)
17
+ endpoint = build_endpoint('/legalEntities/{id}/checkTaxElectronicDeliveryConsent', 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
  # Set the consent status for electronic delivery of tax forms
26
24
  def set_consent_status_for_electronic_delivery_of_tax_forms(request, id, headers: {})
27
- endpoint = '/legalEntities/{id}/setTaxElectronicDeliveryConsent'.gsub(/{.+?}/, '%s')
28
- endpoint = endpoint.gsub(%r{^/}, '')
29
- endpoint = format(endpoint, id)
25
+ endpoint = build_endpoint('/legalEntities/{id}/setTaxElectronicDeliveryConsent', id)
30
26
 
31
27
  action = { method: 'post', url: endpoint }
32
28
  @client.call_adyen_api(@service, action, request, headers, @version)