adyen-ruby-api-library 6.3.0 → 7.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (127) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -0
  3. data/Makefile +72 -0
  4. data/README.md +20 -18
  5. data/lib/adyen/client.rb +66 -38
  6. data/lib/adyen/services/balanceControlService.rb +28 -0
  7. data/lib/adyen/services/balancePlatform/account_holders_api.rb +63 -0
  8. data/lib/adyen/services/balancePlatform/balance_accounts_api.rb +123 -0
  9. data/lib/adyen/services/balancePlatform/bank_account_validation_api.rb +27 -0
  10. data/lib/adyen/services/balancePlatform/grant_accounts_api.rb +27 -0
  11. data/lib/adyen/services/balancePlatform/grant_offers_api.rb +39 -0
  12. data/lib/adyen/services/balancePlatform/payment_instrument_groups_api.rb +51 -0
  13. data/lib/adyen/services/balancePlatform/payment_instruments_api.rb +75 -0
  14. data/lib/adyen/services/balancePlatform/platform_api.rb +39 -0
  15. data/lib/adyen/services/balancePlatform/transaction_rules_api.rb +63 -0
  16. data/lib/adyen/services/balancePlatform.rb +61 -0
  17. data/lib/adyen/services/binLookup.rb +40 -0
  18. data/lib/adyen/services/checkout/classic_checkout_sdk_api.rb +39 -0
  19. data/lib/adyen/services/checkout/modifications_api.rb +87 -0
  20. data/lib/adyen/services/checkout/orders_api.rb +51 -0
  21. data/lib/adyen/services/checkout/payment_links_api.rb +51 -0
  22. data/lib/adyen/services/checkout/payments_api.rb +87 -0
  23. data/lib/adyen/services/checkout/recurring_api.rb +39 -0
  24. data/lib/adyen/services/checkout/utility_api.rb +39 -0
  25. data/lib/adyen/services/checkout.rb +38 -211
  26. data/lib/adyen/services/dataProtection.rb +28 -0
  27. data/lib/adyen/services/legalEntityManagement/business_lines_api.rb +63 -0
  28. data/lib/adyen/services/legalEntityManagement/documents_api.rb +63 -0
  29. data/lib/adyen/services/legalEntityManagement/hosted_onboarding_api.rb +51 -0
  30. data/lib/adyen/services/legalEntityManagement/legal_entities_api.rb +75 -0
  31. data/lib/adyen/services/legalEntityManagement/pci_questionnaires_api.rb +63 -0
  32. data/lib/adyen/services/legalEntityManagement/terms_of_service_api.rb +51 -0
  33. data/lib/adyen/services/legalEntityManagement/transfer_instruments_api.rb +63 -0
  34. data/lib/adyen/services/legalEntityManagement.rb +51 -0
  35. data/lib/adyen/services/management/account_company_level_api.rb +51 -0
  36. data/lib/adyen/services/management/account_merchant_level_api.rb +63 -0
  37. data/lib/adyen/services/management/account_store_level_api.rb +111 -0
  38. data/lib/adyen/services/management/allowed_origins_company_level_api.rb +63 -0
  39. data/lib/adyen/services/management/allowed_origins_merchant_level_api.rb +63 -0
  40. data/lib/adyen/services/management/api_credentials_company_level_api.rb +63 -0
  41. data/lib/adyen/services/management/api_credentials_merchant_level_api.rb +63 -0
  42. data/lib/adyen/services/management/api_key_company_level_api.rb +27 -0
  43. data/lib/adyen/services/management/api_key_merchant_level_api.rb +27 -0
  44. data/lib/adyen/services/management/client_key_company_level_api.rb +27 -0
  45. data/lib/adyen/services/management/client_key_merchant_level_api.rb +27 -0
  46. data/lib/adyen/services/management/my_api_credential_api.rb +75 -0
  47. data/lib/adyen/services/management/payment_methods_merchant_level_api.rb +87 -0
  48. data/lib/adyen/services/management/payout_settings_merchant_level_api.rb +75 -0
  49. data/lib/adyen/services/management/terminal_actions_company_level_api.rb +63 -0
  50. data/lib/adyen/services/management/terminal_actions_terminal_level_api.rb +27 -0
  51. data/lib/adyen/services/management/terminal_orders_company_level_api.rb +135 -0
  52. data/lib/adyen/services/management/terminal_orders_merchant_level_api.rb +135 -0
  53. data/lib/adyen/services/management/terminal_settings_company_level_api.rb +63 -0
  54. data/lib/adyen/services/management/terminal_settings_merchant_level_api.rb +63 -0
  55. data/lib/adyen/services/management/terminal_settings_store_level_api.rb +111 -0
  56. data/lib/adyen/services/management/terminal_settings_terminal_level_api.rb +63 -0
  57. data/lib/adyen/services/management/terminals_terminal_level_api.rb +27 -0
  58. data/lib/adyen/services/management/users_company_level_api.rb +63 -0
  59. data/lib/adyen/services/management/users_merchant_level_api.rb +63 -0
  60. data/lib/adyen/services/management/webhooks_company_level_api.rb +99 -0
  61. data/lib/adyen/services/management/webhooks_merchant_level_api.rb +99 -0
  62. data/lib/adyen/services/management.rb +151 -0
  63. data/lib/adyen/services/payment.rb +172 -0
  64. data/lib/adyen/services/payout/initialization_api.rb +51 -0
  65. data/lib/adyen/services/payout/instant_payouts_api.rb +27 -0
  66. data/lib/adyen/services/payout/reviewing_api.rb +39 -0
  67. data/lib/adyen/services/payout.rb +31 -0
  68. data/lib/adyen/services/posTerminalManagement.rb +76 -0
  69. data/lib/adyen/services/recurring.rb +81 -13
  70. data/lib/adyen/services/service.rb +2 -2
  71. data/lib/adyen/services/storedValue.rb +88 -0
  72. data/lib/adyen/services/transfers/transactions_api.rb +39 -0
  73. data/lib/adyen/services/transfers/transfers_api.rb +27 -0
  74. data/lib/adyen/services/transfers.rb +26 -0
  75. data/lib/adyen/version.rb +1 -1
  76. data/lib/adyen-ruby-api-library.rb +11 -5
  77. data/spec/account_spec.rb +1 -1
  78. data/spec/balance_control_spec.rb +44 -0
  79. data/spec/balance_platform_spec.rb +123 -0
  80. data/spec/bin_lookup_spec.rb +68 -10
  81. data/spec/checkout_spec.rb +39 -66
  82. data/spec/client_spec.rb +88 -9
  83. data/spec/fund_spec.rb +1 -1
  84. data/spec/hop_spec.rb +1 -1
  85. data/spec/lem_spec.rb +68 -0
  86. data/spec/management_spec.rb +68 -0
  87. data/spec/mocks/requests/BalanceControl/balance_transfer.json +10 -0
  88. data/spec/mocks/requests/BalancePlatform/create_account_holder.json +5 -0
  89. data/spec/mocks/requests/BalancePlatform/update_account_holder.json +10 -0
  90. data/spec/mocks/requests/LegalEntityManagement/create_business_line.json +15 -0
  91. data/spec/mocks/requests/Management/create_store.json +15 -0
  92. data/spec/mocks/requests/Recurring/create_permit.json +6 -0
  93. data/spec/mocks/requests/StoredValue/issue_giftcard.json +12 -0
  94. data/spec/mocks/requests/Transfers/get_transactions.json +82 -0
  95. data/spec/mocks/requests/Transfers/make_transfer.json +32 -0
  96. data/spec/mocks/responses/BalanceControl/balance_transfer.json +14 -0
  97. data/spec/mocks/responses/BalancePlatform/create_account_holder.json +41 -0
  98. data/spec/mocks/responses/BalancePlatform/get_balance_account.json +15 -0
  99. data/spec/mocks/responses/BalancePlatform/update_account_holder.json +16 -0
  100. data/spec/mocks/responses/LegalEntityManagement/create_business_line.json +17 -0
  101. data/spec/mocks/responses/Management/create_store.json +23 -0
  102. data/spec/mocks/responses/Management/get_companies.json +42 -0
  103. data/spec/mocks/responses/Recurring/create_permit.json +4 -0
  104. data/spec/mocks/responses/StoredValue/issue_giftcard.json +13 -0
  105. data/spec/mocks/responses/Transfers/get_transactions.json +82 -0
  106. data/spec/mocks/responses/Transfers/make_transfer.json +36 -0
  107. data/spec/notification_spec.rb +1 -1
  108. data/spec/payments_spec.rb +41 -23
  109. data/spec/payouts_spec.rb +43 -16
  110. data/spec/pos_terminal_management_spec.rb +46 -0
  111. data/spec/recurring_spec.rb +2 -2
  112. data/spec/spec_helper.rb +0 -10
  113. data/spec/stored_value_spec.rb +43 -0
  114. data/spec/transfers_spec.rb +63 -0
  115. data/templates/api-single.mustache +29 -0
  116. data/templates/api-small.mustache +37 -0
  117. data/templates/api.mustache +36 -0
  118. data/templates/config.yaml +10 -0
  119. metadata +101 -11
  120. data/lib/adyen/services/bin_lookup.rb +0 -18
  121. data/lib/adyen/services/data_protection.rb +0 -17
  122. data/lib/adyen/services/payments.rb +0 -34
  123. data/lib/adyen/services/payouts.rb +0 -22
  124. data/lib/adyen/services/postfmapi.rb +0 -19
  125. data/spec/mocks/requests/Recurring/store_token.json +0 -15
  126. data/spec/mocks/responses/Recurring/store_token.json +0 -7
  127. data/spec/postfmapi_spec.rb +0 -16
