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.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/Makefile +72 -0
- data/README.md +20 -18
- data/lib/adyen/client.rb +66 -38
- data/lib/adyen/services/balanceControlService.rb +28 -0
- data/lib/adyen/services/balancePlatform/account_holders_api.rb +63 -0
- data/lib/adyen/services/balancePlatform/balance_accounts_api.rb +123 -0
- data/lib/adyen/services/balancePlatform/bank_account_validation_api.rb +27 -0
- data/lib/adyen/services/balancePlatform/grant_accounts_api.rb +27 -0
- data/lib/adyen/services/balancePlatform/grant_offers_api.rb +39 -0
- data/lib/adyen/services/balancePlatform/payment_instrument_groups_api.rb +51 -0
- data/lib/adyen/services/balancePlatform/payment_instruments_api.rb +75 -0
- data/lib/adyen/services/balancePlatform/platform_api.rb +39 -0
- data/lib/adyen/services/balancePlatform/transaction_rules_api.rb +63 -0
- data/lib/adyen/services/balancePlatform.rb +61 -0
- data/lib/adyen/services/binLookup.rb +40 -0
- data/lib/adyen/services/checkout/classic_checkout_sdk_api.rb +39 -0
- data/lib/adyen/services/checkout/modifications_api.rb +87 -0
- data/lib/adyen/services/checkout/orders_api.rb +51 -0
- data/lib/adyen/services/checkout/payment_links_api.rb +51 -0
- data/lib/adyen/services/checkout/payments_api.rb +87 -0
- data/lib/adyen/services/checkout/recurring_api.rb +39 -0
- data/lib/adyen/services/checkout/utility_api.rb +39 -0
- data/lib/adyen/services/checkout.rb +38 -211
- data/lib/adyen/services/dataProtection.rb +28 -0
- data/lib/adyen/services/legalEntityManagement/business_lines_api.rb +63 -0
- data/lib/adyen/services/legalEntityManagement/documents_api.rb +63 -0
- data/lib/adyen/services/legalEntityManagement/hosted_onboarding_api.rb +51 -0
- data/lib/adyen/services/legalEntityManagement/legal_entities_api.rb +75 -0
- data/lib/adyen/services/legalEntityManagement/pci_questionnaires_api.rb +63 -0
- data/lib/adyen/services/legalEntityManagement/terms_of_service_api.rb +51 -0
- data/lib/adyen/services/legalEntityManagement/transfer_instruments_api.rb +63 -0
- data/lib/adyen/services/legalEntityManagement.rb +51 -0
- data/lib/adyen/services/management/account_company_level_api.rb +51 -0
- data/lib/adyen/services/management/account_merchant_level_api.rb +63 -0
- data/lib/adyen/services/management/account_store_level_api.rb +111 -0
- data/lib/adyen/services/management/allowed_origins_company_level_api.rb +63 -0
- data/lib/adyen/services/management/allowed_origins_merchant_level_api.rb +63 -0
- data/lib/adyen/services/management/api_credentials_company_level_api.rb +63 -0
- data/lib/adyen/services/management/api_credentials_merchant_level_api.rb +63 -0
- data/lib/adyen/services/management/api_key_company_level_api.rb +27 -0
- data/lib/adyen/services/management/api_key_merchant_level_api.rb +27 -0
- data/lib/adyen/services/management/client_key_company_level_api.rb +27 -0
- data/lib/adyen/services/management/client_key_merchant_level_api.rb +27 -0
- data/lib/adyen/services/management/my_api_credential_api.rb +75 -0
- data/lib/adyen/services/management/payment_methods_merchant_level_api.rb +87 -0
- data/lib/adyen/services/management/payout_settings_merchant_level_api.rb +75 -0
- data/lib/adyen/services/management/terminal_actions_company_level_api.rb +63 -0
- data/lib/adyen/services/management/terminal_actions_terminal_level_api.rb +27 -0
- data/lib/adyen/services/management/terminal_orders_company_level_api.rb +135 -0
- data/lib/adyen/services/management/terminal_orders_merchant_level_api.rb +135 -0
- data/lib/adyen/services/management/terminal_settings_company_level_api.rb +63 -0
- data/lib/adyen/services/management/terminal_settings_merchant_level_api.rb +63 -0
- data/lib/adyen/services/management/terminal_settings_store_level_api.rb +111 -0
- data/lib/adyen/services/management/terminal_settings_terminal_level_api.rb +63 -0
- data/lib/adyen/services/management/terminals_terminal_level_api.rb +27 -0
- data/lib/adyen/services/management/users_company_level_api.rb +63 -0
- data/lib/adyen/services/management/users_merchant_level_api.rb +63 -0
- data/lib/adyen/services/management/webhooks_company_level_api.rb +99 -0
- data/lib/adyen/services/management/webhooks_merchant_level_api.rb +99 -0
- data/lib/adyen/services/management.rb +151 -0
- data/lib/adyen/services/payment.rb +172 -0
- data/lib/adyen/services/payout/initialization_api.rb +51 -0
- data/lib/adyen/services/payout/instant_payouts_api.rb +27 -0
- data/lib/adyen/services/payout/reviewing_api.rb +39 -0
- data/lib/adyen/services/payout.rb +31 -0
- data/lib/adyen/services/posTerminalManagement.rb +76 -0
- data/lib/adyen/services/recurring.rb +81 -13
- data/lib/adyen/services/service.rb +2 -2
- data/lib/adyen/services/storedValue.rb +88 -0
- data/lib/adyen/services/transfers/transactions_api.rb +39 -0
- data/lib/adyen/services/transfers/transfers_api.rb +27 -0
- data/lib/adyen/services/transfers.rb +26 -0
- data/lib/adyen/version.rb +1 -1
- data/lib/adyen-ruby-api-library.rb +11 -5
- data/spec/account_spec.rb +1 -1
- data/spec/balance_control_spec.rb +44 -0
- data/spec/balance_platform_spec.rb +123 -0
- data/spec/bin_lookup_spec.rb +68 -10
- data/spec/checkout_spec.rb +39 -66
- data/spec/client_spec.rb +88 -9
- data/spec/fund_spec.rb +1 -1
- data/spec/hop_spec.rb +1 -1
- data/spec/lem_spec.rb +68 -0
- data/spec/management_spec.rb +68 -0
- data/spec/mocks/requests/BalanceControl/balance_transfer.json +10 -0
- data/spec/mocks/requests/BalancePlatform/create_account_holder.json +5 -0
- data/spec/mocks/requests/BalancePlatform/update_account_holder.json +10 -0
- data/spec/mocks/requests/LegalEntityManagement/create_business_line.json +15 -0
- data/spec/mocks/requests/Management/create_store.json +15 -0
- data/spec/mocks/requests/Recurring/create_permit.json +6 -0
- data/spec/mocks/requests/StoredValue/issue_giftcard.json +12 -0
- data/spec/mocks/requests/Transfers/get_transactions.json +82 -0
- data/spec/mocks/requests/Transfers/make_transfer.json +32 -0
- data/spec/mocks/responses/BalanceControl/balance_transfer.json +14 -0
- data/spec/mocks/responses/BalancePlatform/create_account_holder.json +41 -0
- data/spec/mocks/responses/BalancePlatform/get_balance_account.json +15 -0
- data/spec/mocks/responses/BalancePlatform/update_account_holder.json +16 -0
- data/spec/mocks/responses/LegalEntityManagement/create_business_line.json +17 -0
- data/spec/mocks/responses/Management/create_store.json +23 -0
- data/spec/mocks/responses/Management/get_companies.json +42 -0
- data/spec/mocks/responses/Recurring/create_permit.json +4 -0
- data/spec/mocks/responses/StoredValue/issue_giftcard.json +13 -0
- data/spec/mocks/responses/Transfers/get_transactions.json +82 -0
- data/spec/mocks/responses/Transfers/make_transfer.json +36 -0
- data/spec/notification_spec.rb +1 -1
- data/spec/payments_spec.rb +41 -23
- data/spec/payouts_spec.rb +43 -16
- data/spec/pos_terminal_management_spec.rb +46 -0
- data/spec/recurring_spec.rb +2 -2
- data/spec/spec_helper.rb +0 -10
- data/spec/stored_value_spec.rb +43 -0
- data/spec/transfers_spec.rb +63 -0
- data/templates/api-single.mustache +29 -0
- data/templates/api-small.mustache +37 -0
- data/templates/api.mustache +36 -0
- data/templates/config.yaml +10 -0
- metadata +101 -11
- data/lib/adyen/services/bin_lookup.rb +0 -18
- data/lib/adyen/services/data_protection.rb +0 -17
- data/lib/adyen/services/payments.rb +0 -34
- data/lib/adyen/services/payouts.rb +0 -22
- data/lib/adyen/services/postfmapi.rb +0 -19
- data/spec/mocks/requests/Recurring/store_token.json +0 -15
- data/spec/mocks/responses/Recurring/store_token.json +0 -7
- 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
|
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
|
-
|
5
|
-
DEFAULT_VERSION = 70
|
10
|
+
|
6
11
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
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
|
-
|
16
|
-
|
17
|
-
|
22
|
+
def classic_checkout_sdk_api
|
23
|
+
@classic_checkout_sdk_api ||= Adyen::ClassicCheckoutSDKApi.new(@client, @version)
|
24
|
+
end
|
18
25
|
|
19
|
-
|
20
|
-
|
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
|
-
|
102
|
-
|
103
|
-
|
104
|
-
end
|
30
|
+
def orders_api
|
31
|
+
@orders_api ||= Adyen::OrdersApi.new(@client, @version)
|
32
|
+
end
|
105
33
|
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
end
|
110
|
-
end
|
34
|
+
def payment_links_api
|
35
|
+
@payment_links_api ||= Adyen::PaymentLinksApi.new(@client, @version)
|
36
|
+
end
|
111
37
|
|
112
|
-
|
113
|
-
|
114
|
-
|
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
|
-
|
120
|
-
|
121
|
-
|
122
|
-
end
|
42
|
+
def recurring_api
|
43
|
+
@recurring_api ||= Adyen::RecurringApi.new(@client, @version)
|
44
|
+
end
|
123
45
|
|
124
|
-
|
125
|
-
|
126
|
-
|
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
|