adyen-ruby-api-library 7.0.1 → 7.0.2

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 (128) hide show
  1. checksums.yaml +4 -4
  2. data/.github/CODEOWNERS +1 -1
  3. data/.github/release.yml +18 -0
  4. data/.github/workflows/gh_release.yml +16 -0
  5. data/.github/workflows/release_request.yml +15 -0
  6. data/.github/workflows/ruby.yml +1 -1
  7. data/.github/workflows/services.yml +28 -0
  8. data/.rubocop.yml +8 -0
  9. data/Gemfile +7 -7
  10. data/Makefile +14 -10
  11. data/README.md +13 -10
  12. data/Rakefile +3 -3
  13. data/adyen-ruby-api-library.gemspec +6 -3
  14. data/bin/console +2 -2
  15. data/lib/adyen/client.rb +91 -75
  16. data/lib/adyen/errors.rb +23 -18
  17. data/lib/adyen/hash_with_accessors.rb +12 -7
  18. data/lib/adyen/services/balanceControlService.rb +7 -14
  19. data/lib/adyen/services/balancePlatform/account_holders_api.rb +22 -38
  20. data/lib/adyen/services/balancePlatform/balance_accounts_api.rb +48 -79
  21. data/lib/adyen/services/balancePlatform/bank_account_validation_api.rb +6 -13
  22. data/lib/adyen/services/balancePlatform/grant_accounts_api.rb +6 -13
  23. data/lib/adyen/services/balancePlatform/grant_offers_api.rb +12 -22
  24. data/lib/adyen/services/balancePlatform/payment_instrument_groups_api.rb +16 -29
  25. data/lib/adyen/services/balancePlatform/payment_instruments_api.rb +26 -45
  26. data/lib/adyen/services/balancePlatform/platform_api.rb +12 -22
  27. data/lib/adyen/services/balancePlatform/transaction_rules_api.rb +21 -37
  28. data/lib/adyen/services/balancePlatform.rb +38 -40
  29. data/lib/adyen/services/binLookup.rb +12 -22
  30. data/lib/adyen/services/checkout/classic_checkout_sdk_api.rb +11 -21
  31. data/lib/adyen/services/checkout/modifications_api.rb +31 -53
  32. data/lib/adyen/services/checkout/orders_api.rb +16 -29
  33. data/lib/adyen/services/checkout/payment_links_api.rb +16 -29
  34. data/lib/adyen/services/checkout/payments_api.rb +40 -53
  35. data/lib/adyen/services/checkout/recurring_api.rb +13 -23
  36. data/lib/adyen/services/checkout/utility_api.rb +11 -21
  37. data/lib/adyen/services/checkout.rb +32 -34
  38. data/lib/adyen/services/dataProtection.rb +7 -14
  39. data/lib/adyen/services/dispute.rb +6 -5
  40. data/lib/adyen/services/legalEntityManagement/business_lines_api.rb +21 -37
  41. data/lib/adyen/services/legalEntityManagement/documents_api.rb +21 -37
  42. data/lib/adyen/services/legalEntityManagement/hosted_onboarding_api.rb +16 -29
  43. data/lib/adyen/services/legalEntityManagement/legal_entities_api.rb +26 -45
  44. data/lib/adyen/services/legalEntityManagement/pci_questionnaires_api.rb +21 -37
  45. data/lib/adyen/services/legalEntityManagement/terms_of_service_api.rb +25 -29
  46. data/lib/adyen/services/legalEntityManagement/transfer_instruments_api.rb +21 -37
  47. data/lib/adyen/services/legalEntityManagement.rb +32 -34
  48. data/lib/adyen/services/management/account_company_level_api.rb +18 -31
  49. data/lib/adyen/services/management/account_merchant_level_api.rb +22 -38
  50. data/lib/adyen/services/management/account_store_level_api.rb +43 -71
  51. data/lib/adyen/services/management/allowed_origins_company_level_api.rb +21 -37
  52. data/lib/adyen/services/management/allowed_origins_merchant_level_api.rb +21 -37
  53. data/lib/adyen/services/management/api_credentials_company_level_api.rb +22 -38
  54. data/lib/adyen/services/management/api_credentials_merchant_level_api.rb +22 -38
  55. data/lib/adyen/services/management/api_key_company_level_api.rb +6 -13
  56. data/lib/adyen/services/management/api_key_merchant_level_api.rb +6 -13
  57. data/lib/adyen/services/management/client_key_company_level_api.rb +6 -13
  58. data/lib/adyen/services/management/client_key_merchant_level_api.rb +6 -13
  59. data/lib/adyen/services/management/my_api_credential_api.rb +26 -45
  60. data/lib/adyen/services/management/payment_methods_merchant_level_api.rb +32 -54
  61. data/lib/adyen/services/management/payout_settings_merchant_level_api.rb +26 -45
  62. data/lib/adyen/services/management/split_configuration_merchant_level_api.rb +92 -0
  63. data/lib/adyen/services/management/terminal_actions_company_level_api.rb +24 -40
  64. data/lib/adyen/services/management/terminal_actions_terminal_level_api.rb +6 -13
  65. data/lib/adyen/services/management/terminal_orders_company_level_api.rb +55 -89
  66. data/lib/adyen/services/management/terminal_orders_merchant_level_api.rb +55 -89
  67. data/lib/adyen/services/management/terminal_settings_company_level_api.rb +23 -39
  68. data/lib/adyen/services/management/terminal_settings_merchant_level_api.rb +23 -39
  69. data/lib/adyen/services/management/terminal_settings_store_level_api.rb +45 -73
  70. data/lib/adyen/services/management/terminal_settings_terminal_level_api.rb +21 -37
  71. data/lib/adyen/services/management/terminals_terminal_level_api.rb +7 -14
  72. data/lib/adyen/services/management/users_company_level_api.rb +22 -38
  73. data/lib/adyen/services/management/users_merchant_level_api.rb +22 -38
  74. data/lib/adyen/services/management/webhooks_company_level_api.rb +37 -62
  75. data/lib/adyen/services/management/webhooks_merchant_level_api.rb +37 -62
  76. data/lib/adyen/services/management.rb +99 -96
  77. data/lib/adyen/services/marketpay.rb +42 -36
  78. data/lib/adyen/services/payment/general_api.rb +56 -0
  79. data/lib/adyen/services/payment/modifications_api.rb +83 -0
  80. data/lib/adyen/services/payment.rb +10 -158
  81. data/lib/adyen/services/payout/initialization_api.rb +16 -29
  82. data/lib/adyen/services/payout/instant_payouts_api.rb +6 -13
  83. data/lib/adyen/services/payout/reviewing_api.rb +11 -21
  84. data/lib/adyen/services/payout.rb +19 -21
  85. data/lib/adyen/services/posTerminalManagement.rb +27 -46
  86. data/lib/adyen/services/recurring.rb +32 -54
  87. data/lib/adyen/services/service.rb +5 -4
  88. data/lib/adyen/services/storedValue.rb +32 -54
  89. data/lib/adyen/services/transfers/capital_api.rb +38 -0
  90. data/lib/adyen/services/transfers/transactions_api.rb +12 -22
  91. data/lib/adyen/services/transfers/transfers_api.rb +6 -13
  92. data/lib/adyen/services/transfers.rb +20 -17
  93. data/lib/adyen/utils/hmac_validator.rb +9 -9
  94. data/lib/adyen/version.rb +3 -3
  95. data/lib/adyen-ruby-api-library.rb +21 -21
  96. data/spec/account_spec.rb +20 -20
  97. data/spec/balance_control_spec.rb +28 -29
  98. data/spec/balance_platform_spec.rb +108 -102
  99. data/spec/bin_lookup_spec.rb +50 -50
  100. data/spec/checkout_spec.rb +573 -524
  101. data/spec/client_spec.rb +117 -70
  102. data/spec/data_protection_spec.rb +4 -4
  103. data/spec/dispute_spec.rb +7 -7
  104. data/spec/errors_spec.rb +37 -17
  105. data/spec/fund_spec.rb +10 -10
  106. data/spec/hash_with_accessors_spec.rb +18 -8
  107. data/spec/hop_spec.rb +4 -4
  108. data/spec/lem_spec.rb +44 -49
  109. data/spec/management_spec.rb +46 -48
  110. data/spec/notification_spec.rb +9 -9
  111. data/spec/payments_spec.rb +31 -32
  112. data/spec/payouts_spec.rb +29 -32
  113. data/spec/pos_terminal_management_spec.rb +30 -32
  114. data/spec/recurring_spec.rb +8 -8
  115. data/spec/service_spec.rb +4 -0
  116. data/spec/spec_helper.rb +37 -35
  117. data/spec/stored_value_spec.rb +28 -27
  118. data/spec/transfers_spec.rb +48 -47
  119. data/spec/utils/hmac_validator_spec.rb +15 -14
  120. data/templates/api-single.mustache +13 -15
  121. data/templates/api-small.mustache +8 -15
  122. data/templates/api.mustache +7 -14
  123. metadata +27 -18
  124. data/.github/dependabot.yml +0 -8
  125. /data/spec/mocks/responses/Webhooks/{backslash_notification.json → backslash_webhook.json} +0 -0
  126. /data/spec/mocks/responses/Webhooks/{colon_notification.json → colon_webhook.json} +0 -0
  127. /data/spec/mocks/responses/Webhooks/{forwardslash_notification.json → forwardslash_webhook.json} +0 -0
  128. /data/spec/mocks/responses/Webhooks/{mixed_notification.json → mixed_webhook.json} +0 -0