@@ -0,0 +1,63 @@
1
+ require_relative '../service'
2
+ module Adyen
3
+
4
+
5
+ class TerminalSettingsCompanyLevelApi < Service
6
+ attr_accessor :service, :version
7
+
8
+ def initialize(client, version = DEFAULT_VERSION)
9
+ @service = "Management"
10
+ @client = client
11
+ @version = version
12
+ end
13
+
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}
23
+ @client.call_adyen_api(@service, action, {}, headers, @version)
24
+ end
25
+
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]
33
+
34
+ action = { method: "get", url: endpoint}
35
+ @client.call_adyen_api(@service, action, {}, headers, @version)
36
+ end
37
+
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}
47
+ @client.call_adyen_api(@service, action, request, headers, @version)
48
+ end
49
+
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]
57
+
58
+ action = { method: "patch", url: endpoint}
59
+ @client.call_adyen_api(@service, action, request, headers, @version)
60
+ end
61
+
62
+ end
63
+ end
@@ -0,0 +1,63 @@
1
+ require_relative '../service'
2
+ module Adyen
3
+
4
+
5
+ class TerminalSettingsMerchantLevelApi < Service
6
+ attr_accessor :service, :version
7
+
8
+ def initialize(client, version = DEFAULT_VERSION)
9
+ @service = "Management"
10
+ @client = client
11
+ @version = version
12
+ end
13
+
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}
23
+ @client.call_adyen_api(@service, action, {}, headers, @version)
24
+ end
25
+
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]
33
+
34
+ action = { method: "get", url: endpoint}
35
+ @client.call_adyen_api(@service, action, {}, headers, @version)
36
+ end
37
+
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}
47
+ @client.call_adyen_api(@service, action, request, headers, @version)
48
+ end
49
+
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]
57
+
58
+ action = { method: "patch", url: endpoint}
59
+ @client.call_adyen_api(@service, action, request, headers, @version)
60
+ end
61
+
62
+ end
63
+ end
@@ -0,0 +1,111 @@
1
+ require_relative '../service'
2
+ module Adyen
3
+
4
+
5
+ class TerminalSettingsStoreLevelApi < Service
6
+ attr_accessor :service, :version
7
+
8
+ def initialize(client, version = DEFAULT_VERSION)
9
+ @service = "Management"
10
+ @client = client
11
+ @version = version
12
+ end
13
+
14
+ def get_terminal_logo(merchantId, reference, headers: {} , queryParams: {})
15
+ """
16
+ Get the terminal logo
17
+ """
18
+ endpoint = "/merchants/{merchantId}/stores/{reference}/terminalLogos".gsub(/{.+?}/, '%s')
19
+ endpoint = endpoint.gsub(/^\//, "")
20
+ endpoint = endpoint % [merchantId,reference]
21
+ endpoint = endpoint + create_query_string(queryParams)
22
+ action = { method: "get", url: endpoint}
23
+ @client.call_adyen_api(@service, action, {}, headers, @version)
24
+ end
25
+
26
+ def get_terminal_settings(merchantId, reference, headers: {} )
27
+ """
28
+ Get terminal settings
29
+ """
30
+ endpoint = "/merchants/{merchantId}/stores/{reference}/terminalSettings".gsub(/{.+?}/, '%s')
31
+ endpoint = endpoint.gsub(/^\//, "")
32
+ endpoint = endpoint % [merchantId,reference]
33
+
34
+ action = { method: "get", url: endpoint}
35
+ @client.call_adyen_api(@service, action, {}, headers, @version)
36
+ end
37
+
38
+ def get_terminal_logo_by_store_id(storeId, headers: {} , queryParams: {})
39
+ """
40
+ Get the terminal logo
41
+ """
42
+ endpoint = "/stores/{storeId}/terminalLogos".gsub(/{.+?}/, '%s')
43
+ endpoint = endpoint.gsub(/^\//, "")
44
+ endpoint = endpoint % [storeId]
45
+ endpoint = endpoint + create_query_string(queryParams)
46
+ action = { method: "get", url: endpoint}
47
+ @client.call_adyen_api(@service, action, {}, headers, @version)
48
+ end
49
+
50
+ def get_terminal_settings_by_store_id(storeId, headers: {} )
51
+ """
52
+ Get terminal settings
53
+ """
54
+ endpoint = "/stores/{storeId}/terminalSettings".gsub(/{.+?}/, '%s')
55
+ endpoint = endpoint.gsub(/^\//, "")
56
+ endpoint = endpoint % [storeId]
57
+
58
+ action = { method: "get", url: endpoint}
59
+ @client.call_adyen_api(@service, action, {}, headers, @version)
60
+ end
61
+
62
+ def update_terminal_logo(request, merchantId, reference, headers: {} , queryParams: {})
63
+ """
64
+ Update the terminal logo
65
+ """
66
+ endpoint = "/merchants/{merchantId}/stores/{reference}/terminalLogos".gsub(/{.+?}/, '%s')
67
+ endpoint = endpoint.gsub(/^\//, "")
68
+ endpoint = endpoint % [merchantId,reference]
69
+ endpoint = endpoint + create_query_string(queryParams)
70
+ action = { method: "patch", url: endpoint}
71
+ @client.call_adyen_api(@service, action, request, headers, @version)
72
+ end
73
+
74
+ def update_terminal_settings(request, merchantId, reference, headers: {} )
75
+ """
76
+ Update terminal settings
77
+ """
78
+ endpoint = "/merchants/{merchantId}/stores/{reference}/terminalSettings".gsub(/{.+?}/, '%s')
79
+ endpoint = endpoint.gsub(/^\//, "")
80
+ endpoint = endpoint % [merchantId,reference]
81
+
82
+ action = { method: "patch", url: endpoint}
83
+ @client.call_adyen_api(@service, action, request, headers, @version)
84
+ end
85
+
86
+ def update_terminal_logo_by_store_id(request, storeId, headers: {} , queryParams: {})
87
+ """
88
+ Update the terminal logo
89
+ """
90
+ endpoint = "/stores/{storeId}/terminalLogos".gsub(/{.+?}/, '%s')
91
+ endpoint = endpoint.gsub(/^\//, "")
92
+ endpoint = endpoint % [storeId]
93
+ endpoint = endpoint + create_query_string(queryParams)
94
+ action = { method: "patch", url: endpoint}
95
+ @client.call_adyen_api(@service, action, request, headers, @version)
96
+ end
97
+
98
+ def update_terminal_settings_by_store_id(request, storeId, headers: {} )
99
+ """
100
+ Update terminal settings
101
+ """
102
+ endpoint = "/stores/{storeId}/terminalSettings".gsub(/{.+?}/, '%s')
103
+ endpoint = endpoint.gsub(/^\//, "")
104
+ endpoint = endpoint % [storeId]
105
+
106
+ action = { method: "patch", url: endpoint}
107
+ @client.call_adyen_api(@service, action, request, headers, @version)
108
+ end
109
+
110
+ end
111
+ end
@@ -0,0 +1,63 @@
1
+ require_relative '../service'
2
+ module Adyen
3
+
4
+
5
+ class TerminalSettingsTerminalLevelApi < Service
6
+ attr_accessor :service, :version
7
+
8
+ def initialize(client, version = DEFAULT_VERSION)
9
+ @service = "Management"
10
+ @client = client
11
+ @version = version
12
+ end
13
+
14
+ def get_terminal_logo(terminalId, headers: {} )
15
+ """
16
+ Get the terminal logo
17
+ """
18
+ endpoint = "/terminals/{terminalId}/terminalLogos".gsub(/{.+?}/, '%s')
19
+ endpoint = endpoint.gsub(/^\//, "")
20
+ endpoint = endpoint % [terminalId]
21
+
22
+ action = { method: "get", url: endpoint}
23
+ @client.call_adyen_api(@service, action, {}, headers, @version)
24
+ end
25
+
26
+ def get_terminal_settings(terminalId, headers: {} )
27
+ """
28
+ Get terminal settings
29
+ """
30
+ endpoint = "/terminals/{terminalId}/terminalSettings".gsub(/{.+?}/, '%s')
31
+ endpoint = endpoint.gsub(/^\//, "")
32
+ endpoint = endpoint % [terminalId]
33
+
34
+ action = { method: "get", url: endpoint}
35
+ @client.call_adyen_api(@service, action, {}, headers, @version)
36
+ end
37
+
38
+ def update_logo(request, terminalId, headers: {} )
39
+ """
40
+ Update the logo
41
+ """
42
+ endpoint = "/terminals/{terminalId}/terminalLogos".gsub(/{.+?}/, '%s')
43
+ endpoint = endpoint.gsub(/^\//, "")
44
+ endpoint = endpoint % [terminalId]
45
+
46
+ action = { method: "patch", url: endpoint}
47
+ @client.call_adyen_api(@service, action, request, headers, @version)
48
+ end
49
+
50
+ def update_terminal_settings(request, terminalId, headers: {} )
51
+ """
52
+ Update terminal settings
53
+ """
54
+ endpoint = "/terminals/{terminalId}/terminalSettings".gsub(/{.+?}/, '%s')
55
+ endpoint = endpoint.gsub(/^\//, "")
56
+ endpoint = endpoint % [terminalId]
57
+
58
+ action = { method: "patch", url: endpoint}
59
+ @client.call_adyen_api(@service, action, request, headers, @version)
60
+ end
61
+
62
+ end
63
+ end
@@ -0,0 +1,27 @@
1
+ require_relative '../service'
2
+ module Adyen
3
+
4
+
5
+ class TerminalsTerminalLevelApi < Service
6
+ attr_accessor :service, :version
7
+
8
+ def initialize(client, version = DEFAULT_VERSION)
9
+ @service = "Management"
10
+ @client = client
11
+ @version = version
12
+ end
13
+
14
+ def list_terminals(headers: {} , queryParams: {})
15
+ """
16
+ Get a list of terminals
17
+ """
18
+ endpoint = "/terminals".gsub(/{.+?}/, '%s')
19
+ endpoint = endpoint.gsub(/^\//, "")
20
+ endpoint = endpoint % []
21
+ endpoint = endpoint + create_query_string(queryParams)
22
+ action = { method: "get", url: endpoint}
23
+ @client.call_adyen_api(@service, action, {}, headers, @version)
24
+ end
25
+
26
+ end
27
+ end
@@ -0,0 +1,63 @@
1
+ require_relative '../service'
2
+ module Adyen
3
+
4
+
5
+ class UsersCompanyLevelApi < Service
6
+ attr_accessor :service, :version
7
+
8
+ def initialize(client, version = DEFAULT_VERSION)
9
+ @service = "Management"
10
+ @client = client
11
+ @version = version
12
+ end
13
+
14
+ def list_users(companyId, headers: {} , queryParams: {})
15
+ """
16
+ Get a list of users
17
+ """
18
+ endpoint = "/companies/{companyId}/users".gsub(/{.+?}/, '%s')
19
+ endpoint = endpoint.gsub(/^\//, "")
20
+ endpoint = endpoint % [companyId]
21
+ endpoint = endpoint + create_query_string(queryParams)
22
+ action = { method: "get", url: endpoint}
23
+ @client.call_adyen_api(@service, action, {}, headers, @version)
24
+ end
25
+
26
+ def get_user_details(companyId, userId, headers: {} )
27
+ """
28
+ Get user details
29
+ """
30
+ endpoint = "/companies/{companyId}/users/{userId}".gsub(/{.+?}/, '%s')
31
+ endpoint = endpoint.gsub(/^\//, "")
32
+ endpoint = endpoint % [companyId,userId]
33
+
34
+ action = { method: "get", url: endpoint}
35
+ @client.call_adyen_api(@service, action, {}, headers, @version)
36
+ end
37
+
38
+ def update_user_details(request, companyId, userId, headers: {} )
39
+ """
40
+ Update user details
41
+ """
42
+ endpoint = "/companies/{companyId}/users/{userId}".gsub(/{.+?}/, '%s')
43
+ endpoint = endpoint.gsub(/^\//, "")
44
+ endpoint = endpoint % [companyId,userId]
45
+
46
+ action = { method: "patch", url: endpoint}
47
+ @client.call_adyen_api(@service, action, request, headers, @version)
48
+ end
49
+
50
+ def create_new_user(request, companyId, headers: {} )
51
+ """
52
+ Create a new user
53
+ """
54
+ endpoint = "/companies/{companyId}/users".gsub(/{.+?}/, '%s')
55
+ endpoint = endpoint.gsub(/^\//, "")
56
+ endpoint = endpoint % [companyId]
57
+
58
+ action = { method: "post", url: endpoint}
59
+ @client.call_adyen_api(@service, action, request, headers, @version)
60
+ end
61
+
62
+ end
63
+ end
@@ -0,0 +1,63 @@
1
+ require_relative '../service'
2
+ module Adyen
3
+
4
+
5
+ class UsersMerchantLevelApi < Service
6
+ attr_accessor :service, :version
7
+
8
+ def initialize(client, version = DEFAULT_VERSION)
9
+ @service = "Management"
10
+ @client = client
11
+ @version = version
12
+ end
13
+
14
+ def list_users(merchantId, headers: {} , queryParams: {})
15
+ """
16
+ Get a list of users
17
+ """
18
+ endpoint = "/merchants/{merchantId}/users".gsub(/{.+?}/, '%s')
19
+ endpoint = endpoint.gsub(/^\//, "")
20
+ endpoint = endpoint % [merchantId]
21
+ endpoint = endpoint + create_query_string(queryParams)
22
+ action = { method: "get", url: endpoint}
23
+ @client.call_adyen_api(@service, action, {}, headers, @version)
24
+ end
25
+
26
+ def get_user_details(merchantId, userId, headers: {} )
27
+ """
28
+ Get user details
29
+ """
30
+ endpoint = "/merchants/{merchantId}/users/{userId}".gsub(/{.+?}/, '%s')
31
+ endpoint = endpoint.gsub(/^\//, "")
32
+ endpoint = endpoint % [merchantId,userId]
33
+
34
+ action = { method: "get", url: endpoint}
35
+ @client.call_adyen_api(@service, action, {}, headers, @version)
36
+ end
37
+
38
+ def update_user(request, merchantId, userId, headers: {} )
39
+ """
40
+ Update a user
41
+ """
42
+ endpoint = "/merchants/{merchantId}/users/{userId}".gsub(/{.+?}/, '%s')
43
+ endpoint = endpoint.gsub(/^\//, "")
44
+ endpoint = endpoint % [merchantId,userId]
45
+
46
+ action = { method: "patch", url: endpoint}
47
+ @client.call_adyen_api(@service, action, request, headers, @version)
48
+ end
49
+
50
+ def create_new_user(request, merchantId, headers: {} )
51
+ """
52
+ Create a new user
53
+ """
54
+ endpoint = "/merchants/{merchantId}/users".gsub(/{.+?}/, '%s')
55
+ endpoint = endpoint.gsub(/^\//, "")
56
+ endpoint = endpoint % [merchantId]
57
+
58
+ action = { method: "post", url: endpoint}
59
+ @client.call_adyen_api(@service, action, request, headers, @version)
60
+ end
61
+
62
+ end
63
+ end
@@ -0,0 +1,99 @@
1
+ require_relative '../service'
2
+ module Adyen
3
+
4
+
5
+ class WebhooksCompanyLevelApi < Service
6
+ attr_accessor :service, :version
7
+
8
+ def initialize(client, version = DEFAULT_VERSION)
9
+ @service = "Management"
10
+ @client = client
11
+ @version = version
12
+ end
13
+
14
+ def remove_webhook(companyId, webhookId, headers: {} )
15
+ """
16
+ Remove a webhook
17
+ """
18
+ endpoint = "/companies/{companyId}/webhooks/{webhookId}".gsub(/{.+?}/, '%s')
19
+ endpoint = endpoint.gsub(/^\//, "")
20
+ endpoint = endpoint % [companyId,webhookId]
21
+
22
+ action = { method: "delete", url: endpoint}
23
+ @client.call_adyen_api(@service, action, {}, headers, @version)
24
+ end
25
+
26
+ def list_all_webhooks(companyId, headers: {} , queryParams: {})
27
+ """
28
+ List all webhooks
29
+ """
30
+ endpoint = "/companies/{companyId}/webhooks".gsub(/{.+?}/, '%s')
31
+ endpoint = endpoint.gsub(/^\//, "")
32
+ endpoint = endpoint % [companyId]
33
+ endpoint = endpoint + create_query_string(queryParams)
34
+ action = { method: "get", url: endpoint}
35
+ @client.call_adyen_api(@service, action, {}, headers, @version)
36
+ end
37
+
38
+ def get_webhook(companyId, webhookId, headers: {} )
39
+ """
40
+ Get a webhook
41
+ """
42
+ endpoint = "/companies/{companyId}/webhooks/{webhookId}".gsub(/{.+?}/, '%s')
43
+ endpoint = endpoint.gsub(/^\//, "")
44
+ endpoint = endpoint % [companyId,webhookId]
45
+
46
+ action = { method: "get", url: endpoint}
47
+ @client.call_adyen_api(@service, action, {}, headers, @version)
48
+ end
49
+
50
+ def update_webhook(request, companyId, webhookId, headers: {} )
51
+ """
52
+ Update a webhook
53
+ """
54
+ endpoint = "/companies/{companyId}/webhooks/{webhookId}".gsub(/{.+?}/, '%s')
55
+ endpoint = endpoint.gsub(/^\//, "")
56
+ endpoint = endpoint % [companyId,webhookId]
57
+
58
+ action = { method: "patch", url: endpoint}
59
+ @client.call_adyen_api(@service, action, request, headers, @version)
60
+ end
61
+
62
+ def set_up_webhook(request, companyId, headers: {} )
63
+ """
64
+ Set up a webhook
65
+ """
66
+ endpoint = "/companies/{companyId}/webhooks".gsub(/{.+?}/, '%s')
67
+ endpoint = endpoint.gsub(/^\//, "")
68
+ endpoint = endpoint % [companyId]
69
+
70
+ action = { method: "post", url: endpoint}
71
+ @client.call_adyen_api(@service, action, request, headers, @version)
72
+ end
73
+
74
+ def generate_hmac_key(companyId, webhookId, headers: {} )
75
+ """
76
+ Generate an HMAC key
77
+ """
78
+ endpoint = "/companies/{companyId}/webhooks/{webhookId}/generateHmac".gsub(/{.+?}/, '%s')
79
+ endpoint = endpoint.gsub(/^\//, "")
80
+ endpoint = endpoint % [companyId,webhookId]
81
+
82
+ action = { method: "post", url: endpoint}
83
+ @client.call_adyen_api(@service, action, {}, headers, @version)
84
+ end
85
+
86
+ def test_webhook(request, companyId, webhookId, headers: {} )
87
+ """
88
+ Test a webhook
89
+ """
90
+ endpoint = "/companies/{companyId}/webhooks/{webhookId}/test".gsub(/{.+?}/, '%s')
91
+ endpoint = endpoint.gsub(/^\//, "")
92
+ endpoint = endpoint % [companyId,webhookId]
93
+
94
+ action = { method: "post", url: endpoint}
95
+ @client.call_adyen_api(@service, action, request, headers, @version)
96
+ end
97
+
98
+ end
99
+ end
@@ -0,0 +1,99 @@
1
+ require_relative '../service'
2
+ module Adyen
3
+
4
+
5
+ class WebhooksMerchantLevelApi < Service
6
+ attr_accessor :service, :version
7
+
8
+ def initialize(client, version = DEFAULT_VERSION)
9
+ @service = "Management"
10
+ @client = client
11
+ @version = version
12
+ end
13
+
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]
21
+
22
+ action = { method: "delete", url: endpoint}
23
+ @client.call_adyen_api(@service, action, {}, headers, @version)
24
+ end
25
+
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}
35
+ @client.call_adyen_api(@service, action, {}, headers, @version)
36
+ end
37
+
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]
45
+
46
+ action = { method: "get", url: endpoint}
47
+ @client.call_adyen_api(@service, action, {}, headers, @version)
48
+ end
49
+
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]
57
+
58
+ action = { method: "patch", url: endpoint}
59
+ @client.call_adyen_api(@service, action, request, headers, @version)
60
+ end
61
+
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]
69
+
70
+ action = { method: "post", url: endpoint}
71
+ @client.call_adyen_api(@service, action, request, headers, @version)
72
+ end
73
+
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]
81
+
82
+ action = { method: "post", url: endpoint}
83
+ @client.call_adyen_api(@service, action, {}, headers, @version)
84
+ end
85
+
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]
93
+
94
+ action = { method: "post", url: endpoint}
95
+ @client.call_adyen_api(@service, action, request, headers, @version)
96
+ end
97
+
98
+ end
99
+ end