adyen-ruby-api-library 7.0.0 → 7.0.2

Sign up to get free protection for your applications and to get access to all the features.
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 +96 -76
  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 +581 -515
  101. data/spec/client_spec.rb +118 -71
  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,97 +1,72 @@
1
1
  require_relative '../service'
2
2
  module Adyen
3
-
4
-
5
3
  class WebhooksMerchantLevelApi < 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 remove_webhook(merchantId, webhookId, headers: {} )
15
- """
16
- Remove a webhook
17
- """
18
- endpoint = "/merchants/{merchantId}/webhooks/{webhookId}".gsub(/{.+?}/, '%s')
19
- endpoint = endpoint.gsub(/^\//, "")
20
- endpoint = endpoint % [merchantId,webhookId]
10
+ def remove_webhook(merchant_id, webhook_id, headers: {})
11
+ endpoint = '/merchants/{merchantId}/webhooks/{webhookId}'.gsub(/{.+?}/, '%s')
12
+ endpoint = endpoint.gsub(%r{^/}, '')
13
+ endpoint = format(endpoint, merchant_id, webhook_id)
21
14
 
22
- action = { method: "delete", url: endpoint}
15
+ action = { method: 'delete', url: endpoint }
23
16
  @client.call_adyen_api(@service, action, {}, headers, @version)
24
17
  end
25
18
 
26
- def list_all_webhooks(merchantId, headers: {} , queryParams: {})
27
- """
28
- List all webhooks
29
- """
30
- endpoint = "/merchants/{merchantId}/webhooks".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_all_webhooks(merchant_id, headers: {}, query_params: {})
20
+ endpoint = '/merchants/{merchantId}/webhooks'.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 get_webhook(merchantId, webhookId, headers: {} )
39
- """
40
- Get a webhook
41
- """
42
- endpoint = "/merchants/{merchantId}/webhooks/{webhookId}".gsub(/{.+?}/, '%s')
43
- endpoint = endpoint.gsub(/^\//, "")
44
- endpoint = endpoint % [merchantId,webhookId]
28
+ def get_webhook(merchant_id, webhook_id, headers: {})
29
+ endpoint = '/merchants/{merchantId}/webhooks/{webhookId}'.gsub(/{.+?}/, '%s')
30
+ endpoint = endpoint.gsub(%r{^/}, '')
31
+ endpoint = format(endpoint, merchant_id, webhook_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 update_webhook(request, merchantId, webhookId, headers: {} )
51
- """
52
- Update a webhook
53
- """
54
- endpoint = "/merchants/{merchantId}/webhooks/{webhookId}".gsub(/{.+?}/, '%s')
55
- endpoint = endpoint.gsub(/^\//, "")
56
- endpoint = endpoint % [merchantId,webhookId]
37
+ def update_webhook(request, merchant_id, webhook_id, headers: {})
38
+ endpoint = '/merchants/{merchantId}/webhooks/{webhookId}'.gsub(/{.+?}/, '%s')
39
+ endpoint = endpoint.gsub(%r{^/}, '')
40
+ endpoint = format(endpoint, merchant_id, webhook_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
 
62
- def set_up_webhook(request, merchantId, headers: {} )
63
- """
64
- Set up a webhook
65
- """
66
- endpoint = "/merchants/{merchantId}/webhooks".gsub(/{.+?}/, '%s')
67
- endpoint = endpoint.gsub(/^\//, "")
68
- endpoint = endpoint % [merchantId]
46
+ def set_up_webhook(request, merchant_id, headers: {})
47
+ endpoint = '/merchants/{merchantId}/webhooks'.gsub(/{.+?}/, '%s')
48
+ endpoint = endpoint.gsub(%r{^/}, '')
49
+ endpoint = format(endpoint, merchant_id)
69
50
 
70
- action = { method: "post", url: endpoint}
51
+ action = { method: 'post', url: endpoint }
71
52
  @client.call_adyen_api(@service, action, request, headers, @version)
72
53
  end
73
54
 
74
- def generate_hmac_key(merchantId, webhookId, headers: {} )
75
- """
76
- Generate an HMAC key
77
- """
78
- endpoint = "/merchants/{merchantId}/webhooks/{webhookId}/generateHmac".gsub(/{.+?}/, '%s')
79
- endpoint = endpoint.gsub(/^\//, "")
80
- endpoint = endpoint % [merchantId,webhookId]
55
+ def generate_hmac_key(merchant_id, webhook_id, headers: {})
56
+ endpoint = '/merchants/{merchantId}/webhooks/{webhookId}/generateHmac'.gsub(/{.+?}/, '%s')
57
+ endpoint = endpoint.gsub(%r{^/}, '')
58
+ endpoint = format(endpoint, merchant_id, webhook_id)
81
59
 
82
- action = { method: "post", url: endpoint}
60
+ action = { method: 'post', url: endpoint }
83
61
  @client.call_adyen_api(@service, action, {}, headers, @version)
84
62
  end
85
63
 
86
- def test_webhook(request, merchantId, webhookId, headers: {} )
87
- """
88
- Test a webhook
89
- """
90
- endpoint = "/merchants/{merchantId}/webhooks/{webhookId}/test".gsub(/{.+?}/, '%s')
91
- endpoint = endpoint.gsub(/^\//, "")
92
- endpoint = endpoint % [merchantId,webhookId]
64
+ def test_webhook(request, merchant_id, webhook_id, headers: {})
65
+ endpoint = '/merchants/{merchantId}/webhooks/{webhookId}/test'.gsub(/{.+?}/, '%s')
66
+ endpoint = endpoint.gsub(%r{^/}, '')
67
+ endpoint = format(endpoint, merchant_id, webhook_id)
93
68
 
94
- action = { method: "post", url: endpoint}
69
+ action = { method: 'post', url: endpoint }
95
70
  @client.call_adyen_api(@service, action, request, headers, @version)
96
71
  end
97
72
 
@@ -12,6 +12,7 @@ require_relative 'management/client_key_merchant_level_api'
12
12
  require_relative 'management/my_api_credential_api'
13
13
  require_relative 'management/payment_methods_merchant_level_api'
14
14
  require_relative 'management/payout_settings_merchant_level_api'
15
+ require_relative 'management/split_configuration_merchant_level_api'
15
16
  require_relative 'management/terminal_actions_company_level_api'
16
17
  require_relative 'management/terminal_actions_terminal_level_api'
17
18
  require_relative 'management/terminal_orders_company_level_api'
@@ -27,125 +28,127 @@ require_relative 'management/webhooks_company_level_api'
27
28
  require_relative 'management/webhooks_merchant_level_api'
28
29
 
29
30
  module Adyen
30
-
31
-
32
- class Management
33
- attr_accessor :service, :version
34
-
35
- DEFAULT_VERSION = 1
36
- def initialize(client, version = DEFAULT_VERSION)
37
- @service = "Management"
38
- @client = client
39
- @version = version
40
- end
41
-
42
- def api_credentials_company_level_api
43
- @api_credentials_company_level_api ||= Adyen::APICredentialsCompanyLevelApi.new(@client, @version)
44
- end
45
-
46
- def api_credentials_merchant_level_api
47
- @api_credentials_merchant_level_api ||= Adyen::APICredentialsMerchantLevelApi.new(@client, @version)
48
- end
49
-
50
- def api_key_company_level_api
51
- @api_key_company_level_api ||= Adyen::APIKeyCompanyLevelApi.new(@client, @version)
52
- end
31
+ class Management
32
+ attr_accessor :service, :version
33
+
34
+ DEFAULT_VERSION = 1
35
+ def initialize(client, version = DEFAULT_VERSION)
36
+ @service = 'Management'
37
+ @client = client
38
+ @version = version
39
+ end
40
+
41
+ def api_credentials_company_level_api
42
+ @api_credentials_company_level_api ||= Adyen::APICredentialsCompanyLevelApi.new(@client, @version)
43
+ end
44
+
45
+ def api_credentials_merchant_level_api
46
+ @api_credentials_merchant_level_api ||= Adyen::APICredentialsMerchantLevelApi.new(@client, @version)
47
+ end
48
+
49
+ def api_key_company_level_api
50
+ @api_key_company_level_api ||= Adyen::APIKeyCompanyLevelApi.new(@client, @version)
51
+ end
53
52
 
54
- def api_key_merchant_level_api
55
- @api_key_merchant_level_api ||= Adyen::APIKeyMerchantLevelApi.new(@client, @version)
56
- end
53
+ def api_key_merchant_level_api
54
+ @api_key_merchant_level_api ||= Adyen::APIKeyMerchantLevelApi.new(@client, @version)
55
+ end
57
56
 
58
- def account_company_level_api
59
- @account_company_level_api ||= Adyen::AccountCompanyLevelApi.new(@client, @version)
60
- end
57
+ def account_company_level_api
58
+ @account_company_level_api ||= Adyen::AccountCompanyLevelApi.new(@client, @version)
59
+ end
61
60
 
62
- def account_merchant_level_api
63
- @account_merchant_level_api ||= Adyen::AccountMerchantLevelApi.new(@client, @version)
64
- end
61
+ def account_merchant_level_api
62
+ @account_merchant_level_api ||= Adyen::AccountMerchantLevelApi.new(@client, @version)
63
+ end
65
64
 
66
- def account_store_level_api
67
- @account_store_level_api ||= Adyen::AccountStoreLevelApi.new(@client, @version)
68
- end
65
+ def account_store_level_api
66
+ @account_store_level_api ||= Adyen::AccountStoreLevelApi.new(@client, @version)
67
+ end
69
68
 
70
- def allowed_origins_company_level_api
71
- @allowed_origins_company_level_api ||= Adyen::AllowedOriginsCompanyLevelApi.new(@client, @version)
72
- end
69
+ def allowed_origins_company_level_api
70
+ @allowed_origins_company_level_api ||= Adyen::AllowedOriginsCompanyLevelApi.new(@client, @version)
71
+ end
73
72
 
74
- def allowed_origins_merchant_level_api
75
- @allowed_origins_merchant_level_api ||= Adyen::AllowedOriginsMerchantLevelApi.new(@client, @version)
76
- end
73
+ def allowed_origins_merchant_level_api
74
+ @allowed_origins_merchant_level_api ||= Adyen::AllowedOriginsMerchantLevelApi.new(@client, @version)
75
+ end
77
76
 
78
- def client_key_company_level_api
79
- @client_key_company_level_api ||= Adyen::ClientKeyCompanyLevelApi.new(@client, @version)
80
- end
77
+ def client_key_company_level_api
78
+ @client_key_company_level_api ||= Adyen::ClientKeyCompanyLevelApi.new(@client, @version)
79
+ end
81
80
 
82
- def client_key_merchant_level_api
83
- @client_key_merchant_level_api ||= Adyen::ClientKeyMerchantLevelApi.new(@client, @version)
84
- end
81
+ def client_key_merchant_level_api
82
+ @client_key_merchant_level_api ||= Adyen::ClientKeyMerchantLevelApi.new(@client, @version)
83
+ end
85
84
 
86
- def my_api_credential_api
87
- @my_api_credential_api ||= Adyen::MyAPICredentialApi.new(@client, @version)
88
- end
85
+ def my_api_credential_api
86
+ @my_api_credential_api ||= Adyen::MyAPICredentialApi.new(@client, @version)
87
+ end
89
88
 
90
- def payment_methods_merchant_level_api
91
- @payment_methods_merchant_level_api ||= Adyen::PaymentMethodsMerchantLevelApi.new(@client, @version)
92
- end
89
+ def payment_methods_merchant_level_api
90
+ @payment_methods_merchant_level_api ||= Adyen::PaymentMethodsMerchantLevelApi.new(@client, @version)
91
+ end
93
92
 
94
- def payout_settings_merchant_level_api
95
- @payout_settings_merchant_level_api ||= Adyen::PayoutSettingsMerchantLevelApi.new(@client, @version)
96
- end
93
+ def payout_settings_merchant_level_api
94
+ @payout_settings_merchant_level_api ||= Adyen::PayoutSettingsMerchantLevelApi.new(@client, @version)
95
+ end
97
96
 
98
- def terminal_actions_company_level_api
99
- @terminal_actions_company_level_api ||= Adyen::TerminalActionsCompanyLevelApi.new(@client, @version)
100
- end
97
+ def split_configuration_merchant_level_api
98
+ @split_configuration_merchant_level_api ||= Adyen::SplitConfigurationMerchantLevelApi.new(@client, @version)
99
+ end
101
100
 
102
- def terminal_actions_terminal_level_api
103
- @terminal_actions_terminal_level_api ||= Adyen::TerminalActionsTerminalLevelApi.new(@client, @version)
104
- end
101
+ def terminal_actions_company_level_api
102
+ @terminal_actions_company_level_api ||= Adyen::TerminalActionsCompanyLevelApi.new(@client, @version)
103
+ end
105
104
 
106
- def terminal_orders_company_level_api
107
- @terminal_orders_company_level_api ||= Adyen::TerminalOrdersCompanyLevelApi.new(@client, @version)
108
- end
105
+ def terminal_actions_terminal_level_api
106
+ @terminal_actions_terminal_level_api ||= Adyen::TerminalActionsTerminalLevelApi.new(@client, @version)
107
+ end
109
108
 
110
- def terminal_orders_merchant_level_api
111
- @terminal_orders_merchant_level_api ||= Adyen::TerminalOrdersMerchantLevelApi.new(@client, @version)
112
- end
109
+ def terminal_orders_company_level_api
110
+ @terminal_orders_company_level_api ||= Adyen::TerminalOrdersCompanyLevelApi.new(@client, @version)
111
+ end
113
112
 
114
- def terminal_settings_company_level_api
115
- @terminal_settings_company_level_api ||= Adyen::TerminalSettingsCompanyLevelApi.new(@client, @version)
116
- end
113
+ def terminal_orders_merchant_level_api
114
+ @terminal_orders_merchant_level_api ||= Adyen::TerminalOrdersMerchantLevelApi.new(@client, @version)
115
+ end
117
116
 
118
- def terminal_settings_merchant_level_api
119
- @terminal_settings_merchant_level_api ||= Adyen::TerminalSettingsMerchantLevelApi.new(@client, @version)
120
- end
117
+ def terminal_settings_company_level_api
118
+ @terminal_settings_company_level_api ||= Adyen::TerminalSettingsCompanyLevelApi.new(@client, @version)
119
+ end
121
120
 
122
- def terminal_settings_store_level_api
123
- @terminal_settings_store_level_api ||= Adyen::TerminalSettingsStoreLevelApi.new(@client, @version)
124
- end
121
+ def terminal_settings_merchant_level_api
122
+ @terminal_settings_merchant_level_api ||= Adyen::TerminalSettingsMerchantLevelApi.new(@client, @version)
123
+ end
125
124
 
126
- def terminal_settings_terminal_level_api
127
- @terminal_settings_terminal_level_api ||= Adyen::TerminalSettingsTerminalLevelApi.new(@client, @version)
128
- end
125
+ def terminal_settings_store_level_api
126
+ @terminal_settings_store_level_api ||= Adyen::TerminalSettingsStoreLevelApi.new(@client, @version)
127
+ end
129
128
 
130
- def terminals_terminal_level_api
131
- @terminals_terminal_level_api ||= Adyen::TerminalsTerminalLevelApi.new(@client, @version)
132
- end
129
+ def terminal_settings_terminal_level_api
130
+ @terminal_settings_terminal_level_api ||= Adyen::TerminalSettingsTerminalLevelApi.new(@client, @version)
131
+ end
133
132
 
134
- def users_company_level_api
135
- @users_company_level_api ||= Adyen::UsersCompanyLevelApi.new(@client, @version)
136
- end
133
+ def terminals_terminal_level_api
134
+ @terminals_terminal_level_api ||= Adyen::TerminalsTerminalLevelApi.new(@client, @version)
135
+ end
137
136
 
138
- def users_merchant_level_api
139
- @users_merchant_level_api ||= Adyen::UsersMerchantLevelApi.new(@client, @version)
140
- end
137
+ def users_company_level_api
138
+ @users_company_level_api ||= Adyen::UsersCompanyLevelApi.new(@client, @version)
139
+ end
141
140
 
142
- def webhooks_company_level_api
143
- @webhooks_company_level_api ||= Adyen::WebhooksCompanyLevelApi.new(@client, @version)
144
- end
141
+ def users_merchant_level_api
142
+ @users_merchant_level_api ||= Adyen::UsersMerchantLevelApi.new(@client, @version)
143
+ end
145
144
 
146
- def webhooks_merchant_level_api
147
- @webhooks_merchant_level_api ||= Adyen::WebhooksMerchantLevelApi.new(@client, @version)
148
- end
145
+ def webhooks_company_level_api
146
+ @webhooks_company_level_api ||= Adyen::WebhooksCompanyLevelApi.new(@client, @version)
147
+ end
149
148
 
149
+ def webhooks_merchant_level_api
150
+ @webhooks_merchant_level_api ||= Adyen::WebhooksMerchantLevelApi.new(@client, @version)
150
151
  end
151
- end
152
+
153
+ end
154
+ end
@@ -1,3 +1,5 @@
1
+ # rubocop:disable Metrics/MethodLength
2
+
1
3
  require_relative 'service'
2
4
 
3
5
  module Adyen
@@ -7,7 +9,7 @@ module Adyen
7
9
 
8
10
  def initialize(client)
9
11
  @client = client
10
- @service = ""
12
+ @service = ''
11
13
  end
12
14
 
13
15
  def account
@@ -29,28 +31,29 @@ module Adyen
29
31
 
30
32
  class Account < Service
31
33
  attr_accessor :version
34
+
32
35
  DEFAULT_VERSION = 6
33
36
 
34
37
  def initialize(client, version = DEFAULT_VERSION)
35
38
  service = 'Account'
36
- method_names = [
37
- :create_account_holder,
38
- :update_account_holder,
39
- :create_account,
40
- :update_account,
41
- :upload_document,
42
- :get_uploaded_documents,
43
- :get_account_holder,
44
- :update_account_holder_state,
45
- :delete_bank_accounts,
46
- :delete_shareholders,
47
- :delete_signatories,
48
- :close_account,
49
- :close_account_holder,
50
- :suspend_account_holder,
51
- :un_suspend_account_holder,
52
- :delete_payout_methods,
53
- :check_account_holder
39
+ method_names = %i[
40
+ create_account_holder
41
+ update_account_holder
42
+ create_account
43
+ update_account
44
+ upload_document
45
+ get_uploaded_documents
46
+ get_account_holder
47
+ update_account_holder_state
48
+ delete_bank_accounts
49
+ delete_shareholders
50
+ delete_signatories
51
+ close_account
52
+ close_account_holder
53
+ suspend_account_holder
54
+ un_suspend_account_holder
55
+ delete_payout_methods
56
+ check_account_holder
54
57
  ]
55
58
 
56
59
  super(client, version, service, method_names)
@@ -59,37 +62,38 @@ module Adyen
59
62
 
60
63
  class Fund < Service
61
64
  attr_accessor :version
65
+
62
66
  DEFAULT_VERSION = 6
63
67
 
64
68
  def initialize(client, version = DEFAULT_VERSION)
65
- service = 'Fund'
66
- method_names = [
67
- :payout_account_holder,
68
- :account_holder_balance,
69
- :account_holder_transaction_list,
70
- :refund_not_paid_out_transfers,
71
- :setup_beneficiary,
72
- :transfer_funds,
73
- :refund_funds_transfer
69
+ method_names = %i[
70
+ payout_account_holder
71
+ account_holder_balance
72
+ account_holder_transaction_list
73
+ refund_not_paid_out_transfers
74
+ setup_beneficiary
75
+ transfer_funds
76
+ refund_funds_transfer
74
77
  ]
75
78
 
76
- super(client, version, service, method_names)
79
+ super(client, version, 'Fund', method_names)
77
80
  end
78
81
  end
79
82
 
80
83
  class Notification < Service
81
84
  attr_accessor :version
85
+
82
86
  DEFAULT_VERSION = 6
83
87
 
84
88
  def initialize(client, version = DEFAULT_VERSION)
85
89
  service = 'Notification'
86
- method_names = [
87
- :create_notification_configuration,
88
- :update_notification_configuration,
89
- :get_notification_configuration,
90
- :delete_notification_configurations,
91
- :get_notification_configuration_list,
92
- :test_notification_configuration
90
+ method_names = %i[
91
+ create_notification_configuration
92
+ update_notification_configuration
93
+ get_notification_configuration
94
+ delete_notification_configurations
95
+ get_notification_configuration_list
96
+ test_notification_configuration
93
97
  ]
94
98
 
95
99
  super(client, version, service, method_names)
@@ -98,6 +102,7 @@ module Adyen
98
102
 
99
103
  class Hop < Service
100
104
  attr_accessor :version
105
+
101
106
  DEFAULT_VERSION = 6
102
107
 
103
108
  def initialize(client, version = DEFAULT_VERSION)
@@ -111,3 +116,4 @@ module Adyen
111
116
  end
112
117
  end
113
118
  end
119
+ # rubocop:enable Metrics/MethodLength
@@ -0,0 +1,56 @@
1
+ require_relative '../service'
2
+ module Adyen
3
+ class GeneralApi < Service
4
+ attr_accessor :service, :version
5
+
6
+ def initialize(client, version = DEFAULT_VERSION)
7
+ super(client, version, 'Payment')
8
+ end
9
+
10
+ def authorise(request, headers: {})
11
+ endpoint = '/authorise'.gsub(/{.+?}/, '%s')
12
+ endpoint = endpoint.gsub(%r{^/}, '')
13
+ endpoint = format(endpoint)
14
+
15
+ action = { method: 'post', url: endpoint }
16
+ @client.call_adyen_api(@service, action, request, headers, @version)
17
+ end
18
+
19
+ def authorise3d(request, headers: {})
20
+ endpoint = '/authorise3d'.gsub(/{.+?}/, '%s')
21
+ endpoint = endpoint.gsub(%r{^/}, '')
22
+ endpoint = format(endpoint)
23
+
24
+ action = { method: 'post', url: endpoint }
25
+ @client.call_adyen_api(@service, action, request, headers, @version)
26
+ end
27
+
28
+ def authorise3ds2(request, headers: {})
29
+ endpoint = '/authorise3ds2'.gsub(/{.+?}/, '%s')
30
+ endpoint = endpoint.gsub(%r{^/}, '')
31
+ endpoint = format(endpoint)
32
+
33
+ action = { method: 'post', url: endpoint }
34
+ @client.call_adyen_api(@service, action, request, headers, @version)
35
+ end
36
+
37
+ def get_authentication_result(request, headers: {})
38
+ endpoint = '/getAuthenticationResult'.gsub(/{.+?}/, '%s')
39
+ endpoint = endpoint.gsub(%r{^/}, '')
40
+ endpoint = format(endpoint)
41
+
42
+ action = { method: 'post', url: endpoint }
43
+ @client.call_adyen_api(@service, action, request, headers, @version)
44
+ end
45
+
46
+ def retrieve3ds2_result(request, headers: {})
47
+ endpoint = '/retrieve3ds2Result'.gsub(/{.+?}/, '%s')
48
+ endpoint = endpoint.gsub(%r{^/}, '')
49
+ endpoint = format(endpoint)
50
+
51
+ action = { method: 'post', url: endpoint }
52
+ @client.call_adyen_api(@service, action, request, headers, @version)
53
+ end
54
+
55
+ end
56
+ end
@@ -0,0 +1,83 @@
1
+ require_relative '../service'
2
+ module Adyen
3
+ class ModificationsApi < Service
4
+ attr_accessor :service, :version
5
+
6
+ def initialize(client, version = DEFAULT_VERSION)
7
+ super(client, version, 'Payment')
8
+ end
9
+
10
+ def adjust_authorisation(request, headers: {})
11
+ endpoint = '/adjustAuthorisation'.gsub(/{.+?}/, '%s')
12
+ endpoint = endpoint.gsub(%r{^/}, '')
13
+ endpoint = format(endpoint)
14
+
15
+ action = { method: 'post', url: endpoint }
16
+ @client.call_adyen_api(@service, action, request, headers, @version)
17
+ end
18
+
19
+ def cancel(request, headers: {})
20
+ endpoint = '/cancel'.gsub(/{.+?}/, '%s')
21
+ endpoint = endpoint.gsub(%r{^/}, '')
22
+ endpoint = format(endpoint)
23
+
24
+ action = { method: 'post', url: endpoint }
25
+ @client.call_adyen_api(@service, action, request, headers, @version)
26
+ end
27
+
28
+ def cancel_or_refund(request, headers: {})
29
+ endpoint = '/cancelOrRefund'.gsub(/{.+?}/, '%s')
30
+ endpoint = endpoint.gsub(%r{^/}, '')
31
+ endpoint = format(endpoint)
32
+
33
+ action = { method: 'post', url: endpoint }
34
+ @client.call_adyen_api(@service, action, request, headers, @version)
35
+ end
36
+
37
+ def capture(request, headers: {})
38
+ endpoint = '/capture'.gsub(/{.+?}/, '%s')
39
+ endpoint = endpoint.gsub(%r{^/}, '')
40
+ endpoint = format(endpoint)
41
+
42
+ action = { method: 'post', url: endpoint }
43
+ @client.call_adyen_api(@service, action, request, headers, @version)
44
+ end
45
+
46
+ def donate(request, headers: {})
47
+ endpoint = '/donate'.gsub(/{.+?}/, '%s')
48
+ endpoint = endpoint.gsub(%r{^/}, '')
49
+ endpoint = format(endpoint)
50
+
51
+ action = { method: 'post', url: endpoint }
52
+ @client.call_adyen_api(@service, action, request, headers, @version)
53
+ end
54
+
55
+ def refund(request, headers: {})
56
+ endpoint = '/refund'.gsub(/{.+?}/, '%s')
57
+ endpoint = endpoint.gsub(%r{^/}, '')
58
+ endpoint = format(endpoint)
59
+
60
+ action = { method: 'post', url: endpoint }
61
+ @client.call_adyen_api(@service, action, request, headers, @version)
62
+ end
63
+
64
+ def technical_cancel(request, headers: {})
65
+ endpoint = '/technicalCancel'.gsub(/{.+?}/, '%s')
66
+ endpoint = endpoint.gsub(%r{^/}, '')
67
+ endpoint = format(endpoint)
68
+
69
+ action = { method: 'post', url: endpoint }
70
+ @client.call_adyen_api(@service, action, request, headers, @version)
71
+ end
72
+
73
+ def void_pending_refund(request, headers: {})
74
+ endpoint = '/voidPendingRefund'.gsub(/{.+?}/, '%s')
75
+ endpoint = endpoint.gsub(%r{^/}, '')
76
+ endpoint = format(endpoint)
77
+
78
+ action = { method: 'post', url: endpoint }
79
+ @client.call_adyen_api(@service, action, request, headers, @version)
80
+ end
81
+
82
+ end
83
+ end