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,87 @@
1
+ require_relative '../service'
2
+ module Adyen
3
+
4
+
5
+ class PaymentsApi < Service
6
+ attr_accessor :service, :version
7
+
8
+ def initialize(client, version = DEFAULT_VERSION)
9
+ @service = "Checkout"
10
+ @client = client
11
+ @version = version
12
+ end
13
+
14
+ def card_details(request, headers: {} )
15
+ """
16
+ Get the list of brands on the card
17
+ """
18
+ endpoint = "/cardDetails".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 donations(request, headers: {} )
27
+ """
28
+ Start a transaction for donations
29
+ """
30
+ endpoint = "/donations".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 payment_methods(request, headers: {} )
39
+ """
40
+ Get a list of available payment methods
41
+ """
42
+ endpoint = "/paymentMethods".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 payments(request, headers: {} )
51
+ """
52
+ Start a transaction
53
+ """
54
+ endpoint = "/payments".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
+ def payments_details(request, headers: {} )
63
+ """
64
+ Submit details for a payment
65
+ """
66
+ endpoint = "/payments/details".gsub(/{.+?}/, '%s')
67
+ endpoint = endpoint.gsub(/^\//, "")
68
+ endpoint = endpoint % []
69
+
70
+ action = { method: "post", url: endpoint}
71
+ @client.call_adyen_api(@service, action, request, headers, @version)
72
+ end
73
+
74
+ def sessions(request, headers: {} )
75
+ """
76
+ Create a payment session
77
+ """
78
+ endpoint = "/sessions".gsub(/{.+?}/, '%s')
79
+ endpoint = endpoint.gsub(/^\//, "")
80
+ endpoint = endpoint % []
81
+
82
+ action = { method: "post", url: endpoint}
83
+ @client.call_adyen_api(@service, action, request, headers, @version)
84
+ end
85
+
86
+ end
87
+ end
@@ -0,0 +1,39 @@
1
+ require_relative '../service'
2
+ module Adyen
3
+
4
+
5
+ class RecurringApi < Service
6
+ attr_accessor :service, :version
7
+
8
+ def initialize(client, version = DEFAULT_VERSION)
9
+ @service = "Checkout"
10
+ @client = client
11
+ @version = version
12
+ end
13
+
14
+ def delete_token_for_stored_payment_details(recurringId, headers: {} , queryParams: {})
15
+ """
16
+ Delete a token for stored payment details
17
+ """
18
+ endpoint = "/storedPaymentMethods/{recurringId}".gsub(/{.+?}/, '%s')
19
+ endpoint = endpoint.gsub(/^\//, "")
20
+ endpoint = endpoint % [recurringId]
21
+ endpoint = endpoint + create_query_string(queryParams)
22
+ action = { method: "delete", url: endpoint}
23
+ @client.call_adyen_api(@service, action, {}, headers, @version)
24
+ end
25
+
26
+ def get_tokens_for_stored_payment_details(headers: {} , queryParams: {})
27
+ """
28
+ Get tokens for stored payment details
29
+ """
30
+ endpoint = "/storedPaymentMethods".gsub(/{.+?}/, '%s')
31
+ endpoint = endpoint.gsub(/^\//, "")
32
+ endpoint = endpoint % []
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
+ end
39
+ end
@@ -0,0 +1,39 @@
1
+ require_relative '../service'
2
+ module Adyen
3
+
4
+
5
+ class UtilityApi < Service
6
+ attr_accessor :service, :version
7
+
8
+ def initialize(client, version = DEFAULT_VERSION)
9
+ @service = "Checkout"
10
+ @client = client
11
+ @version = version
12
+ end
13
+
14
+ def get_apple_pay_session(request, headers: {} )
15
+ """
16
+ Get an Apple Pay session
17
+ """
18
+ endpoint = "/applePay/sessions".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 origin_keys(request, headers: {} )
27
+ """
28
+ Create originKey values for domains
29
+ """
30
+ endpoint = "/originKeys".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
@@ -1,192 +1,51 @@
1
- require_relative "service"
1
+ require_relative 'checkout/classic_checkout_sdk_api'
2
+ require_relative 'checkout/modifications_api'
3
+ require_relative 'checkout/orders_api'
4
+ require_relative 'checkout/payment_links_api'
5
+ require_relative 'checkout/payments_api'
6
+ require_relative 'checkout/recurring_api'
7
+ require_relative 'checkout/utility_api'
2
8
 
3
9
  module Adyen
4
- class Checkout < Service
5
- DEFAULT_VERSION = 68
10
+
6
11
 
7
- def initialize(client, version = DEFAULT_VERSION)
8
- service = "Checkout"
9
- method_names = [
10
- :payment_session,
11
- :origin_keys,
12
- :sessions
13
- ]
12
+ class Checkout
13
+ attr_accessor :service, :version
14
+
15
+ DEFAULT_VERSION = 70
16
+ def initialize(client, version = DEFAULT_VERSION)
17
+ @service = "Checkout"
18
+ @client = client
19
+ @version = version
20
+ end
14
21
 
15
- with_application_info = [
16
- :payment_session,
17
- ]
22
+ def classic_checkout_sdk_api
23
+ @classic_checkout_sdk_api ||= Adyen::ClassicCheckoutSDKApi.new(@client, @version)
24
+ end
18
25
 
19
- super(client, version, service, method_names, with_application_info)
20
- end
21
-
22
- # This method can't be dynamically defined because
23
- # it needs to be both a method and a class
24
- # to enable payments() and payments.detail(),
25
- # which is accomplished via an argument length checker
26
- # and the CheckoutDetail class below
27
- def payments(*args)
28
- case args.size
29
- when 0
30
- Adyen::CheckoutDetail.new(@client, @version)
31
- else
32
- action = "payments"
33
- args[1] ||= {} # optional headers arg
34
- @client.call_adyen_api(@service, action, args[0], args[1], @version, true)
35
- end
36
- end
37
-
38
- def payment_links(*args)
39
- case args.size
40
- when 0
41
- Adyen::CheckoutLink.new(@client, @version)
42
- else
43
- action = "paymentLinks"
44
- args[1] ||= {} # optional headers arg
45
- @client.call_adyen_api(@service, action, args[0], args[1], @version, true)
46
- end
47
- end
48
-
49
- def payment_methods(*args)
50
- case args.size
51
- when 0
52
- Adyen::CheckoutMethod.new(@client, @version)
53
- else
54
- action = "paymentMethods"
55
- args[1] ||= {} # optional headers arg
56
- @client.call_adyen_api(@service, action, args[0], args[1], @version)
57
- end
58
- end
59
-
60
- def orders(*args)
61
- case args.size
62
- when 0
63
- Adyen::CheckoutOrder.new(@client, @version)
64
- else
65
- action = "orders"
66
- args[1] ||= {} # optional headers arg
67
- @client.call_adyen_api(@service, action, args[0], args[1], @version)
68
- end
69
- end
70
-
71
- def apple_pay
72
- @apple_pay ||= Adyen::CheckoutApplePay.new(@client, @version)
73
- end
26
+ def modifications_api
27
+ @modifications_api ||= Adyen::ModificationsApi.new(@client, @version)
28
+ end
74
29
 
75
- def modifications
76
- @modifications ||= Adyen::Modifications.new(@client, @version)
77
- end
78
- end
79
-
80
- class CheckoutDetail < Service
81
- def initialize(client, version = DEFAULT_VERSION)
82
- @service = "Checkout"
83
- @client = client
84
- @version = version
85
- end
30
+ def orders_api
31
+ @orders_api ||= Adyen::OrdersApi.new(@client, @version)
32
+ end
86
33
 
87
- def details(request, headers = {})
88
- action = "payments/details"
89
- @client.call_adyen_api(@service, action, request, headers, @version)
90
- end
34
+ def payment_links_api
35
+ @payment_links_api ||= Adyen::PaymentLinksApi.new(@client, @version)
36
+ end
91
37
 
92
- def result(request, headers = {})
93
- action = "payments/result"
94
- @client.call_adyen_api(@service, action, request, headers, @version)
95
- end
96
- end
38
+ def payments_api
39
+ @payments_api ||= Adyen::PaymentsApi.new(@client, @version)
40
+ end
97
41
 
98
- class CheckoutLink < Service
99
- def initialize(client, version = DEFAULT_VERSION)
100
- @service = "Checkout"
101
- @client = client
102
- @version = version
103
- end
42
+ def recurring_api
43
+ @recurring_api ||= Adyen::RecurringApi.new(@client, @version)
44
+ end
104
45
 
105
- def get(linkId, headers = {})
106
- action = { method: 'get', url: "paymentLinks/" + linkId }
107
- @client.call_adyen_api(@service, action, {}, headers, @version, true)
108
- end
109
-
110
- def update(linkId, request, headers = {})
111
- action = { method: 'patch', url: "paymentLinks/" + linkId }
112
- @client.call_adyen_api(@service, action, request, headers, @version, false)
113
- end
114
- end
115
-
116
- class CheckoutMethod < Service
117
- def initialize(client, version = DEFAULT_VERSION)
118
- @service = "Checkout"
119
- @client = client
120
- @version = version
121
- end
122
-
123
- def balance(request, headers = {})
124
- action = "paymentMethods/balance"
125
- @client.call_adyen_api(@service, action, request, headers, @version, true)
126
- end
127
- end
128
-
129
- class CheckoutOrder < Service
130
- def initialize(client, version = DEFAULT_VERSION)
131
- @service = "Checkout"
132
- @client = client
133
- @version = version
134
- end
135
-
136
- def cancel(request, headers = {})
137
- action = "orders/cancel"
138
- @client.call_adyen_api(@service, action, request, headers, @version)
139
- end
140
- end
141
-
142
- class CheckoutApplePay < Service
143
- def initialize(client, version = DEFAULT_VERSION)
144
- @service = "Checkout"
145
- @client = client
146
- @version = version
147
- end
148
-
149
- def sessions(request, headers = {})
150
- action = "applePay/sessions"
151
- @client.call_adyen_api(@service, action, request, headers, @version)
152
- end
153
- end
154
-
155
- class Modifications < Service
156
- def initialize(client, version = DEFAULT_VERSION)
157
- @service = "Checkout"
158
- @client = client
159
- @version = version
160
- end
161
-
162
- def capture(linkId, request, headers = {})
163
- action = "payments/" + linkId + "/captures"
164
- @client.call_adyen_api(@service, action, request, headers, @version, false)
165
- end
166
-
167
- def cancel(linkId, request, headers = {})
168
- action = "payments/" + linkId + "/cancels"
169
- @client.call_adyen_api(@service, action, request, headers, @version, false)
170
- end
171
-
172
- def genericCancel(request, headers = {})
173
- action = "cancels"
174
- @client.call_adyen_api(@service, action, request, headers, @version)
175
- end
176
-
177
- def refund(linkId, request, headers = {})
178
- action = "payments/" + linkId + "/refunds"
179
- @client.call_adyen_api(@service, action, request, headers, @version, false)
180
- end
181
-
182
- def reversal(linkId, request, headers = {})
183
- action = "payments/" + linkId + "/reversals"
184
- @client.call_adyen_api(@service, action, request, headers, @version, false)
185
- end
46
+ def utility_api
47
+ @utility_api ||= Adyen::UtilityApi.new(@client, @version)
48
+ end
186
49
 
187
- def amountUpdate(linkId, request, headers = {})
188
- action = "payments/" + linkId + "/amountUpdates"
189
- @client.call_adyen_api(@service, action, request, headers, @version, false)
190
50
  end
191
- end
192
- end
51
+ end
@@ -0,0 +1,28 @@
1
+ require_relative './service'
2
+ module Adyen
3
+
4
+
5
+ class DataProtection < Service
6
+ attr_accessor :service, :version
7
+ DEFAULT_VERSION = 1
8
+
9
+ def initialize(client, version = DEFAULT_VERSION)
10
+ @service = "DataProtection"
11
+ @client = client
12
+ @version = version
13
+ end
14
+
15
+ def request_subject_erasure(request, headers: {} )
16
+ """
17
+ Submit a Subject Erasure Request.
18
+ """
19
+ endpoint = "/requestSubjectErasure".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
+ end
28
+ end
@@ -0,0 +1,63 @@
1
+ require_relative '../service'
2
+ module Adyen
3
+
4
+
5
+ class BusinessLinesApi < 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_business_line(id, headers: {} )
15
+ """
16
+ Delete a business line
17
+ """
18
+ endpoint = "/businessLines/{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_business_line(id, headers: {} )
27
+ """
28
+ Get a business line
29
+ """
30
+ endpoint = "/businessLines/{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_business_line(request, id, headers: {} )
39
+ """
40
+ Update a business line
41
+ """
42
+ endpoint = "/businessLines/{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_business_line(request, headers: {} )
51
+ """
52
+ Create a business line
53
+ """
54
+ endpoint = "/businessLines".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,63 @@
1
+ require_relative '../service'
2
+ module Adyen
3
+
4
+
5
+ class DocumentsApi < 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_document(id, headers: {} )
15
+ """
16
+ Delete a document
17
+ """
18
+ endpoint = "/documents/{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_document(id, headers: {} )
27
+ """
28
+ Get a document
29
+ """
30
+ endpoint = "/documents/{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_document(request, id, headers: {} )
39
+ """
40
+ Update a document
41
+ """
42
+ endpoint = "/documents/{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 upload_document_for_verification_checks(request, headers: {} )
51
+ """
52
+ Upload a document for verification checks
53
+ """
54
+ endpoint = "/documents".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 '../service'
2
+ module Adyen
3
+
4
+
5
+ class HostedOnboardingApi < 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 list_hosted_onboarding_page_themes(headers: {} )
15
+ """
16
+ Get a list of hosted onboarding page themes
17
+ """
18
+ endpoint = "/themes".gsub(/{.+?}/, '%s')
19
+ endpoint = endpoint.gsub(/^\//, "")
20
+ endpoint = endpoint % []
21
+
22
+ action = { method: "get", url: endpoint}
23
+ @client.call_adyen_api(@service, action, {}, headers, @version)
24
+ end
25
+
26
+ def get_onboarding_link_theme(id, headers: {} )
27
+ """
28
+ Get an onboarding link theme
29
+ """
30
+ endpoint = "/themes/{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 get_link_to_adyenhosted_onboarding_page(request, id, headers: {} )
39
+ """
40
+ Get a link to an Adyen-hosted onboarding page
41
+ """
42
+ endpoint = "/legalEntities/{id}/onboardingLinks".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,75 @@
1
+ require_relative '../service'
2
+ module Adyen
3
+
4
+
5
+ class LegalEntitiesApi < 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_legal_entity(id, headers: {} )
15
+ """
16
+ Get a legal entity
17
+ """
18
+ endpoint = "/legalEntities/{id}".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_all_business_lines_under_legal_entity(id, headers: {} )
27
+ """
28
+ Get all business lines under a legal entity
29
+ """
30
+ endpoint = "/legalEntities/{id}/businessLines".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_legal_entity(request, id, headers: {} )
39
+ """
40
+ Update a legal entity
41
+ """
42
+ endpoint = "/legalEntities/{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_legal_entity(request, headers: {} )
51
+ """
52
+ Create a legal entity
53
+ """
54
+ endpoint = "/legalEntities".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
+ def check_legal_entitys_verification_errors(id, headers: {} )
63
+ """
64
+ Check a legal entity's verification errors
65
+ """
66
+ endpoint = "/legalEntities/{id}/checkVerificationErrors".gsub(/{.+?}/, '%s')
67
+ endpoint = endpoint.gsub(/^\//, "")
68
+ endpoint = endpoint % [id]
69
+
70
+ action = { method: "post", url: endpoint}
71
+ @client.call_adyen_api(@service, action, {}, headers, @version)
72
+ end
73
+
74
+ end
75
+ end