adyen-ruby-api-library 6.2.0 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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,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
@@ -0,0 +1,151 @@
1
+ require_relative 'management/api_credentials_company_level_api'
2
+ require_relative 'management/api_credentials_merchant_level_api'
3
+ require_relative 'management/api_key_company_level_api'
4
+ require_relative 'management/api_key_merchant_level_api'
5
+ require_relative 'management/account_company_level_api'
6
+ require_relative 'management/account_merchant_level_api'
7
+ require_relative 'management/account_store_level_api'
8
+ require_relative 'management/allowed_origins_company_level_api'
9
+ require_relative 'management/allowed_origins_merchant_level_api'
10
+ require_relative 'management/client_key_company_level_api'
11
+ require_relative 'management/client_key_merchant_level_api'
12
+ require_relative 'management/my_api_credential_api'
13
+ require_relative 'management/payment_methods_merchant_level_api'
14
+ require_relative 'management/payout_settings_merchant_level_api'
15
+ require_relative 'management/terminal_actions_company_level_api'
16
+ require_relative 'management/terminal_actions_terminal_level_api'
17
+ require_relative 'management/terminal_orders_company_level_api'
18
+ require_relative 'management/terminal_orders_merchant_level_api'
19
+ require_relative 'management/terminal_settings_company_level_api'
20
+ require_relative 'management/terminal_settings_merchant_level_api'
21
+ require_relative 'management/terminal_settings_store_level_api'
22
+ require_relative 'management/terminal_settings_terminal_level_api'
23
+ require_relative 'management/terminals_terminal_level_api'
24
+ require_relative 'management/users_company_level_api'
25
+ require_relative 'management/users_merchant_level_api'
26
+ require_relative 'management/webhooks_company_level_api'
27
+ require_relative 'management/webhooks_merchant_level_api'
28
+
29
+ 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
53
+
54
+ def api_key_merchant_level_api
55
+ @api_key_merchant_level_api ||= Adyen::APIKeyMerchantLevelApi.new(@client, @version)
56
+ end
57
+
58
+ def account_company_level_api
59
+ @account_company_level_api ||= Adyen::AccountCompanyLevelApi.new(@client, @version)
60
+ end
61
+
62
+ def account_merchant_level_api
63
+ @account_merchant_level_api ||= Adyen::AccountMerchantLevelApi.new(@client, @version)
64
+ end
65
+
66
+ def account_store_level_api
67
+ @account_store_level_api ||= Adyen::AccountStoreLevelApi.new(@client, @version)
68
+ end
69
+
70
+ def allowed_origins_company_level_api
71
+ @allowed_origins_company_level_api ||= Adyen::AllowedOriginsCompanyLevelApi.new(@client, @version)
72
+ end
73
+
74
+ def allowed_origins_merchant_level_api
75
+ @allowed_origins_merchant_level_api ||= Adyen::AllowedOriginsMerchantLevelApi.new(@client, @version)
76
+ end
77
+
78
+ def client_key_company_level_api
79
+ @client_key_company_level_api ||= Adyen::ClientKeyCompanyLevelApi.new(@client, @version)
80
+ end
81
+
82
+ def client_key_merchant_level_api
83
+ @client_key_merchant_level_api ||= Adyen::ClientKeyMerchantLevelApi.new(@client, @version)
84
+ end
85
+
86
+ def my_api_credential_api
87
+ @my_api_credential_api ||= Adyen::MyAPICredentialApi.new(@client, @version)
88
+ end
89
+
90
+ def payment_methods_merchant_level_api
91
+ @payment_methods_merchant_level_api ||= Adyen::PaymentMethodsMerchantLevelApi.new(@client, @version)
92
+ end
93
+
94
+ def payout_settings_merchant_level_api
95
+ @payout_settings_merchant_level_api ||= Adyen::PayoutSettingsMerchantLevelApi.new(@client, @version)
96
+ end
97
+
98
+ def terminal_actions_company_level_api
99
+ @terminal_actions_company_level_api ||= Adyen::TerminalActionsCompanyLevelApi.new(@client, @version)
100
+ end
101
+
102
+ def terminal_actions_terminal_level_api
103
+ @terminal_actions_terminal_level_api ||= Adyen::TerminalActionsTerminalLevelApi.new(@client, @version)
104
+ end
105
+
106
+ def terminal_orders_company_level_api
107
+ @terminal_orders_company_level_api ||= Adyen::TerminalOrdersCompanyLevelApi.new(@client, @version)
108
+ end
109
+
110
+ def terminal_orders_merchant_level_api
111
+ @terminal_orders_merchant_level_api ||= Adyen::TerminalOrdersMerchantLevelApi.new(@client, @version)
112
+ end
113
+
114
+ def terminal_settings_company_level_api
115
+ @terminal_settings_company_level_api ||= Adyen::TerminalSettingsCompanyLevelApi.new(@client, @version)
116
+ end
117
+
118
+ def terminal_settings_merchant_level_api
119
+ @terminal_settings_merchant_level_api ||= Adyen::TerminalSettingsMerchantLevelApi.new(@client, @version)
120
+ end
121
+
122
+ def terminal_settings_store_level_api
123
+ @terminal_settings_store_level_api ||= Adyen::TerminalSettingsStoreLevelApi.new(@client, @version)
124
+ end
125
+
126
+ def terminal_settings_terminal_level_api
127
+ @terminal_settings_terminal_level_api ||= Adyen::TerminalSettingsTerminalLevelApi.new(@client, @version)
128
+ end
129
+
130
+ def terminals_terminal_level_api
131
+ @terminals_terminal_level_api ||= Adyen::TerminalsTerminalLevelApi.new(@client, @version)
132
+ end
133
+
134
+ def users_company_level_api
135
+ @users_company_level_api ||= Adyen::UsersCompanyLevelApi.new(@client, @version)
136
+ end
137
+
138
+ def users_merchant_level_api
139
+ @users_merchant_level_api ||= Adyen::UsersMerchantLevelApi.new(@client, @version)
140
+ end
141
+
142
+ def webhooks_company_level_api
143
+ @webhooks_company_level_api ||= Adyen::WebhooksCompanyLevelApi.new(@client, @version)
144
+ end
145
+
146
+ def webhooks_merchant_level_api
147
+ @webhooks_merchant_level_api ||= Adyen::WebhooksMerchantLevelApi.new(@client, @version)
148
+ end
149
+
150
+ end
151
+ end
@@ -0,0 +1,172 @@
1
+ require_relative './service'
2
+ module Adyen
3
+
4
+
5
+ class Payment < Service
6
+ attr_accessor :service, :version
7
+ DEFAULT_VERSION = 68
8
+
9
+ def initialize(client, version = DEFAULT_VERSION)
10
+ @service = "Payment"
11
+ @client = client
12
+ @version = version
13
+ end
14
+
15
+ def adjust_authorisation(request, headers: {} )
16
+ """
17
+ Change the authorised amount
18
+ """
19
+ endpoint = "/adjustAuthorisation".gsub(/{.+?}/, '%s')
20
+ endpoint = endpoint.gsub(/^\//, "")
21
+ endpoint = endpoint % []
22
+
23
+ action = { method: "post", url: endpoint}
24
+ @client.call_adyen_api(@service, action, request, headers, @version)
25
+ end
26
+
27
+ def authorise(request, headers: {} )
28
+ """
29
+ Create an authorisation
30
+ """
31
+ endpoint = "/authorise".gsub(/{.+?}/, '%s')
32
+ endpoint = endpoint.gsub(/^\//, "")
33
+ endpoint = endpoint % []
34
+
35
+ action = { method: "post", url: endpoint}
36
+ @client.call_adyen_api(@service, action, request, headers, @version)
37
+ end
38
+
39
+ def authorise3d(request, headers: {} )
40
+ """
41
+ Complete a 3DS authorisation
42
+ """
43
+ endpoint = "/authorise3d".gsub(/{.+?}/, '%s')
44
+ endpoint = endpoint.gsub(/^\//, "")
45
+ endpoint = endpoint % []
46
+
47
+ action = { method: "post", url: endpoint}
48
+ @client.call_adyen_api(@service, action, request, headers, @version)
49
+ end
50
+
51
+ def authorise3ds2(request, headers: {} )
52
+ """
53
+ Complete a 3DS2 authorisation
54
+ """
55
+ endpoint = "/authorise3ds2".gsub(/{.+?}/, '%s')
56
+ endpoint = endpoint.gsub(/^\//, "")
57
+ endpoint = endpoint % []
58
+
59
+ action = { method: "post", url: endpoint}
60
+ @client.call_adyen_api(@service, action, request, headers, @version)
61
+ end
62
+
63
+ def cancel(request, headers: {} )
64
+ """
65
+ Cancel an authorisation
66
+ """
67
+ endpoint = "/cancel".gsub(/{.+?}/, '%s')
68
+ endpoint = endpoint.gsub(/^\//, "")
69
+ endpoint = endpoint % []
70
+
71
+ action = { method: "post", url: endpoint}
72
+ @client.call_adyen_api(@service, action, request, headers, @version)
73
+ end
74
+
75
+ def cancel_or_refund(request, headers: {} )
76
+ """
77
+ Cancel or refund a payment
78
+ """
79
+ endpoint = "/cancelOrRefund".gsub(/{.+?}/, '%s')
80
+ endpoint = endpoint.gsub(/^\//, "")
81
+ endpoint = endpoint % []
82
+
83
+ action = { method: "post", url: endpoint}
84
+ @client.call_adyen_api(@service, action, request, headers, @version)
85
+ end
86
+
87
+ def capture(request, headers: {} )
88
+ """
89
+ Capture an authorisation
90
+ """
91
+ endpoint = "/capture".gsub(/{.+?}/, '%s')
92
+ endpoint = endpoint.gsub(/^\//, "")
93
+ endpoint = endpoint % []
94
+
95
+ action = { method: "post", url: endpoint}
96
+ @client.call_adyen_api(@service, action, request, headers, @version)
97
+ end
98
+
99
+ def donate(request, headers: {} )
100
+ """
101
+ Create a donation
102
+ """
103
+ endpoint = "/donate".gsub(/{.+?}/, '%s')
104
+ endpoint = endpoint.gsub(/^\//, "")
105
+ endpoint = endpoint % []
106
+
107
+ action = { method: "post", url: endpoint}
108
+ @client.call_adyen_api(@service, action, request, headers, @version)
109
+ end
110
+
111
+ def get_authentication_result(request, headers: {} )
112
+ """
113
+ Get the 3DS authentication result
114
+ """
115
+ endpoint = "/getAuthenticationResult".gsub(/{.+?}/, '%s')
116
+ endpoint = endpoint.gsub(/^\//, "")
117
+ endpoint = endpoint % []
118
+
119
+ action = { method: "post", url: endpoint}
120
+ @client.call_adyen_api(@service, action, request, headers, @version)
121
+ end
122
+
123
+ def refund(request, headers: {} )
124
+ """
125
+ Refund a captured payment
126
+ """
127
+ endpoint = "/refund".gsub(/{.+?}/, '%s')
128
+ endpoint = endpoint.gsub(/^\//, "")
129
+ endpoint = endpoint % []
130
+
131
+ action = { method: "post", url: endpoint}
132
+ @client.call_adyen_api(@service, action, request, headers, @version)
133
+ end
134
+
135
+ def retrieve3ds2_result(request, headers: {} )
136
+ """
137
+ Get the 3DS2 authentication result
138
+ """
139
+ endpoint = "/retrieve3ds2Result".gsub(/{.+?}/, '%s')
140
+ endpoint = endpoint.gsub(/^\//, "")
141
+ endpoint = endpoint % []
142
+
143
+ action = { method: "post", url: endpoint}
144
+ @client.call_adyen_api(@service, action, request, headers, @version)
145
+ end
146
+
147
+ def technical_cancel(request, headers: {} )
148
+ """
149
+ Cancel an authorisation using your reference
150
+ """
151
+ endpoint = "/technicalCancel".gsub(/{.+?}/, '%s')
152
+ endpoint = endpoint.gsub(/^\//, "")
153
+ endpoint = endpoint % []
154
+
155
+ action = { method: "post", url: endpoint}
156
+ @client.call_adyen_api(@service, action, request, headers, @version)
157
+ end
158
+
159
+ def void_pending_refund(request, headers: {} )
160
+ """
161
+ Cancel an in-person refund
162
+ """
163
+ endpoint = "/voidPendingRefund".gsub(/{.+?}/, '%s')
164
+ endpoint = endpoint.gsub(/^\//, "")
165
+ endpoint = endpoint % []
166
+
167
+ action = { method: "post", url: endpoint}
168
+ @client.call_adyen_api(@service, action, request, headers, @version)
169
+ end
170
+
171
+ end
172
+ end
@@ -0,0 +1,51 @@
1
+ require_relative '../service'
2
+ module Adyen
3
+
4
+
5
+ class InitializationApi < Service
6
+ attr_accessor :service, :version
7
+
8
+ def initialize(client, version = DEFAULT_VERSION)
9
+ @service = "Payout"
10
+ @client = client
11
+ @version = version
12
+ end
13
+
14
+ def store_detail(request, headers: {} )
15
+ """
16
+ Store payout details
17
+ """
18
+ endpoint = "/storeDetail".gsub(/{.+?}/, '%s')
19
+ endpoint = endpoint.gsub(/^\//, "")
20
+ endpoint = endpoint % []
21
+
22
+ action = { method: "post", url: endpoint}
23
+ @client.call_adyen_api(@service, action, request, headers, @version)
24
+ end
25
+
26
+ def store_detail_and_submit_third_party(request, headers: {} )
27
+ """
28
+ Store details and submit a payout
29
+ """
30
+ endpoint = "/storeDetailAndSubmitThirdParty".gsub(/{.+?}/, '%s')
31
+ endpoint = endpoint.gsub(/^\//, "")
32
+ endpoint = endpoint % []
33
+
34
+ action = { method: "post", url: endpoint}
35
+ @client.call_adyen_api(@service, action, request, headers, @version)
36
+ end
37
+
38
+ def submit_third_party(request, headers: {} )
39
+ """
40
+ Submit a payout
41
+ """
42
+ endpoint = "/submitThirdParty".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
+ end
51
+ end
@@ -0,0 +1,27 @@
1
+ require_relative '../service'
2
+ module Adyen
3
+
4
+
5
+ class InstantPayoutsApi < Service
6
+ attr_accessor :service, :version
7
+
8
+ def initialize(client, version = DEFAULT_VERSION)
9
+ @service = "Payout"
10
+ @client = client
11
+ @version = version
12
+ end
13
+
14
+ def payout(request, headers: {} )
15
+ """
16
+ Make an instant card payout
17
+ """
18
+ endpoint = "/payout".gsub(/{.+?}/, '%s')
19
+ endpoint = endpoint.gsub(/^\//, "")
20
+ endpoint = endpoint % []
21
+
22
+ action = { method: "post", url: endpoint}
23
+ @client.call_adyen_api(@service, action, request, headers, @version)
24
+ end
25
+
26
+ end
27
+ end
@@ -0,0 +1,39 @@
1
+ require_relative '../service'
2
+ module Adyen
3
+
4
+
5
+ class ReviewingApi < Service
6
+ attr_accessor :service, :version
7
+
8
+ def initialize(client, version = DEFAULT_VERSION)
9
+ @service = "Payout"
10
+ @client = client
11
+ @version = version
12
+ end
13
+
14
+ def confirm_third_party(request, headers: {} )
15
+ """
16
+ Confirm a payout
17
+ """
18
+ endpoint = "/confirmThirdParty".gsub(/{.+?}/, '%s')
19
+ endpoint = endpoint.gsub(/^\//, "")
20
+ endpoint = endpoint % []
21
+
22
+ action = { method: "post", url: endpoint}
23
+ @client.call_adyen_api(@service, action, request, headers, @version)
24
+ end
25
+
26
+ def decline_third_party(request, headers: {} )
27
+ """
28
+ Cancel a payout
29
+ """
30
+ endpoint = "/declineThirdParty".gsub(/{.+?}/, '%s')
31
+ endpoint = endpoint.gsub(/^\//, "")
32
+ endpoint = endpoint % []
33
+
34
+ action = { method: "post", url: endpoint}
35
+ @client.call_adyen_api(@service, action, request, headers, @version)
36
+ end
37
+
38
+ end
39
+ end
@@ -0,0 +1,31 @@
1
+ require_relative 'payout/initialization_api'
2
+ require_relative 'payout/instant_payouts_api'
3
+ require_relative 'payout/reviewing_api'
4
+
5
+ module Adyen
6
+
7
+
8
+ class Payout
9
+ attr_accessor :service, :version
10
+
11
+ DEFAULT_VERSION = 68
12
+ def initialize(client, version = DEFAULT_VERSION)
13
+ @service = "Payout"
14
+ @client = client
15
+ @version = version
16
+ end
17
+
18
+ def initialization_api
19
+ @initialization_api ||= Adyen::InitializationApi.new(@client, @version)
20
+ end
21
+
22
+ def instant_payouts_api
23
+ @instant_payouts_api ||= Adyen::InstantPayoutsApi.new(@client, @version)
24
+ end
25
+
26
+ def reviewing_api
27
+ @reviewing_api ||= Adyen::ReviewingApi.new(@client, @version)
28
+ end
29
+
30
+ end
31
+ end