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,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,224 +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 = 70
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)
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
74
-
75
- def modifications
76
- @modifications ||= Adyen::Modifications.new(@client, @version)
77
- end
78
-
79
- def stored_payment_methods
80
- @stored_payment_methods ||= Adyen::StoredPaymentMethods.new(@client, @version)
81
- end
82
- end
83
-
84
- class CheckoutDetail < Service
85
- def initialize(client, version = DEFAULT_VERSION)
86
- @service = "Checkout"
87
- @client = client
88
- @version = version
89
- end
90
-
91
- def details(request, headers = {})
92
- action = "payments/details"
93
- @client.call_adyen_api(@service, action, request, headers, @version)
94
- end
95
-
96
- def result(request, headers = {})
97
- action = "payments/result"
98
- @client.call_adyen_api(@service, action, request, headers, @version)
99
- end
26
+ def modifications_api
27
+ @modifications_api ||= Adyen::ModificationsApi.new(@client, @version)
28
+ end
100
29
 
101
- def donations(request, headers = {})
102
- action = "donations"
103
- @client.call_adyen_api(@service, action, request, headers, @version)
104
- end
30
+ def orders_api
31
+ @orders_api ||= Adyen::OrdersApi.new(@client, @version)
32
+ end
105
33
 
106
- def card_details(request, headers = {})
107
- action = "cardDetails"
108
- @client.call_adyen_api(@service, action, request, headers, @version)
109
- end
110
- end
34
+ def payment_links_api
35
+ @payment_links_api ||= Adyen::PaymentLinksApi.new(@client, @version)
36
+ end
111
37
 
112
- class CheckoutLink < Service
113
- def initialize(client, version = DEFAULT_VERSION)
114
- @service = "Checkout"
115
- @client = client
116
- @version = version
117
- end
38
+ def payments_api
39
+ @payments_api ||= Adyen::PaymentsApi.new(@client, @version)
40
+ end
118
41
 
119
- def get(linkId, headers = {})
120
- action = { method: 'get', url: "paymentLinks/" + linkId }
121
- @client.call_adyen_api(@service, action, {}, headers, @version)
122
- end
42
+ def recurring_api
43
+ @recurring_api ||= Adyen::RecurringApi.new(@client, @version)
44
+ end
123
45
 
124
- def update(linkId, request, headers = {})
125
- action = { method: 'patch', url: "paymentLinks/" + linkId }
126
- @client.call_adyen_api(@service, action, request, headers, @version)
127
- end
128
- end
129
-
130
- class CheckoutMethod < Service
131
- def initialize(client, version = DEFAULT_VERSION)
132
- @service = "Checkout"
133
- @client = client
134
- @version = version
135
- end
136
-
137
- def balance(request, headers = {})
138
- action = "paymentMethods/balance"
139
- @client.call_adyen_api(@service, action, request, headers, @version, true)
140
- end
141
- end
142
-
143
- class CheckoutOrder < Service
144
- def initialize(client, version = DEFAULT_VERSION)
145
- @service = "Checkout"
146
- @client = client
147
- @version = version
148
- end
149
-
150
- def cancel(request, headers = {})
151
- action = "orders/cancel"
152
- @client.call_adyen_api(@service, action, request, headers, @version)
153
- end
154
- end
155
-
156
- class CheckoutApplePay < Service
157
- def initialize(client, version = DEFAULT_VERSION)
158
- @service = "Checkout"
159
- @client = client
160
- @version = version
161
- end
162
-
163
- def sessions(request, headers = {})
164
- action = "applePay/sessions"
165
- @client.call_adyen_api(@service, action, request, headers, @version)
166
- end
167
- end
168
-
169
- class Modifications < Service
170
- def initialize(client, version = DEFAULT_VERSION)
171
- @service = "Checkout"
172
- @client = client
173
- @version = version
174
- end
175
-
176
- def capture(linkId, request, headers = {})
177
- action = "payments/" + linkId + "/captures"
178
- @client.call_adyen_api(@service, action, request, headers, @version)
179
- end
180
-
181
- def cancel(linkId, request, headers = {})
182
- action = "payments/" + linkId + "/cancels"
183
- @client.call_adyen_api(@service, action, request, headers, @version)
184
- end
185
-
186
- def genericCancel(request, headers = {})
187
- action = "cancels"
188
- @client.call_adyen_api(@service, action, request, headers, @version)
189
- end
190
-
191
- def refund(linkId, request, headers = {})
192
- action = "payments/" + linkId + "/refunds"
193
- @client.call_adyen_api(@service, action, request, headers, @version)
194
- end
195
-
196
- def reversal(linkId, request, headers = {})
197
- action = "payments/" + linkId + "/reversals"
198
- @client.call_adyen_api(@service, action, request, headers, @version)
199
- end
200
-
201
- def amountUpdate(linkId, request, headers = {})
202
- action = "payments/" + linkId + "/amountUpdates"
203
- @client.call_adyen_api(@service, action, request, headers, @version)
204
- end
205
- end
206
-
207
- class StoredPaymentMethods < Service
208
- def initialize(client, version = DEFAULT_VERSION)
209
- @service = "Checkout"
210
- @client = client
211
- @version = version
212
- end
213
-
214
- def get(query_array={}, headers = {})
215
- action = { method: 'get', url: "storedPaymentMethods" + create_query_string(query_array)}
216
- @client.call_adyen_api(@service, action, {}, headers, @version)
217
- end
46
+ def utility_api
47
+ @utility_api ||= Adyen::UtilityApi.new(@client, @version)
48
+ end
218
49
 
219
- def delete(recurringId, query_array={}, headers = {})
220
- action = { method: 'delete', url: "storedPaymentMethods/%s" % recurringId + create_query_string(query_array)}
221
- @client.call_adyen_api(@service, action, {}, headers, @version)
222
50
  end
223
- end
224
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
@@ -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