adyen-ruby-api-library 6.2.0 → 7.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (140) hide show
  1. checksums.yaml +4 -4
  2. data/.github/CODEOWNERS +1 -1
  3. data/.github/workflows/codeql.yml +41 -0
  4. data/.github/workflows/ruby.yml +1 -1
  5. data/.github/workflows/rubygems_release.yml +1 -1
  6. data/.gitignore +3 -0
  7. data/Makefile +72 -0
  8. data/README.md +20 -18
  9. data/lib/adyen/client.rb +82 -42
  10. data/lib/adyen/errors.rb +2 -2
  11. data/lib/adyen/services/balanceControlService.rb +28 -0
  12. data/lib/adyen/services/balancePlatform/account_holders_api.rb +63 -0
  13. data/lib/adyen/services/balancePlatform/balance_accounts_api.rb +123 -0
  14. data/lib/adyen/services/balancePlatform/bank_account_validation_api.rb +27 -0
  15. data/lib/adyen/services/balancePlatform/grant_accounts_api.rb +27 -0
  16. data/lib/adyen/services/balancePlatform/grant_offers_api.rb +39 -0
  17. data/lib/adyen/services/balancePlatform/payment_instrument_groups_api.rb +51 -0
  18. data/lib/adyen/services/balancePlatform/payment_instruments_api.rb +75 -0
  19. data/lib/adyen/services/balancePlatform/platform_api.rb +39 -0
  20. data/lib/adyen/services/balancePlatform/transaction_rules_api.rb +63 -0
  21. data/lib/adyen/services/balancePlatform.rb +61 -0
  22. data/lib/adyen/services/binLookup.rb +40 -0
  23. data/lib/adyen/services/checkout/classic_checkout_sdk_api.rb +39 -0
  24. data/lib/adyen/services/checkout/modifications_api.rb +87 -0
  25. data/lib/adyen/services/checkout/orders_api.rb +51 -0
  26. data/lib/adyen/services/checkout/payment_links_api.rb +51 -0
  27. data/lib/adyen/services/checkout/payments_api.rb +87 -0
  28. data/lib/adyen/services/checkout/recurring_api.rb +39 -0
  29. data/lib/adyen/services/checkout/utility_api.rb +39 -0
  30. data/lib/adyen/services/checkout.rb +39 -180
  31. data/lib/adyen/services/dataProtection.rb +28 -0
  32. data/lib/adyen/services/legalEntityManagement/business_lines_api.rb +63 -0
  33. data/lib/adyen/services/legalEntityManagement/documents_api.rb +63 -0
  34. data/lib/adyen/services/legalEntityManagement/hosted_onboarding_api.rb +51 -0
  35. data/lib/adyen/services/legalEntityManagement/legal_entities_api.rb +75 -0
  36. data/lib/adyen/services/legalEntityManagement/pci_questionnaires_api.rb +63 -0
  37. data/lib/adyen/services/legalEntityManagement/terms_of_service_api.rb +51 -0
  38. data/lib/adyen/services/legalEntityManagement/transfer_instruments_api.rb +63 -0
  39. data/lib/adyen/services/legalEntityManagement.rb +51 -0
  40. data/lib/adyen/services/management/account_company_level_api.rb +51 -0
  41. data/lib/adyen/services/management/account_merchant_level_api.rb +63 -0
  42. data/lib/adyen/services/management/account_store_level_api.rb +111 -0
  43. data/lib/adyen/services/management/allowed_origins_company_level_api.rb +63 -0
  44. data/lib/adyen/services/management/allowed_origins_merchant_level_api.rb +63 -0
  45. data/lib/adyen/services/management/api_credentials_company_level_api.rb +63 -0
  46. data/lib/adyen/services/management/api_credentials_merchant_level_api.rb +63 -0
  47. data/lib/adyen/services/management/api_key_company_level_api.rb +27 -0
  48. data/lib/adyen/services/management/api_key_merchant_level_api.rb +27 -0
  49. data/lib/adyen/services/management/client_key_company_level_api.rb +27 -0
  50. data/lib/adyen/services/management/client_key_merchant_level_api.rb +27 -0
  51. data/lib/adyen/services/management/my_api_credential_api.rb +75 -0
  52. data/lib/adyen/services/management/payment_methods_merchant_level_api.rb +87 -0
  53. data/lib/adyen/services/management/payout_settings_merchant_level_api.rb +75 -0
  54. data/lib/adyen/services/management/terminal_actions_company_level_api.rb +63 -0
  55. data/lib/adyen/services/management/terminal_actions_terminal_level_api.rb +27 -0
  56. data/lib/adyen/services/management/terminal_orders_company_level_api.rb +135 -0
  57. data/lib/adyen/services/management/terminal_orders_merchant_level_api.rb +135 -0
  58. data/lib/adyen/services/management/terminal_settings_company_level_api.rb +63 -0
  59. data/lib/adyen/services/management/terminal_settings_merchant_level_api.rb +63 -0
  60. data/lib/adyen/services/management/terminal_settings_store_level_api.rb +111 -0
  61. data/lib/adyen/services/management/terminal_settings_terminal_level_api.rb +63 -0
  62. data/lib/adyen/services/management/terminals_terminal_level_api.rb +27 -0
  63. data/lib/adyen/services/management/users_company_level_api.rb +63 -0
  64. data/lib/adyen/services/management/users_merchant_level_api.rb +63 -0
  65. data/lib/adyen/services/management/webhooks_company_level_api.rb +99 -0
  66. data/lib/adyen/services/management/webhooks_merchant_level_api.rb +99 -0
  67. data/lib/adyen/services/management.rb +151 -0
  68. data/lib/adyen/services/payment.rb +172 -0
  69. data/lib/adyen/services/payout/initialization_api.rb +51 -0
  70. data/lib/adyen/services/payout/instant_payouts_api.rb +27 -0
  71. data/lib/adyen/services/payout/reviewing_api.rb +39 -0
  72. data/lib/adyen/services/payout.rb +31 -0
  73. data/lib/adyen/services/posTerminalManagement.rb +76 -0
  74. data/lib/adyen/services/recurring.rb +81 -13
  75. data/lib/adyen/services/service.rb +6 -1
  76. data/lib/adyen/services/storedValue.rb +88 -0
  77. data/lib/adyen/services/transfers/transactions_api.rb +39 -0
  78. data/lib/adyen/services/transfers/transfers_api.rb +27 -0
  79. data/lib/adyen/services/transfers.rb +26 -0
  80. data/lib/adyen/utils/hmac_validator.rb +2 -3
  81. data/lib/adyen/version.rb +2 -2
  82. data/lib/adyen-ruby-api-library.rb +11 -5
  83. data/spec/account_spec.rb +1 -1
  84. data/spec/balance_control_spec.rb +44 -0
  85. data/spec/balance_platform_spec.rb +123 -0
  86. data/spec/bin_lookup_spec.rb +68 -10
  87. data/spec/checkout_spec.rb +85 -62
  88. data/spec/client_spec.rb +89 -10
  89. data/spec/errors_spec.rb +1 -1
  90. data/spec/fund_spec.rb +1 -1
  91. data/spec/hop_spec.rb +1 -1
  92. data/spec/lem_spec.rb +68 -0
  93. data/spec/management_spec.rb +68 -0
  94. data/spec/mocks/requests/BalanceControl/balance_transfer.json +10 -0
  95. data/spec/mocks/requests/BalancePlatform/create_account_holder.json +5 -0
  96. data/spec/mocks/requests/BalancePlatform/update_account_holder.json +10 -0
  97. data/spec/mocks/requests/LegalEntityManagement/create_business_line.json +15 -0
  98. data/spec/mocks/requests/Management/create_store.json +15 -0
  99. data/spec/mocks/requests/Recurring/create_permit.json +6 -0
  100. data/spec/mocks/requests/StoredValue/issue_giftcard.json +12 -0
  101. data/spec/mocks/requests/Transfers/get_transactions.json +82 -0
  102. data/spec/mocks/requests/Transfers/make_transfer.json +32 -0
  103. data/spec/mocks/responses/BalanceControl/balance_transfer.json +14 -0
  104. data/spec/mocks/responses/BalancePlatform/create_account_holder.json +41 -0
  105. data/spec/mocks/responses/BalancePlatform/get_balance_account.json +15 -0
  106. data/spec/mocks/responses/BalancePlatform/update_account_holder.json +16 -0
  107. data/spec/mocks/responses/Checkout/stored_payment_methods.json +1 -0
  108. data/spec/mocks/responses/LegalEntityManagement/create_business_line.json +17 -0
  109. data/spec/mocks/responses/Management/create_store.json +23 -0
  110. data/spec/mocks/responses/Management/get_companies.json +42 -0
  111. data/spec/mocks/responses/Recurring/create_permit.json +4 -0
  112. data/spec/mocks/responses/StoredValue/issue_giftcard.json +13 -0
  113. data/spec/mocks/responses/Transfers/get_transactions.json +82 -0
  114. data/spec/mocks/responses/Transfers/make_transfer.json +36 -0
  115. data/spec/mocks/responses/Webhooks/backslash_notification.json +41 -0
  116. data/spec/mocks/responses/Webhooks/colon_notification.json +41 -0
  117. data/spec/mocks/responses/Webhooks/forwardslash_notification.json +41 -0
  118. data/spec/mocks/responses/Webhooks/mixed_notification.json +41 -0
  119. data/spec/notification_spec.rb +1 -1
  120. data/spec/payments_spec.rb +41 -23
  121. data/spec/payouts_spec.rb +43 -16
  122. data/spec/pos_terminal_management_spec.rb +46 -0
  123. data/spec/recurring_spec.rb +2 -2
  124. data/spec/spec_helper.rb +0 -10
  125. data/spec/stored_value_spec.rb +43 -0
  126. data/spec/transfers_spec.rb +63 -0
  127. data/spec/utils/hmac_validator_spec.rb +20 -6
  128. data/templates/api-single.mustache +29 -0
  129. data/templates/api-small.mustache +37 -0
  130. data/templates/api.mustache +36 -0
  131. data/templates/config.yaml +10 -0
  132. metadata +107 -11
  133. data/lib/adyen/services/bin_lookup.rb +0 -18
  134. data/lib/adyen/services/data_protection.rb +0 -17
  135. data/lib/adyen/services/payments.rb +0 -34
  136. data/lib/adyen/services/payouts.rb +0 -22
  137. data/lib/adyen/services/postfmapi.rb +0 -19
  138. data/spec/mocks/requests/Recurring/store_token.json +0 -15
  139. data/spec/mocks/responses/Recurring/store_token.json +0 -7
  140. data/spec/postfmapi_spec.rb +0 -16
