adyen-ruby-api-library 4.1.0 → 5.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/CODEOWNERS +1 -1
- data/.github/ISSUE_TEMPLATE/bug_report.md +27 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +23 -0
- data/.github/PULL_REQUEST_TEMPLATE.md +7 -0
- data/.github/dependabot.yml +8 -0
- data/.gitignore +2 -0
- data/README.md +72 -119
- data/docs/marketpay.html +2 -0
- data/lib/adyen-ruby-api-library.rb +3 -12
- data/lib/adyen/client.rb +49 -23
- data/lib/adyen/services/bin_lookup.rb +18 -0
- data/lib/adyen/services/checkout.rb +88 -8
- data/lib/adyen/services/{checkout_utility.rb → data_protection.rb} +4 -3
- data/lib/adyen/services/dispute.rb +20 -0
- data/lib/adyen/services/marketpay.rb +10 -7
- data/lib/adyen/services/payments.rb +15 -5
- data/lib/adyen/services/payouts.rb +3 -2
- data/lib/adyen/services/recurring.rb +3 -2
- data/lib/adyen/services/service.rb +2 -2
- data/lib/adyen/version.rb +1 -1
- data/spec/account_spec.rb +4 -1
- data/spec/bin_lookup_spec.rb +15 -0
- data/spec/checkout_spec.rb +247 -5
- data/spec/data_protection_spec.rb +14 -0
- data/spec/dispute_spec.rb +17 -0
- data/spec/fund_spec.rb +2 -1
- data/spec/mocks/requests/Account/check_account_holder.json +5 -0
- data/spec/mocks/requests/Account/delete_payout_methods.json +6 -0
- data/spec/mocks/requests/Account/delete_signatories.json +6 -0
- data/spec/mocks/requests/BinLookup/get_3ds_availability.json +4 -0
- data/spec/mocks/requests/BinLookup/get_cost_estimate.json +8 -0
- data/spec/mocks/requests/Checkout/orders.json +6 -0
- data/spec/mocks/requests/Checkout/orders_cancel.json +7 -0
- data/spec/mocks/requests/Checkout/origin_keys.json +3 -0
- data/spec/mocks/requests/Checkout/payment_methods_balance.json +9 -0
- data/spec/mocks/requests/DataProtectionService/request_subject_erasure.json +5 -0
- data/spec/mocks/requests/DisputeService/defend_dispute.json +5 -0
- data/spec/mocks/requests/DisputeService/delete_dispute_defense_document.json +5 -0
- data/spec/mocks/requests/DisputeService/retrieve_applicable_defense_reasons.json +4 -0
- data/spec/mocks/requests/DisputeService/supply_defense_document.json +11 -0
- data/spec/mocks/requests/Fund/refund_funds_transfer.json +7 -0
- data/spec/mocks/requests/Payment/donate.json +10 -0
- data/spec/mocks/requests/Payment/get_authentication_result.json +4 -0
- data/spec/mocks/requests/Payment/retrieve_3ds2_result.json +4 -0
- data/spec/mocks/requests/Payment/technical_cancel.json +4 -0
- data/spec/mocks/requests/Payment/void_pending_refund.json +4 -0
- data/spec/mocks/requests/Payout/payout.json +8 -0
- data/spec/mocks/requests/Recurring/schedule_account_updater.json +12 -0
- data/spec/mocks/responses/Account/check_account_holder.json +3 -0
- data/spec/mocks/responses/Account/delete_payout_methods.json +3 -0
- data/spec/mocks/responses/Account/delete_signatories.json +3 -0
- data/spec/mocks/responses/BinLookup/get_3ds_availability.json +8 -0
- data/spec/mocks/responses/BinLookup/get_cost_estimate.json +8 -0
- data/spec/mocks/responses/Checkout/get-payment-link.json +11 -0
- data/spec/mocks/responses/Checkout/orders.json +8 -0
- data/spec/mocks/responses/Checkout/orders_cancel.json +4 -0
- data/spec/mocks/responses/Checkout/origin_keys.json +5 -0
- data/spec/mocks/responses/Checkout/payment_methods_balance.json +3 -0
- data/spec/mocks/responses/Checkout/update-payment-link.json +11 -0
- data/spec/mocks/responses/DataProtectionService/request_subject_erasure.json +3 -0
- data/spec/mocks/responses/DisputeService/defend_dispute.json +5 -0
- data/spec/mocks/responses/DisputeService/delete_dispute_defense_document.json +5 -0
- data/spec/mocks/responses/DisputeService/retrieve_applicable_defense_reasons.json +28 -0
- data/spec/mocks/responses/DisputeService/supply_defense_document.json +5 -0
- data/spec/mocks/responses/Fund/refund_funds_transfer.json +5 -0
- data/spec/mocks/responses/Payment/donate.json +4 -0
- data/spec/mocks/responses/Payment/get_authentication_result.json +5 -0
- data/spec/mocks/responses/Payment/retrieve_3ds2_result.json +5 -0
- data/spec/mocks/responses/Payment/technical_cancel.json +3 -0
- data/spec/mocks/responses/Payment/void_pending_refund.json +3 -0
- data/spec/mocks/responses/Payout/payout.json +3 -0
- data/spec/mocks/responses/Recurring/schedule_account_updater.json +4 -0
- data/spec/payments_spec.rb +6 -1
- data/spec/payouts_spec.rb +2 -1
- data/spec/recurring_spec.rb +2 -1
- data/spec/service_spec.rb +2 -0
- data/spec/spec_helper.rb +18 -12
- metadata +60 -7
- data/spec/checkout_utility_spec.rb +0 -29
- data/spec/mocks/requests/CheckoutUtility/origin_keys.json +0 -7
- data/spec/mocks/responses/CheckoutUtility/origin_keys.json +0 -7
data/spec/payouts_spec.rb
CHANGED
@@ -11,7 +11,8 @@ RSpec.describe Adyen::Payments, service: "payouts service" do
|
|
11
11
|
["store_detail_and_submit_third_party", "resultCode", "[payout-submit-received]"],
|
12
12
|
["submit_third_party", "resultCode", "[payout-submit-received]"],
|
13
13
|
["confirm_third_party", "response", "[payout-confirm-received]"],
|
14
|
-
["decline_third_party", "response", "[payout-decline-received]"]
|
14
|
+
["decline_third_party", "response", "[payout-decline-received]"],
|
15
|
+
["payout", "resultCode", "Success"]
|
15
16
|
]
|
16
17
|
|
17
18
|
generate_tests(client, "Payout", test_sets, client.payouts)
|
data/spec/recurring_spec.rb
CHANGED
@@ -10,7 +10,8 @@ RSpec.describe Adyen::Payments, service: "recurring service" do
|
|
10
10
|
test_sets = [
|
11
11
|
["list_recurring_details", "creationDate", "2017-03-01T11:53:11+01:00"],
|
12
12
|
["disable", "response", "[detail-successfully-disabled]"],
|
13
|
-
["store_token", "result", "Success"]
|
13
|
+
["store_token", "result", "Success"],
|
14
|
+
["schedule_account_updater", "result", "Success"]
|
14
15
|
]
|
15
16
|
|
16
17
|
generate_tests(client, "Recurring", test_sets, client.recurring)
|
data/spec/service_spec.rb
CHANGED
@@ -18,7 +18,9 @@ RSpec.describe Adyen::Service do
|
|
18
18
|
expect(described_class.action_for_method_name(:decline_third_party)).to eq 'declineThirdParty'
|
19
19
|
expect(described_class.action_for_method_name(:delete_bank_accounts)).to eq 'deleteBankAccounts'
|
20
20
|
expect(described_class.action_for_method_name(:delete_shareholders)).to eq 'deleteShareholders'
|
21
|
+
expect(described_class.action_for_method_name(:delete_signatories)).to eq 'deleteSignatories'
|
21
22
|
expect(described_class.action_for_method_name(:disable)).to eq 'disable'
|
23
|
+
expect(described_class.action_for_method_name(:donate)).to eq 'donate'
|
22
24
|
expect(described_class.action_for_method_name(:get_account_holder)).to eq 'getAccountHolder'
|
23
25
|
expect(described_class.action_for_method_name(:get_tier_configuration)).to eq 'getTierConfiguration'
|
24
26
|
expect(described_class.action_for_method_name(:get_uploaded_documents)).to eq 'getUploadedDocuments'
|
data/spec/spec_helper.rb
CHANGED
@@ -18,20 +18,26 @@ def create_test(client, service, method_name, parent_object)
|
|
18
18
|
request_body = JSON.parse(json_from_file("mocks/requests/#{service}/#{method_name}.json"))
|
19
19
|
response_body = json_from_file("mocks/responses/#{service}/#{method_name}.json")
|
20
20
|
|
21
|
-
|
22
|
-
|
21
|
+
with_application_info = [
|
22
|
+
"authorise",
|
23
|
+
"authorise3d",
|
24
|
+
"authorise3ds2",
|
25
|
+
"payments",
|
26
|
+
"payment_session",
|
27
|
+
]
|
28
|
+
if with_application_info.include?(method_name)
|
23
29
|
client.add_application_info(request_body)
|
24
30
|
end
|
25
31
|
|
26
32
|
# client-generated headers
|
27
33
|
headers = {
|
28
|
-
|
34
|
+
"Content-Type".to_sym => "application/json",
|
29
35
|
}
|
30
36
|
|
31
37
|
# authentication headers
|
32
|
-
if not client.api_key.nil?
|
38
|
+
if not client.api_key.nil?
|
33
39
|
headers["x-api-key"] = client.api_key
|
34
|
-
elsif not client.ws_user.nil? and not client.ws_password.nil?
|
40
|
+
elsif not client.ws_user.nil? and not client.ws_password.nil?
|
35
41
|
auth_header = "Basic " + Base64::encode64("#{client.ws_user}:#{client.ws_password}")
|
36
42
|
headers["Authorization"] = auth_header.strip
|
37
43
|
else
|
@@ -43,12 +49,12 @@ def create_test(client, service, method_name, parent_object)
|
|
43
49
|
url = client.service_url(service, action, parent_object.version)
|
44
50
|
WebMock.stub_request(:post, url).
|
45
51
|
with(
|
46
|
-
|
47
|
-
|
48
|
-
|
52
|
+
body: request_body,
|
53
|
+
headers: headers,
|
54
|
+
).
|
49
55
|
to_return(
|
50
|
-
|
51
|
-
|
56
|
+
body: response_body,
|
57
|
+
)
|
52
58
|
result = parent_object.public_send(method_name, request_body)
|
53
59
|
|
54
60
|
# result.response is already a Ruby object (Adyen::HashWithAccessors) (rather than an unparsed JSON string)
|
@@ -86,10 +92,10 @@ def create_client(auth_type)
|
|
86
92
|
client = Adyen::Client.new
|
87
93
|
client.env = :mock
|
88
94
|
|
89
|
-
if auth_type == :basic
|
95
|
+
if auth_type == :basic
|
90
96
|
client.ws_user = "user"
|
91
97
|
client.ws_password = "password"
|
92
|
-
elsif auth_type == :api_key
|
98
|
+
elsif auth_type == :api_key
|
93
99
|
client.api_key = "api_key"
|
94
100
|
else
|
95
101
|
raise ArgumentError "Invalid auth type for test client"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: adyen-ruby-api-library
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 5.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adyen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-06-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -77,6 +77,10 @@ extensions: []
|
|
77
77
|
extra_rdoc_files: []
|
78
78
|
files:
|
79
79
|
- ".github/CODEOWNERS"
|
80
|
+
- ".github/ISSUE_TEMPLATE/bug_report.md"
|
81
|
+
- ".github/ISSUE_TEMPLATE/feature_request.md"
|
82
|
+
- ".github/PULL_REQUEST_TEMPLATE.md"
|
83
|
+
- ".github/dependabot.yml"
|
80
84
|
- ".gitignore"
|
81
85
|
- ".travis.yml"
|
82
86
|
- CODE_OF_CONDUCT.md
|
@@ -107,8 +111,10 @@ files:
|
|
107
111
|
- lib/adyen/errors.rb
|
108
112
|
- lib/adyen/hash_with_accessors.rb
|
109
113
|
- lib/adyen/result.rb
|
114
|
+
- lib/adyen/services/bin_lookup.rb
|
110
115
|
- lib/adyen/services/checkout.rb
|
111
|
-
- lib/adyen/services/
|
116
|
+
- lib/adyen/services/data_protection.rb
|
117
|
+
- lib/adyen/services/dispute.rb
|
112
118
|
- lib/adyen/services/marketpay.rb
|
113
119
|
- lib/adyen/services/payments.rb
|
114
120
|
- lib/adyen/services/payouts.rb
|
@@ -119,19 +125,24 @@ files:
|
|
119
125
|
- lib/adyen/version.rb
|
120
126
|
- renovate.json
|
121
127
|
- spec/account_spec.rb
|
128
|
+
- spec/bin_lookup_spec.rb
|
122
129
|
- spec/checkout_spec.rb
|
123
|
-
- spec/checkout_utility_spec.rb
|
124
130
|
- spec/client_spec.rb
|
131
|
+
- spec/data_protection_spec.rb
|
132
|
+
- spec/dispute_spec.rb
|
125
133
|
- spec/errors_spec.rb
|
126
134
|
- spec/fund_spec.rb
|
127
135
|
- spec/hash_with_accessors_spec.rb
|
128
136
|
- spec/hop_spec.rb
|
137
|
+
- spec/mocks/requests/Account/check_account_holder.json
|
129
138
|
- spec/mocks/requests/Account/close_account.json
|
130
139
|
- spec/mocks/requests/Account/close_account_holder.json
|
131
140
|
- spec/mocks/requests/Account/create_account.json
|
132
141
|
- spec/mocks/requests/Account/create_account_holder.json
|
133
142
|
- spec/mocks/requests/Account/delete_bank_accounts.json
|
143
|
+
- spec/mocks/requests/Account/delete_payout_methods.json
|
134
144
|
- spec/mocks/requests/Account/delete_shareholders.json
|
145
|
+
- spec/mocks/requests/Account/delete_signatories.json
|
135
146
|
- spec/mocks/requests/Account/get_account_holder.json
|
136
147
|
- spec/mocks/requests/Account/get_uploaded_documents.json
|
137
148
|
- spec/mocks/requests/Account/suspend_account_holder.json
|
@@ -140,17 +151,28 @@ files:
|
|
140
151
|
- spec/mocks/requests/Account/update_account_holder.json
|
141
152
|
- spec/mocks/requests/Account/update_account_holder_state.json
|
142
153
|
- spec/mocks/requests/Account/upload_document.json
|
154
|
+
- spec/mocks/requests/BinLookup/get_3ds_availability.json
|
155
|
+
- spec/mocks/requests/BinLookup/get_cost_estimate.json
|
156
|
+
- spec/mocks/requests/Checkout/orders.json
|
157
|
+
- spec/mocks/requests/Checkout/orders_cancel.json
|
158
|
+
- spec/mocks/requests/Checkout/origin_keys.json
|
143
159
|
- spec/mocks/requests/Checkout/payment-details.json
|
144
160
|
- spec/mocks/requests/Checkout/payment-result.json
|
145
161
|
- spec/mocks/requests/Checkout/payment_links.json
|
146
162
|
- spec/mocks/requests/Checkout/payment_methods.json
|
163
|
+
- spec/mocks/requests/Checkout/payment_methods_balance.json
|
147
164
|
- spec/mocks/requests/Checkout/payment_session.json
|
148
165
|
- spec/mocks/requests/Checkout/payments.json
|
149
166
|
- spec/mocks/requests/Checkout/verify.json
|
150
|
-
- spec/mocks/requests/
|
167
|
+
- spec/mocks/requests/DataProtectionService/request_subject_erasure.json
|
168
|
+
- spec/mocks/requests/DisputeService/defend_dispute.json
|
169
|
+
- spec/mocks/requests/DisputeService/delete_dispute_defense_document.json
|
170
|
+
- spec/mocks/requests/DisputeService/retrieve_applicable_defense_reasons.json
|
171
|
+
- spec/mocks/requests/DisputeService/supply_defense_document.json
|
151
172
|
- spec/mocks/requests/Fund/account_holder_balance.json
|
152
173
|
- spec/mocks/requests/Fund/account_holder_transaction_list.json
|
153
174
|
- spec/mocks/requests/Fund/payout_account_holder.json
|
175
|
+
- spec/mocks/requests/Fund/refund_funds_transfer.json
|
154
176
|
- spec/mocks/requests/Fund/refund_not_paid_out_transfers.json
|
155
177
|
- spec/mocks/requests/Fund/setup_beneficiary.json
|
156
178
|
- spec/mocks/requests/Fund/transfer_funds.json
|
@@ -168,24 +190,34 @@ files:
|
|
168
190
|
- spec/mocks/requests/Payment/cancel.json
|
169
191
|
- spec/mocks/requests/Payment/cancel_or_refund.json
|
170
192
|
- spec/mocks/requests/Payment/capture.json
|
193
|
+
- spec/mocks/requests/Payment/donate.json
|
194
|
+
- spec/mocks/requests/Payment/get_authentication_result.json
|
171
195
|
- spec/mocks/requests/Payment/refund.json
|
196
|
+
- spec/mocks/requests/Payment/retrieve_3ds2_result.json
|
197
|
+
- spec/mocks/requests/Payment/technical_cancel.json
|
198
|
+
- spec/mocks/requests/Payment/void_pending_refund.json
|
172
199
|
- spec/mocks/requests/Payout/confirm_third_party.json
|
173
200
|
- spec/mocks/requests/Payout/decline_third_party.json
|
201
|
+
- spec/mocks/requests/Payout/payout.json
|
174
202
|
- spec/mocks/requests/Payout/store_detail.json
|
175
203
|
- spec/mocks/requests/Payout/store_detail_and_submit_third_party.json
|
176
204
|
- spec/mocks/requests/Payout/submit_third_party.json
|
177
205
|
- spec/mocks/requests/Recurring/disable.json
|
178
206
|
- spec/mocks/requests/Recurring/list_recurring_details.json
|
207
|
+
- spec/mocks/requests/Recurring/schedule_account_updater.json
|
179
208
|
- spec/mocks/requests/Recurring/store_token.json
|
180
209
|
- spec/mocks/requests/Terminal/assign_terminals.json
|
181
210
|
- spec/mocks/requests/Terminal/find_terminal.json
|
182
211
|
- spec/mocks/requests/Terminal/get_terminals_under_account.json
|
212
|
+
- spec/mocks/responses/Account/check_account_holder.json
|
183
213
|
- spec/mocks/responses/Account/close_account.json
|
184
214
|
- spec/mocks/responses/Account/close_account_holder.json
|
185
215
|
- spec/mocks/responses/Account/create_account.json
|
186
216
|
- spec/mocks/responses/Account/create_account_holder.json
|
187
217
|
- spec/mocks/responses/Account/delete_bank_accounts.json
|
218
|
+
- spec/mocks/responses/Account/delete_payout_methods.json
|
188
219
|
- spec/mocks/responses/Account/delete_shareholders.json
|
220
|
+
- spec/mocks/responses/Account/delete_signatories.json
|
189
221
|
- spec/mocks/responses/Account/get_account_holder.json
|
190
222
|
- spec/mocks/responses/Account/get_uploaded_documents.json
|
191
223
|
- spec/mocks/responses/Account/suspend_account_holder.json
|
@@ -194,17 +226,30 @@ files:
|
|
194
226
|
- spec/mocks/responses/Account/update_account_holder.json
|
195
227
|
- spec/mocks/responses/Account/update_account_holder_state.json
|
196
228
|
- spec/mocks/responses/Account/upload_document.json
|
229
|
+
- spec/mocks/responses/BinLookup/get_3ds_availability.json
|
230
|
+
- spec/mocks/responses/BinLookup/get_cost_estimate.json
|
231
|
+
- spec/mocks/responses/Checkout/get-payment-link.json
|
232
|
+
- spec/mocks/responses/Checkout/orders.json
|
233
|
+
- spec/mocks/responses/Checkout/orders_cancel.json
|
234
|
+
- spec/mocks/responses/Checkout/origin_keys.json
|
197
235
|
- spec/mocks/responses/Checkout/payment-details.json
|
198
236
|
- spec/mocks/responses/Checkout/payment-result.json
|
199
237
|
- spec/mocks/responses/Checkout/payment_links.json
|
200
238
|
- spec/mocks/responses/Checkout/payment_methods.json
|
239
|
+
- spec/mocks/responses/Checkout/payment_methods_balance.json
|
201
240
|
- spec/mocks/responses/Checkout/payment_session.json
|
202
241
|
- spec/mocks/responses/Checkout/payments.json
|
242
|
+
- spec/mocks/responses/Checkout/update-payment-link.json
|
203
243
|
- spec/mocks/responses/Checkout/verify.json
|
204
|
-
- spec/mocks/responses/
|
244
|
+
- spec/mocks/responses/DataProtectionService/request_subject_erasure.json
|
245
|
+
- spec/mocks/responses/DisputeService/defend_dispute.json
|
246
|
+
- spec/mocks/responses/DisputeService/delete_dispute_defense_document.json
|
247
|
+
- spec/mocks/responses/DisputeService/retrieve_applicable_defense_reasons.json
|
248
|
+
- spec/mocks/responses/DisputeService/supply_defense_document.json
|
205
249
|
- spec/mocks/responses/Fund/account_holder_balance.json
|
206
250
|
- spec/mocks/responses/Fund/account_holder_transaction_list.json
|
207
251
|
- spec/mocks/responses/Fund/payout_account_holder.json
|
252
|
+
- spec/mocks/responses/Fund/refund_funds_transfer.json
|
208
253
|
- spec/mocks/responses/Fund/refund_not_paid_out_transfers.json
|
209
254
|
- spec/mocks/responses/Fund/setup_beneficiary.json
|
210
255
|
- spec/mocks/responses/Fund/transfer_funds.json
|
@@ -222,14 +267,21 @@ files:
|
|
222
267
|
- spec/mocks/responses/Payment/cancel.json
|
223
268
|
- spec/mocks/responses/Payment/cancel_or_refund.json
|
224
269
|
- spec/mocks/responses/Payment/capture.json
|
270
|
+
- spec/mocks/responses/Payment/donate.json
|
271
|
+
- spec/mocks/responses/Payment/get_authentication_result.json
|
225
272
|
- spec/mocks/responses/Payment/refund.json
|
273
|
+
- spec/mocks/responses/Payment/retrieve_3ds2_result.json
|
274
|
+
- spec/mocks/responses/Payment/technical_cancel.json
|
275
|
+
- spec/mocks/responses/Payment/void_pending_refund.json
|
226
276
|
- spec/mocks/responses/Payout/confirm_third_party.json
|
227
277
|
- spec/mocks/responses/Payout/decline_third_party.json
|
278
|
+
- spec/mocks/responses/Payout/payout.json
|
228
279
|
- spec/mocks/responses/Payout/store_detail.json
|
229
280
|
- spec/mocks/responses/Payout/store_detail_and_submit_third_party.json
|
230
281
|
- spec/mocks/responses/Payout/submit_third_party.json
|
231
282
|
- spec/mocks/responses/Recurring/disable.json
|
232
283
|
- spec/mocks/responses/Recurring/list_recurring_details.json
|
284
|
+
- spec/mocks/responses/Recurring/schedule_account_updater.json
|
233
285
|
- spec/mocks/responses/Recurring/store_token.json
|
234
286
|
- spec/mocks/responses/Terminal/assign_terminals.json
|
235
287
|
- spec/mocks/responses/Terminal/find_terminal.json
|
@@ -264,7 +316,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
264
316
|
- !ruby/object:Gem::Version
|
265
317
|
version: '0'
|
266
318
|
requirements: []
|
267
|
-
|
319
|
+
rubyforge_project:
|
320
|
+
rubygems_version: 2.7.8
|
268
321
|
signing_key:
|
269
322
|
specification_version: 4
|
270
323
|
summary: Official Adyen Ruby API Library
|
@@ -1,29 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
require "json"
|
3
|
-
|
4
|
-
# rubocop:disable Metrics/BlockLength
|
5
|
-
|
6
|
-
RSpec.describe Adyen::CheckoutUtility, service: "checkout utility" do
|
7
|
-
before(:all) do
|
8
|
-
@shared_values = {
|
9
|
-
client: create_client(:api_key),
|
10
|
-
service: "CheckoutUtility",
|
11
|
-
}
|
12
|
-
end
|
13
|
-
|
14
|
-
it "sets the correct service URL base" do
|
15
|
-
client = Adyen::Client.new(env: :test)
|
16
|
-
expect(client.service_url_base(@shared_values[:service])).to eq("https://checkout-test.adyen.com/checkout")
|
17
|
-
end
|
18
|
-
|
19
|
-
# must be created manually because every field in the response is an array
|
20
|
-
it "makes an origin_keys call" do
|
21
|
-
parsed_body = create_test(@shared_values[:client], @shared_values[:service], "origin_keys", @shared_values[:client].checkout_utility)
|
22
|
-
expect(parsed_body["originKeys"]).
|
23
|
-
to be_a Adyen::HashWithAccessors
|
24
|
-
expect(parsed_body["originKeys"]).
|
25
|
-
to be_a_kind_of Hash
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
# rubocop:enable Metrics/BlockLength
|
@@ -1,7 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"originKeys": {
|
3
|
-
"https://www.your-domain1.com": "pub.v2.7814286629520534.aHR0cHM6Ly93d3cueW91ci1kb21haW4xLmNvbQ.UEwIBmW9-c_uXo5wSEr2w8Hz8hVIpujXPHjpcEse3xI",
|
4
|
-
"https://www.your-domain3.com": "pub.v2.7814286629520534.aHR0cHM6Ly93d3cueW91ci1kb21haW4zLmNvbQ.fUvflu-YIdZSsLEH8Qqmr7ksE4ag_NYiiMXK0s6aq_4",
|
5
|
-
"https://www.your-domain2.com": "pub.v2.7814286629520534.aHR0cHM6Ly93d3cueW91ci1kb21haW4yLmNvbQ.EP6eXBJKk0t7-QIUl6e_b1qMuMHGepxG_SlUqxAYrfY"
|
6
|
-
}
|
7
|
-
}
|