@@ -1,133 +1,99 @@
1
1
  require_relative '../service'
2
2
  module Adyen
3
-
4
-
5
3
  class TerminalOrdersCompanyLevelApi < Service
6
4
  attr_accessor :service, :version
7
5
 
8
6
  def initialize(client, version = DEFAULT_VERSION)
9
- @service = "Management"
10
- @client = client
11
- @version = version
7
+ super(client, version, 'Management')
12
8
  end
13
9
 
14
- def list_billing_entities(companyId, headers: {} , queryParams: {})
15
- """
16
- Get a list of billing entities
17
- """
18
- endpoint = "/companies/{companyId}/billingEntities".gsub(/{.+?}/, '%s')
19
- endpoint = endpoint.gsub(/^\//, "")
20
- endpoint = endpoint % [companyId]
21
- endpoint = endpoint + create_query_string(queryParams)
22
- action = { method: "get", url: endpoint}
10
+ def list_billing_entities(company_id, headers: {}, query_params: {})
11
+ endpoint = '/companies/{companyId}/billingEntities'.gsub(/{.+?}/, '%s')
12
+ endpoint = endpoint.gsub(%r{^/}, '')
13
+ endpoint = format(endpoint, company_id)
14
+ endpoint += create_query_string(query_params)
15
+ action = { method: 'get', url: endpoint }
23
16
  @client.call_adyen_api(@service, action, {}, headers, @version)
24
17
  end
25
18
 
26
- def list_shipping_locations(companyId, headers: {} , queryParams: {})
27
- """
28
- Get a list of shipping locations
29
- """
30
- endpoint = "/companies/{companyId}/shippingLocations".gsub(/{.+?}/, '%s')
31
- endpoint = endpoint.gsub(/^\//, "")
32
- endpoint = endpoint % [companyId]
33
- endpoint = endpoint + create_query_string(queryParams)
34
- action = { method: "get", url: endpoint}
19
+ def list_shipping_locations(company_id, headers: {}, query_params: {})
20
+ endpoint = '/companies/{companyId}/shippingLocations'.gsub(/{.+?}/, '%s')
21
+ endpoint = endpoint.gsub(%r{^/}, '')
22
+ endpoint = format(endpoint, company_id)
23
+ endpoint += create_query_string(query_params)
24
+ action = { method: 'get', url: endpoint }
35
25
  @client.call_adyen_api(@service, action, {}, headers, @version)
36
26
  end
37
27
 
38
- def list_terminal_models(companyId, headers: {} )
39
- """
40
- Get a list of terminal models
41
- """
42
- endpoint = "/companies/{companyId}/terminalModels".gsub(/{.+?}/, '%s')
43
- endpoint = endpoint.gsub(/^\//, "")
44
- endpoint = endpoint % [companyId]
28
+ def list_terminal_models(company_id, headers: {})
29
+ endpoint = '/companies/{companyId}/terminalModels'.gsub(/{.+?}/, '%s')
30
+ endpoint = endpoint.gsub(%r{^/}, '')
31
+ endpoint = format(endpoint, company_id)
45
32
 
46
- action = { method: "get", url: endpoint}
33
+ action = { method: 'get', url: endpoint }
47
34
  @client.call_adyen_api(@service, action, {}, headers, @version)
48
35
  end
49
36
 
50
- def list_orders(companyId, headers: {} , queryParams: {})
51
- """
52
- Get a list of orders
53
- """
54
- endpoint = "/companies/{companyId}/terminalOrders".gsub(/{.+?}/, '%s')
55
- endpoint = endpoint.gsub(/^\//, "")
56
- endpoint = endpoint % [companyId]
57
- endpoint = endpoint + create_query_string(queryParams)
58
- action = { method: "get", url: endpoint}
37
+ def list_orders(company_id, headers: {}, query_params: {})
38
+ endpoint = '/companies/{companyId}/terminalOrders'.gsub(/{.+?}/, '%s')
39
+ endpoint = endpoint.gsub(%r{^/}, '')
40
+ endpoint = format(endpoint, company_id)
41
+ endpoint += create_query_string(query_params)
42
+ action = { method: 'get', url: endpoint }
59
43
  @client.call_adyen_api(@service, action, {}, headers, @version)
60
44
  end
61
45
 
62
- def get_order(companyId, orderId, headers: {} )
63
- """
64
- Get an order
65
- """
66
- endpoint = "/companies/{companyId}/terminalOrders/{orderId}".gsub(/{.+?}/, '%s')
67
- endpoint = endpoint.gsub(/^\//, "")
68
- endpoint = endpoint % [companyId,orderId]
46
+ def get_order(company_id, order_id, headers: {})
47
+ endpoint = '/companies/{companyId}/terminalOrders/{orderId}'.gsub(/{.+?}/, '%s')
48
+ endpoint = endpoint.gsub(%r{^/}, '')
49
+ endpoint = format(endpoint, company_id, order_id)
69
50
 
70
- action = { method: "get", url: endpoint}
51
+ action = { method: 'get', url: endpoint }
71
52
  @client.call_adyen_api(@service, action, {}, headers, @version)
72
53
  end
73
54
 
74
- def list_terminal_products(companyId, headers: {} , queryParams: {})
75
- """
76
- Get a list of terminal products
77
- """
78
- endpoint = "/companies/{companyId}/terminalProducts".gsub(/{.+?}/, '%s')
79
- endpoint = endpoint.gsub(/^\//, "")
80
- endpoint = endpoint % [companyId]
81
- endpoint = endpoint + create_query_string(queryParams)
82
- action = { method: "get", url: endpoint}
55
+ def list_terminal_products(company_id, headers: {}, query_params: {})
56
+ endpoint = '/companies/{companyId}/terminalProducts'.gsub(/{.+?}/, '%s')
57
+ endpoint = endpoint.gsub(%r{^/}, '')
58
+ endpoint = format(endpoint, company_id)
59
+ endpoint += create_query_string(query_params)
60
+ action = { method: 'get', url: endpoint }
83
61
  @client.call_adyen_api(@service, action, {}, headers, @version)
84
62
  end
85
63
 
86
- def update_order(request, companyId, orderId, headers: {} )
87
- """
88
- Update an order
89
- """
90
- endpoint = "/companies/{companyId}/terminalOrders/{orderId}".gsub(/{.+?}/, '%s')
91
- endpoint = endpoint.gsub(/^\//, "")
92
- endpoint = endpoint % [companyId,orderId]
64
+ def update_order(request, company_id, order_id, headers: {})
65
+ endpoint = '/companies/{companyId}/terminalOrders/{orderId}'.gsub(/{.+?}/, '%s')
66
+ endpoint = endpoint.gsub(%r{^/}, '')
67
+ endpoint = format(endpoint, company_id, order_id)
93
68
 
94
- action = { method: "patch", url: endpoint}
69
+ action = { method: 'patch', url: endpoint }
95
70
  @client.call_adyen_api(@service, action, request, headers, @version)
96
71
  end
97
72
 
98
- def create_shipping_location(request, companyId, headers: {} )
99
- """
100
- Create a shipping location
101
- """
102
- endpoint = "/companies/{companyId}/shippingLocations".gsub(/{.+?}/, '%s')
103
- endpoint = endpoint.gsub(/^\//, "")
104
- endpoint = endpoint % [companyId]
73
+ def create_shipping_location(request, company_id, headers: {})
74
+ endpoint = '/companies/{companyId}/shippingLocations'.gsub(/{.+?}/, '%s')
75
+ endpoint = endpoint.gsub(%r{^/}, '')
76
+ endpoint = format(endpoint, company_id)
105
77
 
106
- action = { method: "post", url: endpoint}
78
+ action = { method: 'post', url: endpoint }
107
79
  @client.call_adyen_api(@service, action, request, headers, @version)
108
80
  end
109
81
 
110
- def create_order(request, companyId, headers: {} )
111
- """
112
- Create an order
113
- """
114
- endpoint = "/companies/{companyId}/terminalOrders".gsub(/{.+?}/, '%s')
115
- endpoint = endpoint.gsub(/^\//, "")
116
- endpoint = endpoint % [companyId]
82
+ def create_order(request, company_id, headers: {})
83
+ endpoint = '/companies/{companyId}/terminalOrders'.gsub(/{.+?}/, '%s')
84
+ endpoint = endpoint.gsub(%r{^/}, '')
85
+ endpoint = format(endpoint, company_id)
117
86
 
118
- action = { method: "post", url: endpoint}
87
+ action = { method: 'post', url: endpoint }
119
88
  @client.call_adyen_api(@service, action, request, headers, @version)
120
89
  end
121
90
 
122
- def cancel_order(companyId, orderId, headers: {} )
123
- """
124
- Cancel an order
125
- """
126
- endpoint = "/companies/{companyId}/terminalOrders/{orderId}/cancel".gsub(/{.+?}/, '%s')
127
- endpoint = endpoint.gsub(/^\//, "")
128
- endpoint = endpoint % [companyId,orderId]
91
+ def cancel_order(company_id, order_id, headers: {})
92
+ endpoint = '/companies/{companyId}/terminalOrders/{orderId}/cancel'.gsub(/{.+?}/, '%s')
93
+ endpoint = endpoint.gsub(%r{^/}, '')
94
+ endpoint = format(endpoint, company_id, order_id)
129
95
 
130
- action = { method: "post", url: endpoint}
96
+ action = { method: 'post', url: endpoint }
131
97
  @client.call_adyen_api(@service, action, {}, headers, @version)
132
98
  end
133
99
 
@@ -1,133 +1,99 @@
1
1
  require_relative '../service'
2
2
  module Adyen
3
-
4
-
5
3
  class TerminalOrdersMerchantLevelApi < Service
6
4
  attr_accessor :service, :version
7
5
 
8
6
  def initialize(client, version = DEFAULT_VERSION)
9
- @service = "Management"
10
- @client = client
11
- @version = version
7
+ super(client, version, 'Management')
12
8
  end
13
9
 
14
- def list_billing_entities(merchantId, headers: {} , queryParams: {})
15
- """
16
- Get a list of billing entities
17
- """
18
- endpoint = "/merchants/{merchantId}/billingEntities".gsub(/{.+?}/, '%s')
19
- endpoint = endpoint.gsub(/^\//, "")
20
- endpoint = endpoint % [merchantId]
21
- endpoint = endpoint + create_query_string(queryParams)
22
- action = { method: "get", url: endpoint}
10
+ def list_billing_entities(merchant_id, headers: {}, query_params: {})
11
+ endpoint = '/merchants/{merchantId}/billingEntities'.gsub(/{.+?}/, '%s')
12
+ endpoint = endpoint.gsub(%r{^/}, '')
13
+ endpoint = format(endpoint, merchant_id)
14
+ endpoint += create_query_string(query_params)
15
+ action = { method: 'get', url: endpoint }
23
16
  @client.call_adyen_api(@service, action, {}, headers, @version)
24
17
  end
25
18
 
26
- def list_shipping_locations(merchantId, headers: {} , queryParams: {})
27
- """
28
- Get a list of shipping locations
29
- """
30
- endpoint = "/merchants/{merchantId}/shippingLocations".gsub(/{.+?}/, '%s')
31
- endpoint = endpoint.gsub(/^\//, "")
32
- endpoint = endpoint % [merchantId]
33
- endpoint = endpoint + create_query_string(queryParams)
34
- action = { method: "get", url: endpoint}
19
+ def list_shipping_locations(merchant_id, headers: {}, query_params: {})
20
+ endpoint = '/merchants/{merchantId}/shippingLocations'.gsub(/{.+?}/, '%s')
21
+ endpoint = endpoint.gsub(%r{^/}, '')
22
+ endpoint = format(endpoint, merchant_id)
23
+ endpoint += create_query_string(query_params)
24
+ action = { method: 'get', url: endpoint }
35
25
  @client.call_adyen_api(@service, action, {}, headers, @version)
36
26
  end
37
27
 
38
- def list_terminal_models(merchantId, headers: {} )
39
- """
40
- Get a list of terminal models
41
- """
42
- endpoint = "/merchants/{merchantId}/terminalModels".gsub(/{.+?}/, '%s')
43
- endpoint = endpoint.gsub(/^\//, "")
44
- endpoint = endpoint % [merchantId]
28
+ def list_terminal_models(merchant_id, headers: {})
29
+ endpoint = '/merchants/{merchantId}/terminalModels'.gsub(/{.+?}/, '%s')
30
+ endpoint = endpoint.gsub(%r{^/}, '')
31
+ endpoint = format(endpoint, merchant_id)
45
32
 
46
- action = { method: "get", url: endpoint}
33
+ action = { method: 'get', url: endpoint }
47
34
  @client.call_adyen_api(@service, action, {}, headers, @version)
48
35
  end
49
36
 
50
- def list_orders(merchantId, headers: {} , queryParams: {})
51
- """
52
- Get a list of orders
53
- """
54
- endpoint = "/merchants/{merchantId}/terminalOrders".gsub(/{.+?}/, '%s')
55
- endpoint = endpoint.gsub(/^\//, "")
56
- endpoint = endpoint % [merchantId]
57
- endpoint = endpoint + create_query_string(queryParams)
58
- action = { method: "get", url: endpoint}
37
+ def list_orders(merchant_id, headers: {}, query_params: {})
38
+ endpoint = '/merchants/{merchantId}/terminalOrders'.gsub(/{.+?}/, '%s')
39
+ endpoint = endpoint.gsub(%r{^/}, '')
40
+ endpoint = format(endpoint, merchant_id)
41
+ endpoint += create_query_string(query_params)
42
+ action = { method: 'get', url: endpoint }
59
43
  @client.call_adyen_api(@service, action, {}, headers, @version)
60
44
  end
61
45
 
62
- def get_order(merchantId, orderId, headers: {} )
63
- """
64
- Get an order
65
- """
66
- endpoint = "/merchants/{merchantId}/terminalOrders/{orderId}".gsub(/{.+?}/, '%s')
67
- endpoint = endpoint.gsub(/^\//, "")
68
- endpoint = endpoint % [merchantId,orderId]
46
+ def get_order(merchant_id, order_id, headers: {})
47
+ endpoint = '/merchants/{merchantId}/terminalOrders/{orderId}'.gsub(/{.+?}/, '%s')
48
+ endpoint = endpoint.gsub(%r{^/}, '')
49
+ endpoint = format(endpoint, merchant_id, order_id)
69
50
 
70
- action = { method: "get", url: endpoint}
51
+ action = { method: 'get', url: endpoint }
71
52
  @client.call_adyen_api(@service, action, {}, headers, @version)
72
53
  end
73
54
 
74
- def list_terminal_products(merchantId, headers: {} , queryParams: {})
75
- """
76
- Get a list of terminal products
77
- """
78
- endpoint = "/merchants/{merchantId}/terminalProducts".gsub(/{.+?}/, '%s')
79
- endpoint = endpoint.gsub(/^\//, "")
80
- endpoint = endpoint % [merchantId]
81
- endpoint = endpoint + create_query_string(queryParams)
82
- action = { method: "get", url: endpoint}
55
+ def list_terminal_products(merchant_id, headers: {}, query_params: {})
56
+ endpoint = '/merchants/{merchantId}/terminalProducts'.gsub(/{.+?}/, '%s')
57
+ endpoint = endpoint.gsub(%r{^/}, '')
58
+ endpoint = format(endpoint, merchant_id)
59
+ endpoint += create_query_string(query_params)
60
+ action = { method: 'get', url: endpoint }
83
61
  @client.call_adyen_api(@service, action, {}, headers, @version)
84
62
  end
85
63
 
86
- def update_order(request, merchantId, orderId, headers: {} )
87
- """
88
- Update an order
89
- """
90
- endpoint = "/merchants/{merchantId}/terminalOrders/{orderId}".gsub(/{.+?}/, '%s')
91
- endpoint = endpoint.gsub(/^\//, "")
92
- endpoint = endpoint % [merchantId,orderId]
64
+ def update_order(request, merchant_id, order_id, headers: {})
65
+ endpoint = '/merchants/{merchantId}/terminalOrders/{orderId}'.gsub(/{.+?}/, '%s')
66
+ endpoint = endpoint.gsub(%r{^/}, '')
67
+ endpoint = format(endpoint, merchant_id, order_id)
93
68
 
94
- action = { method: "patch", url: endpoint}
69
+ action = { method: 'patch', url: endpoint }
95
70
  @client.call_adyen_api(@service, action, request, headers, @version)
96
71
  end
97
72
 
98
- def create_shipping_location(request, merchantId, headers: {} )
99
- """
100
- Create a shipping location
101
- """
102
- endpoint = "/merchants/{merchantId}/shippingLocations".gsub(/{.+?}/, '%s')
103
- endpoint = endpoint.gsub(/^\//, "")
104
- endpoint = endpoint % [merchantId]
73
+ def create_shipping_location(request, merchant_id, headers: {})
74
+ endpoint = '/merchants/{merchantId}/shippingLocations'.gsub(/{.+?}/, '%s')
75
+ endpoint = endpoint.gsub(%r{^/}, '')
76
+ endpoint = format(endpoint, merchant_id)
105
77
 
106
- action = { method: "post", url: endpoint}
78
+ action = { method: 'post', url: endpoint }
107
79
  @client.call_adyen_api(@service, action, request, headers, @version)
108
80
  end
109
81
 
110
- def create_order(request, merchantId, headers: {} )
111
- """
112
- Create an order
113
- """
114
- endpoint = "/merchants/{merchantId}/terminalOrders".gsub(/{.+?}/, '%s')
115
- endpoint = endpoint.gsub(/^\//, "")
116
- endpoint = endpoint % [merchantId]
82
+ def create_order(request, merchant_id, headers: {})
83
+ endpoint = '/merchants/{merchantId}/terminalOrders'.gsub(/{.+?}/, '%s')
84
+ endpoint = endpoint.gsub(%r{^/}, '')
85
+ endpoint = format(endpoint, merchant_id)
117
86
 
118
- action = { method: "post", url: endpoint}
87
+ action = { method: 'post', url: endpoint }
119
88
  @client.call_adyen_api(@service, action, request, headers, @version)
120
89
  end
121
90
 
122
- def cancel_order(merchantId, orderId, headers: {} )
123
- """
124
- Cancel an order
125
- """
126
- endpoint = "/merchants/{merchantId}/terminalOrders/{orderId}/cancel".gsub(/{.+?}/, '%s')
127
- endpoint = endpoint.gsub(/^\//, "")
128
- endpoint = endpoint % [merchantId,orderId]
91
+ def cancel_order(merchant_id, order_id, headers: {})
92
+ endpoint = '/merchants/{merchantId}/terminalOrders/{orderId}/cancel'.gsub(/{.+?}/, '%s')
93
+ endpoint = endpoint.gsub(%r{^/}, '')
94
+ endpoint = format(endpoint, merchant_id, order_id)
129
95
 
130
- action = { method: "post", url: endpoint}
96
+ action = { method: 'post', url: endpoint }
131
97
  @client.call_adyen_api(@service, action, {}, headers, @version)
132
98
  end
133
99
 
@@ -1,61 +1,45 @@
1
1
  require_relative '../service'
2
2
  module Adyen
3
-
4
-
5
3
  class TerminalSettingsCompanyLevelApi < Service
6
4
  attr_accessor :service, :version
7
5
 
8
6
  def initialize(client, version = DEFAULT_VERSION)
9
- @service = "Management"
10
- @client = client
11
- @version = version
7
+ super(client, version, 'Management')
12
8
  end
13
9
 
14
- def get_terminal_logo(companyId, headers: {} , queryParams: {})
15
- """
16
- Get the terminal logo
17
- """
18
- endpoint = "/companies/{companyId}/terminalLogos".gsub(/{.+?}/, '%s')
19
- endpoint = endpoint.gsub(/^\//, "")
20
- endpoint = endpoint % [companyId]
21
- endpoint = endpoint + create_query_string(queryParams)
22
- action = { method: "get", url: endpoint}
10
+ def get_terminal_logo(company_id, headers: {}, query_params: {})
11
+ endpoint = '/companies/{companyId}/terminalLogos'.gsub(/{.+?}/, '%s')
12
+ endpoint = endpoint.gsub(%r{^/}, '')
13
+ endpoint = format(endpoint, company_id)
14
+ endpoint += create_query_string(query_params)
15
+ action = { method: 'get', url: endpoint }
23
16
  @client.call_adyen_api(@service, action, {}, headers, @version)
24
17
  end
25
18
 
26
- def get_terminal_settings(companyId, headers: {} )
27
- """
28
- Get terminal settings
29
- """
30
- endpoint = "/companies/{companyId}/terminalSettings".gsub(/{.+?}/, '%s')
31
- endpoint = endpoint.gsub(/^\//, "")
32
- endpoint = endpoint % [companyId]
19
+ def get_terminal_settings(company_id, headers: {})
20
+ endpoint = '/companies/{companyId}/terminalSettings'.gsub(/{.+?}/, '%s')
21
+ endpoint = endpoint.gsub(%r{^/}, '')
22
+ endpoint = format(endpoint, company_id)
33
23
 
34
- action = { method: "get", url: endpoint}
24
+ action = { method: 'get', url: endpoint }
35
25
  @client.call_adyen_api(@service, action, {}, headers, @version)
36
26
  end
37
27
 
38
- def update_terminal_logo(request, companyId, headers: {} , queryParams: {})
39
- """
40
- Update the terminal logo
41
- """
42
- endpoint = "/companies/{companyId}/terminalLogos".gsub(/{.+?}/, '%s')
43
- endpoint = endpoint.gsub(/^\//, "")
44
- endpoint = endpoint % [companyId]
45
- endpoint = endpoint + create_query_string(queryParams)
46
- action = { method: "patch", url: endpoint}
28
+ def update_terminal_logo(request, company_id, headers: {}, query_params: {})
29
+ endpoint = '/companies/{companyId}/terminalLogos'.gsub(/{.+?}/, '%s')
30
+ endpoint = endpoint.gsub(%r{^/}, '')
31
+ endpoint = format(endpoint, company_id)
32
+ endpoint += create_query_string(query_params)
33
+ action = { method: 'patch', url: endpoint }
47
34
  @client.call_adyen_api(@service, action, request, headers, @version)
48
35
  end
49
36
 
50
- def update_terminal_settings(request, companyId, headers: {} )
51
- """
52
- Update terminal settings
53
- """
54
- endpoint = "/companies/{companyId}/terminalSettings".gsub(/{.+?}/, '%s')
55
- endpoint = endpoint.gsub(/^\//, "")
56
- endpoint = endpoint % [companyId]
37
+ def update_terminal_settings(request, company_id, headers: {})
38
+ endpoint = '/companies/{companyId}/terminalSettings'.gsub(/{.+?}/, '%s')
39
+ endpoint = endpoint.gsub(%r{^/}, '')
40
+ endpoint = format(endpoint, company_id)
57
41
 
58
- action = { method: "patch", url: endpoint}
42
+ action = { method: 'patch', url: endpoint }
59
43
  @client.call_adyen_api(@service, action, request, headers, @version)
60
44
  end
61
45
 
@@ -1,61 +1,45 @@
1
1
  require_relative '../service'
2
2
  module Adyen
3
-
4
-
5
3
  class TerminalSettingsMerchantLevelApi < Service
6
4
  attr_accessor :service, :version
7
5
 
8
6
  def initialize(client, version = DEFAULT_VERSION)
9
- @service = "Management"
10
- @client = client
11
- @version = version
7
+ super(client, version, 'Management')
12
8
  end
13
9
 
14
- def get_terminal_logo(merchantId, headers: {} , queryParams: {})
15
- """
16
- Get the terminal logo
17
- """
18
- endpoint = "/merchants/{merchantId}/terminalLogos".gsub(/{.+?}/, '%s')
19
- endpoint = endpoint.gsub(/^\//, "")
20
- endpoint = endpoint % [merchantId]
21
- endpoint = endpoint + create_query_string(queryParams)
22
- action = { method: "get", url: endpoint}
10
+ def get_terminal_logo(merchant_id, headers: {}, query_params: {})
11
+ endpoint = '/merchants/{merchantId}/terminalLogos'.gsub(/{.+?}/, '%s')
12
+ endpoint = endpoint.gsub(%r{^/}, '')
13
+ endpoint = format(endpoint, merchant_id)
14
+ endpoint += create_query_string(query_params)
15
+ action = { method: 'get', url: endpoint }
23
16
  @client.call_adyen_api(@service, action, {}, headers, @version)
24
17
  end
25
18
 
26
- def get_terminal_settings(merchantId, headers: {} )
27
- """
28
- Get terminal settings
29
- """
30
- endpoint = "/merchants/{merchantId}/terminalSettings".gsub(/{.+?}/, '%s')
31
- endpoint = endpoint.gsub(/^\//, "")
32
- endpoint = endpoint % [merchantId]
19
+ def get_terminal_settings(merchant_id, headers: {})
20
+ endpoint = '/merchants/{merchantId}/terminalSettings'.gsub(/{.+?}/, '%s')
21
+ endpoint = endpoint.gsub(%r{^/}, '')
22
+ endpoint = format(endpoint, merchant_id)
33
23
 
34
- action = { method: "get", url: endpoint}
24
+ action = { method: 'get', url: endpoint }
35
25
  @client.call_adyen_api(@service, action, {}, headers, @version)
36
26
  end
37
27
 
38
- def update_terminal_logo(request, merchantId, headers: {} , queryParams: {})
39
- """
40
- Update the terminal logo
41
- """
42
- endpoint = "/merchants/{merchantId}/terminalLogos".gsub(/{.+?}/, '%s')
43
- endpoint = endpoint.gsub(/^\//, "")
44
- endpoint = endpoint % [merchantId]
45
- endpoint = endpoint + create_query_string(queryParams)
46
- action = { method: "patch", url: endpoint}
28
+ def update_terminal_logo(request, merchant_id, headers: {}, query_params: {})
29
+ endpoint = '/merchants/{merchantId}/terminalLogos'.gsub(/{.+?}/, '%s')
30
+ endpoint = endpoint.gsub(%r{^/}, '')
31
+ endpoint = format(endpoint, merchant_id)
32
+ endpoint += create_query_string(query_params)
33
+ action = { method: 'patch', url: endpoint }
47
34
  @client.call_adyen_api(@service, action, request, headers, @version)
48
35
  end
49
36
 
50
- def update_terminal_settings(request, merchantId, headers: {} )
51
- """
52
- Update terminal settings
53
- """
54
- endpoint = "/merchants/{merchantId}/terminalSettings".gsub(/{.+?}/, '%s')
55
- endpoint = endpoint.gsub(/^\//, "")
56
- endpoint = endpoint % [merchantId]
37
+ def update_terminal_settings(request, merchant_id, headers: {})
38
+ endpoint = '/merchants/{merchantId}/terminalSettings'.gsub(/{.+?}/, '%s')
39
+ endpoint = endpoint.gsub(%r{^/}, '')
40
+ endpoint = format(endpoint, merchant_id)
57
41
 
58
- action = { method: "patch", url: endpoint}
42
+ action = { method: 'patch', url: endpoint }
59
43
  @client.call_adyen_api(@service, action, request, headers, @version)
60
44
  end
61
45