@@ -0,0 +1,63 @@
1
+ require_relative '../service'
2
+ module Adyen
3
+
4
+
5
+ class PCIQuestionnairesApi < Service
6
+ attr_accessor :service, :version
7
+
8
+ def initialize(client, version = DEFAULT_VERSION)
9
+ @service = "LegalEntityManagement"
10
+ @client = client
11
+ @version = version
12
+ end
13
+
14
+ def get_pci_questionnaire_details(id, headers: {} )
15
+ """
16
+ Get PCI questionnaire details
17
+ """
18
+ endpoint = "/legalEntities/{id}/pciQuestionnaires".gsub(/{.+?}/, '%s')
19
+ endpoint = endpoint.gsub(/^\//, "")
20
+ endpoint = endpoint % [id]
21
+
22
+ action = { method: "get", url: endpoint}
23
+ @client.call_adyen_api(@service, action, {}, headers, @version)
24
+ end
25
+
26
+ def get_pci_questionnaire(id, pciid, headers: {} )
27
+ """
28
+ Get PCI questionnaire
29
+ """
30
+ endpoint = "/legalEntities/{id}/pciQuestionnaires/{pciid}".gsub(/{.+?}/, '%s')
31
+ endpoint = endpoint.gsub(/^\//, "")
32
+ endpoint = endpoint % [id,pciid]
33
+
34
+ action = { method: "get", url: endpoint}
35
+ @client.call_adyen_api(@service, action, {}, headers, @version)
36
+ end
37
+
38
+ def generate_pci_questionnaire(request, id, headers: {} )
39
+ """
40
+ Generate PCI questionnaire
41
+ """
42
+ endpoint = "/legalEntities/{id}/pciQuestionnaires/generatePciTemplates".gsub(/{.+?}/, '%s')
43
+ endpoint = endpoint.gsub(/^\//, "")
44
+ endpoint = endpoint % [id]
45
+
46
+ action = { method: "post", url: endpoint}
47
+ @client.call_adyen_api(@service, action, request, headers, @version)
48
+ end
49
+
50
+ def sign_pci_questionnaire(request, id, headers: {} )
51
+ """
52
+ Sign PCI questionnaire
53
+ """
54
+ endpoint = "/legalEntities/{id}/pciQuestionnaires/signPciTemplates".gsub(/{.+?}/, '%s')
55
+ endpoint = endpoint.gsub(/^\//, "")
56
+ endpoint = endpoint % [id]
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,51 @@
1
+ require_relative '../service'
2
+ module Adyen
3
+
4
+
5
+ class TermsOfServiceApi < Service
6
+ attr_accessor :service, :version
7
+
8
+ def initialize(client, version = DEFAULT_VERSION)
9
+ @service = "LegalEntityManagement"
10
+ @client = client
11
+ @version = version
12
+ end
13
+
14
+ def get_terms_of_service_information_for_legal_entity(id, headers: {} )
15
+ """
16
+ Get Terms of Service information for a legal entity
17
+ """
18
+ endpoint = "/legalEntities/{id}/termsOfServiceAcceptanceInfos".gsub(/{.+?}/, '%s')
19
+ endpoint = endpoint.gsub(/^\//, "")
20
+ endpoint = endpoint % [id]
21
+
22
+ action = { method: "get", url: endpoint}
23
+ @client.call_adyen_api(@service, action, {}, headers, @version)
24
+ end
25
+
26
+ def accept_terms_of_service(request, id, termsofservicedocumentid, headers: {} )
27
+ """
28
+ Accept Terms of Service
29
+ """
30
+ endpoint = "/legalEntities/{id}/termsOfService/{termsofservicedocumentid}".gsub(/{.+?}/, '%s')
31
+ endpoint = endpoint.gsub(/^\//, "")
32
+ endpoint = endpoint % [id,termsofservicedocumentid]
33
+
34
+ action = { method: "patch", url: endpoint}
35
+ @client.call_adyen_api(@service, action, request, headers, @version)
36
+ end
37
+
38
+ def get_terms_of_service_document(request, id, headers: {} )
39
+ """
40
+ Get Terms of Service document
41
+ """
42
+ endpoint = "/legalEntities/{id}/termsOfService".gsub(/{.+?}/, '%s')
43
+ endpoint = endpoint.gsub(/^\//, "")
44
+ endpoint = endpoint % [id]
45
+
46
+ action = { method: "post", url: endpoint}
47
+ @client.call_adyen_api(@service, action, request, headers, @version)
48
+ end
49
+
50
+ end
51
+ end
@@ -0,0 +1,63 @@
1
+ require_relative '../service'
2
+ module Adyen
3
+
4
+
5
+ class TransferInstrumentsApi < Service
6
+ attr_accessor :service, :version
7
+
8
+ def initialize(client, version = DEFAULT_VERSION)
9
+ @service = "LegalEntityManagement"
10
+ @client = client
11
+ @version = version
12
+ end
13
+
14
+ def delete_transfer_instrument(id, headers: {} )
15
+ """
16
+ Delete a transfer instrument
17
+ """
18
+ endpoint = "/transferInstruments/{id}".gsub(/{.+?}/, '%s')
19
+ endpoint = endpoint.gsub(/^\//, "")
20
+ endpoint = endpoint % [id]
21
+
22
+ action = { method: "delete", url: endpoint}
23
+ @client.call_adyen_api(@service, action, {}, headers, @version)
24
+ end
25
+
26
+ def get_transfer_instrument(id, headers: {} )
27
+ """
28
+ Get a transfer instrument
29
+ """
30
+ endpoint = "/transferInstruments/{id}".gsub(/{.+?}/, '%s')
31
+ endpoint = endpoint.gsub(/^\//, "")
32
+ endpoint = endpoint % [id]
33
+
34
+ action = { method: "get", url: endpoint}
35
+ @client.call_adyen_api(@service, action, {}, headers, @version)
36
+ end
37
+
38
+ def update_transfer_instrument(request, id, headers: {} )
39
+ """
40
+ Update a transfer instrument
41
+ """
42
+ endpoint = "/transferInstruments/{id}".gsub(/{.+?}/, '%s')
43
+ endpoint = endpoint.gsub(/^\//, "")
44
+ endpoint = endpoint % [id]
45
+
46
+ action = { method: "patch", url: endpoint}
47
+ @client.call_adyen_api(@service, action, request, headers, @version)
48
+ end
49
+
50
+ def create_transfer_instrument(request, headers: {} )
51
+ """
52
+ Create a transfer instrument
53
+ """
54
+ endpoint = "/transferInstruments".gsub(/{.+?}/, '%s')
55
+ endpoint = endpoint.gsub(/^\//, "")
56
+ endpoint = endpoint % []
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,51 @@
1
+ require_relative 'legalEntityManagement/business_lines_api'
2
+ require_relative 'legalEntityManagement/documents_api'
3
+ require_relative 'legalEntityManagement/hosted_onboarding_api'
4
+ require_relative 'legalEntityManagement/legal_entities_api'
5
+ require_relative 'legalEntityManagement/pci_questionnaires_api'
6
+ require_relative 'legalEntityManagement/terms_of_service_api'
7
+ require_relative 'legalEntityManagement/transfer_instruments_api'
8
+
9
+ module Adyen
10
+
11
+
12
+ class LegalEntityManagement
13
+ attr_accessor :service, :version
14
+
15
+ DEFAULT_VERSION = 3
16
+ def initialize(client, version = DEFAULT_VERSION)
17
+ @service = "LegalEntityManagement"
18
+ @client = client
19
+ @version = version
20
+ end
21
+
22
+ def business_lines_api
23
+ @business_lines_api ||= Adyen::BusinessLinesApi.new(@client, @version)
24
+ end
25
+
26
+ def documents_api
27
+ @documents_api ||= Adyen::DocumentsApi.new(@client, @version)
28
+ end
29
+
30
+ def hosted_onboarding_api
31
+ @hosted_onboarding_api ||= Adyen::HostedOnboardingApi.new(@client, @version)
32
+ end
33
+
34
+ def legal_entities_api
35
+ @legal_entities_api ||= Adyen::LegalEntitiesApi.new(@client, @version)
36
+ end
37
+
38
+ def pci_questionnaires_api
39
+ @pci_questionnaires_api ||= Adyen::PCIQuestionnairesApi.new(@client, @version)
40
+ end
41
+
42
+ def terms_of_service_api
43
+ @terms_of_service_api ||= Adyen::TermsOfServiceApi.new(@client, @version)
44
+ end
45
+
46
+ def transfer_instruments_api
47
+ @transfer_instruments_api ||= Adyen::TransferInstrumentsApi.new(@client, @version)
48
+ end
49
+
50
+ end
51
+ end
@@ -0,0 +1,51 @@
1
+ require_relative '../service'
2
+ module Adyen
3
+
4
+
5
+ class AccountCompanyLevelApi < 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_company_accounts(headers: {} , queryParams: {})
15
+ """
16
+ Get a list of company accounts
17
+ """
18
+ endpoint = "/companies".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
+ def get_company_account(companyId, headers: {} )
27
+ """
28
+ Get a company account
29
+ """
30
+ endpoint = "/companies/{companyId}".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 list_merchant_accounts(companyId, headers: {} , queryParams: {})
39
+ """
40
+ Get a list of merchant accounts
41
+ """
42
+ endpoint = "/companies/{companyId}/merchants".gsub(/{.+?}/, '%s')
43
+ endpoint = endpoint.gsub(/^\//, "")
44
+ endpoint = endpoint % [companyId]
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
+ end
51
+ end
@@ -0,0 +1,63 @@
1
+ require_relative '../service'
2
+ module Adyen
3
+
4
+
5
+ class AccountMerchantLevelApi < 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_merchant_accounts(headers: {} , queryParams: {})
15
+ """
16
+ Get a list of merchant accounts
17
+ """
18
+ endpoint = "/merchants".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
+ def get_merchant_account(merchantId, headers: {} )
27
+ """
28
+ Get a merchant account
29
+ """
30
+ endpoint = "/merchants/{merchantId}".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 create_merchant_account(request, headers: {} )
39
+ """
40
+ Create a merchant account
41
+ """
42
+ endpoint = "/merchants".gsub(/{.+?}/, '%s')
43
+ endpoint = endpoint.gsub(/^\//, "")
44
+ endpoint = endpoint % []
45
+
46
+ action = { method: "post", url: endpoint}
47
+ @client.call_adyen_api(@service, action, request, headers, @version)
48
+ end
49
+
50
+ def request_to_activate_merchant_account(merchantId, headers: {} )
51
+ """
52
+ Request to activate a merchant account
53
+ """
54
+ endpoint = "/merchants/{merchantId}/activate".gsub(/{.+?}/, '%s')
55
+ endpoint = endpoint.gsub(/^\//, "")
56
+ endpoint = endpoint % [merchantId]
57
+
58
+ action = { method: "post", url: endpoint}
59
+ @client.call_adyen_api(@service, action, {}, headers, @version)
60
+ end
61
+
62
+ end
63
+ end
@@ -0,0 +1,111 @@
1
+ require_relative '../service'
2
+ module Adyen
3
+
4
+
5
+ class AccountStoreLevelApi < 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_stores_by_merchant_id(merchantId, headers: {} , queryParams: {})
15
+ """
16
+ Get a list of stores
17
+ """
18
+ endpoint = "/merchants/{merchantId}/stores".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_store(merchantId, storeId, headers: {} )
27
+ """
28
+ Get a store
29
+ """
30
+ endpoint = "/merchants/{merchantId}/stores/{storeId}".gsub(/{.+?}/, '%s')
31
+ endpoint = endpoint.gsub(/^\//, "")
32
+ endpoint = endpoint % [merchantId,storeId]
33
+
34
+ action = { method: "get", url: endpoint}
35
+ @client.call_adyen_api(@service, action, {}, headers, @version)
36
+ end
37
+
38
+ def list_stores(headers: {} , queryParams: {})
39
+ """
40
+ Get a list of stores
41
+ """
42
+ endpoint = "/stores".gsub(/{.+?}/, '%s')
43
+ endpoint = endpoint.gsub(/^\//, "")
44
+ endpoint = endpoint % []
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_store_by_id(storeId, headers: {} )
51
+ """
52
+ Get a store
53
+ """
54
+ endpoint = "/stores/{storeId}".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_store(request, merchantId, storeId, headers: {} )
63
+ """
64
+ Update a store
65
+ """
66
+ endpoint = "/merchants/{merchantId}/stores/{storeId}".gsub(/{.+?}/, '%s')
67
+ endpoint = endpoint.gsub(/^\//, "")
68
+ endpoint = endpoint % [merchantId,storeId]
69
+
70
+ action = { method: "patch", url: endpoint}
71
+ @client.call_adyen_api(@service, action, request, headers, @version)
72
+ end
73
+
74
+ def update_store_by_id(request, storeId, headers: {} )
75
+ """
76
+ Update a store
77
+ """
78
+ endpoint = "/stores/{storeId}".gsub(/{.+?}/, '%s')
79
+ endpoint = endpoint.gsub(/^\//, "")
80
+ endpoint = endpoint % [storeId]
81
+
82
+ action = { method: "patch", url: endpoint}
83
+ @client.call_adyen_api(@service, action, request, headers, @version)
84
+ end
85
+
86
+ def create_store_by_merchant_id(request, merchantId, headers: {} )
87
+ """
88
+ Create a store
89
+ """
90
+ endpoint = "/merchants/{merchantId}/stores".gsub(/{.+?}/, '%s')
91
+ endpoint = endpoint.gsub(/^\//, "")
92
+ endpoint = endpoint % [merchantId]
93
+
94
+ action = { method: "post", url: endpoint}
95
+ @client.call_adyen_api(@service, action, request, headers, @version)
96
+ end
97
+
98
+ def create_store(request, headers: {} )
99
+ """
100
+ Create a store
101
+ """
102
+ endpoint = "/stores".gsub(/{.+?}/, '%s')
103
+ endpoint = endpoint.gsub(/^\//, "")
104
+ endpoint = endpoint % []
105
+
106
+ action = { method: "post", 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 AllowedOriginsCompanyLevelApi < 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 delete_allowed_origin(companyId, apiCredentialId, originId, headers: {} )
15
+ """
16
+ Delete an allowed origin
17
+ """
18
+ endpoint = "/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}".gsub(/{.+?}/, '%s')
19
+ endpoint = endpoint.gsub(/^\//, "")
20
+ endpoint = endpoint % [companyId,apiCredentialId,originId]
21
+
22
+ action = { method: "delete", url: endpoint}
23
+ @client.call_adyen_api(@service, action, {}, headers, @version)
24
+ end
25
+
26
+ def list_allowed_origins(companyId, apiCredentialId, headers: {} )
27
+ """
28
+ Get a list of allowed origins
29
+ """
30
+ endpoint = "/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins".gsub(/{.+?}/, '%s')
31
+ endpoint = endpoint.gsub(/^\//, "")
32
+ endpoint = endpoint % [companyId,apiCredentialId]
33
+
34
+ action = { method: "get", url: endpoint}
35
+ @client.call_adyen_api(@service, action, {}, headers, @version)
36
+ end
37
+
38
+ def get_allowed_origin(companyId, apiCredentialId, originId, headers: {} )
39
+ """
40
+ Get an allowed origin
41
+ """
42
+ endpoint = "/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}".gsub(/{.+?}/, '%s')
43
+ endpoint = endpoint.gsub(/^\//, "")
44
+ endpoint = endpoint % [companyId,apiCredentialId,originId]
45
+
46
+ action = { method: "get", url: endpoint}
47
+ @client.call_adyen_api(@service, action, {}, headers, @version)
48
+ end
49
+
50
+ def create_allowed_origin(request, companyId, apiCredentialId, headers: {} )
51
+ """
52
+ Create an allowed origin
53
+ """
54
+ endpoint = "/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins".gsub(/{.+?}/, '%s')
55
+ endpoint = endpoint.gsub(/^\//, "")
56
+ endpoint = endpoint % [companyId,apiCredentialId]
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 AllowedOriginsMerchantLevelApi < 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 delete_allowed_origin(merchantId, apiCredentialId, originId, headers: {} )
15
+ """
16
+ Delete an allowed origin
17
+ """
18
+ endpoint = "/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}".gsub(/{.+?}/, '%s')
19
+ endpoint = endpoint.gsub(/^\//, "")
20
+ endpoint = endpoint % [merchantId,apiCredentialId,originId]
21
+
22
+ action = { method: "delete", url: endpoint}
23
+ @client.call_adyen_api(@service, action, {}, headers, @version)
24
+ end
25
+
26
+ def list_allowed_origins(merchantId, apiCredentialId, headers: {} )
27
+ """
28
+ Get a list of allowed origins
29
+ """
30
+ endpoint = "/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins".gsub(/{.+?}/, '%s')
31
+ endpoint = endpoint.gsub(/^\//, "")
32
+ endpoint = endpoint % [merchantId,apiCredentialId]
33
+
34
+ action = { method: "get", url: endpoint}
35
+ @client.call_adyen_api(@service, action, {}, headers, @version)
36
+ end
37
+
38
+ def get_allowed_origin(merchantId, apiCredentialId, originId, headers: {} )
39
+ """
40
+ Get an allowed origin
41
+ """
42
+ endpoint = "/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}".gsub(/{.+?}/, '%s')
43
+ endpoint = endpoint.gsub(/^\//, "")
44
+ endpoint = endpoint % [merchantId,apiCredentialId,originId]
45
+
46
+ action = { method: "get", url: endpoint}
47
+ @client.call_adyen_api(@service, action, {}, headers, @version)
48
+ end
49
+
50
+ def create_allowed_origin(request, merchantId, apiCredentialId, headers: {} )
51
+ """
52
+ Create an allowed origin
53
+ """
54
+ endpoint = "/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins".gsub(/{.+?}/, '%s')
55
+ endpoint = endpoint.gsub(/^\//, "")
56
+ endpoint = endpoint % [merchantId,apiCredentialId]
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 APICredentialsCompanyLevelApi < 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_api_credentials(companyId, headers: {} , queryParams: {})
15
+ """
16
+ Get a list of API credentials
17
+ """
18
+ endpoint = "/companies/{companyId}/apiCredentials".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_api_credential(companyId, apiCredentialId, headers: {} )
27
+ """
28
+ Get an API credential
29
+ """
30
+ endpoint = "/companies/{companyId}/apiCredentials/{apiCredentialId}".gsub(/{.+?}/, '%s')
31
+ endpoint = endpoint.gsub(/^\//, "")
32
+ endpoint = endpoint % [companyId,apiCredentialId]
33
+
34
+ action = { method: "get", url: endpoint}
35
+ @client.call_adyen_api(@service, action, {}, headers, @version)
36
+ end
37
+
38
+ def update_api_credential(request, companyId, apiCredentialId, headers: {} )
39
+ """
40
+ Update an API credential.
41
+ """
42
+ endpoint = "/companies/{companyId}/apiCredentials/{apiCredentialId}".gsub(/{.+?}/, '%s')
43
+ endpoint = endpoint.gsub(/^\//, "")
44
+ endpoint = endpoint % [companyId,apiCredentialId]
45
+
46
+ action = { method: "patch", url: endpoint}
47
+ @client.call_adyen_api(@service, action, request, headers, @version)
48
+ end
49
+
50
+ def create_api_credential(request, companyId, headers: {} )
51
+ """
52
+ Create an API credential.
53
+ """
54
+ endpoint = "/companies/{companyId}/apiCredentials".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