blockchyp 2.9.6 → 2.10.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.
- checksums.yaml +4 -4
- data/Makefile +1 -8
- data/README.md +479 -2442
- data/lib/blockchyp/version.rb +1 -1
- data/lib/blockchyp.rb +3 -217
- data/lib/blockchyp_client.rb +0 -78
- data/test/batch_history_test.rb +6 -10
- data/test/boolean_prompt_test.rb +4 -10
- data/test/cancel_payment_link_test.rb +7 -11
- data/test/capture_signature_test.rb +4 -10
- data/test/delete_customer_test.rb +6 -10
- data/test/delete_token_test.rb +7 -16
- data/test/gateway_timeout_test.rb +3 -10
- data/test/get_customer_test.rb +6 -10
- data/test/merchant_profile_test.rb +5 -10
- data/test/new_transaction_display_test.rb +4 -10
- data/test/pan_charge_test.rb +4 -10
- data/test/pan_enroll_test.rb +5 -16
- data/test/pan_preauth_test.rb +4 -10
- data/test/partial_refund_test.rb +5 -10
- data/test/search_customer_test.rb +6 -10
- data/test/send_payment_link_test.rb +6 -11
- data/test/simple_batch_close_test.rb +6 -10
- data/test/simple_capture_test.rb +6 -10
- data/test/simple_gift_activate_test.rb +4 -10
- data/test/simple_message_test.rb +4 -10
- data/test/simple_ping_test.rb +5 -11
- data/test/simple_refund_test.rb +5 -10
- data/test/simple_reversal_test.rb +6 -10
- data/test/simple_void_test.rb +6 -10
- data/test/terminal_charge_test.rb +5 -11
- data/test/terminal_clear_test.rb +4 -10
- data/test/terminal_ebt_balance_test.rb +4 -10
- data/test/terminal_ebt_charge_test.rb +4 -10
- data/test/terminal_enroll_test.rb +4 -10
- data/test/terminal_gift_card_balance_test.rb +4 -10
- data/test/terminal_keyed_charge_test.rb +4 -10
- data/test/terminal_manual_ebt_charge_test.rb +4 -10
- data/test/terminal_preauth_test.rb +4 -10
- data/test/terminal_status_test.rb +4 -10
- data/test/terminal_timeout_test.rb +3 -10
- data/test/terms_and_conditions_test.rb +4 -10
- data/test/test_helper.rb +2 -0
- data/test/text_prompt_test.rb +4 -10
- data/test/transaction_history_test.rb +6 -10
- data/test/update_customer_test.rb +5 -10
- data/test/update_transaction_display_test.rb +4 -10
- metadata +2 -46
- data/test/activate_terminal_test.rb +0 -45
- data/test/add_test_merchant_test.rb +0 -56
- data/test/deactivate_terminal_test.rb +0 -42
- data/test/delete_branding_asset_test.rb +0 -50
- data/test/delete_media_asset_test.rb +0 -53
- data/test/delete_queued_transaction_test.rb +0 -56
- data/test/delete_slide_show_test.rb +0 -50
- data/test/delete_survey_question_test.rb +0 -51
- data/test/delete_test_merchant_test.rb +0 -59
- data/test/empty_branding_asset_test.rb +0 -44
- data/test/empty_slide_show_test.rb +0 -45
- data/test/get_merchants_test.rb +0 -52
- data/test/invite_merchant_user_test.rb +0 -45
- data/test/link_token_test.rb +0 -56
- data/test/list_queued_transactions_test.rb +0 -55
- data/test/list_terminals_test.rb +0 -42
- data/test/media_asset_test.rb +0 -57
- data/test/media_test.rb +0 -42
- data/test/media_upload_test.rb +0 -52
- data/test/merchant_platforms_test.rb +0 -59
- data/test/merchant_users_test.rb +0 -42
- data/test/simple_locate_test.rb +0 -44
- data/test/slide_show_test.rb +0 -51
- data/test/slide_shows_test.rb +0 -49
- data/test/survey_question_test.rb +0 -48
- data/test/survey_questions_test.rb +0 -50
- data/test/survey_results_test.rb +0 -48
- data/test/tc_delete_template_test.rb +0 -51
- data/test/tc_entry_test.rb +0 -56
- data/test/tc_log_test.rb +0 -42
- data/test/tc_template_test.rb +0 -53
- data/test/tc_template_update_test.rb +0 -48
- data/test/tc_templates_test.rb +0 -42
- data/test/terminal_branding_test.rb +0 -42
- data/test/terminal_queued_transaction_test.rb +0 -51
- data/test/testdata/aviato.png +0 -0
- data/test/token_metadata_test.rb +0 -55
- data/test/unlink_token_test.rb +0 -56
- data/test/update_branding_asset_test.rb +0 -62
- data/test/update_merchant_platforms_test.rb +0 -61
- data/test/update_merchant_test.rb +0 -60
- data/test/update_slide_show_test.rb +0 -60
- data/test/update_survey_question_test.rb +0 -47
- data/test/upload_status_test.rb +0 -53
data/lib/blockchyp/version.rb
CHANGED
data/lib/blockchyp.rb
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright 2019
|
|
3
|
+
# Copyright 2019 BlockChyp, Inc. All rights reserved. Use of this code is
|
|
4
4
|
# governed by a license that can be found in the LICENSE file.
|
|
5
5
|
#
|
|
6
|
-
# This file was generated automatically
|
|
7
|
-
#
|
|
6
|
+
# This file was generated automatically. Changes to this file will be lost
|
|
7
|
+
# every time the code is regenerated.
|
|
8
8
|
|
|
9
9
|
require_relative 'blockchyp_client'
|
|
10
10
|
|
|
@@ -13,7 +13,6 @@ module CardType
|
|
|
13
13
|
DEBIT = 1
|
|
14
14
|
EBT = 2
|
|
15
15
|
BLOCKCHAIN_GIFT = 3
|
|
16
|
-
HEALTHCARE = 4
|
|
17
16
|
end
|
|
18
17
|
|
|
19
18
|
module SignatureFormat
|
|
@@ -51,14 +50,6 @@ module CVMType
|
|
|
51
50
|
NO_CVM = 'No CVM'
|
|
52
51
|
end
|
|
53
52
|
|
|
54
|
-
module HealthcareType
|
|
55
|
-
HEALTHCARE = 'healthcare'
|
|
56
|
-
PRESCRIPTION = 'prescription'
|
|
57
|
-
VISION = 'vision'
|
|
58
|
-
CLINIC = 'clinic'
|
|
59
|
-
DENTAL = 'dental'
|
|
60
|
-
end
|
|
61
|
-
|
|
62
53
|
module BlockChyp
|
|
63
54
|
# the main autogenerated blockchyp client
|
|
64
55
|
class BlockChyp < BlockChypClient
|
|
@@ -158,17 +149,7 @@ module BlockChyp
|
|
|
158
149
|
def delete_queued_transaction(request)
|
|
159
150
|
route_terminal_request('POST', '/api/queue/delete', '/api/queue/delete', request)
|
|
160
151
|
end
|
|
161
|
-
|
|
162
|
-
# Reboot a payment terminal.
|
|
163
|
-
def reboot(request)
|
|
164
|
-
route_terminal_request('POST', '/api/reboot', '/api/terminal-reboot', request)
|
|
165
|
-
end
|
|
166
152
|
|
|
167
|
-
# Returns routing and location data for a payment terminal.
|
|
168
|
-
def locate(request)
|
|
169
|
-
gateway_request('POST', '/api/terminal-locate', request)
|
|
170
|
-
end
|
|
171
|
-
|
|
172
153
|
# Captures a preauthorization.
|
|
173
154
|
def capture(request)
|
|
174
155
|
gateway_request('POST', '/api/capture', request)
|
|
@@ -258,205 +239,10 @@ module BlockChyp
|
|
|
258
239
|
gateway_request('DELETE', '/api/customer/' + request[:customerId], request)
|
|
259
240
|
end
|
|
260
241
|
|
|
261
|
-
# Retrieves payment token metadata.
|
|
262
|
-
def token_metadata(request)
|
|
263
|
-
gateway_request('GET', '/api/token/' + request[:token], request)
|
|
264
|
-
end
|
|
265
|
-
|
|
266
|
-
# Links a token to a customer record.
|
|
267
|
-
def link_token(request)
|
|
268
|
-
gateway_request('POST', '/api/link-token', request)
|
|
269
|
-
end
|
|
270
|
-
|
|
271
|
-
# Removes a link between a customer and a token.
|
|
272
|
-
def unlink_token(request)
|
|
273
|
-
gateway_request('POST', '/api/unlink-token', request)
|
|
274
|
-
end
|
|
275
|
-
|
|
276
242
|
# Deletes a payment token.
|
|
277
243
|
def delete_token(request)
|
|
278
244
|
gateway_request('DELETE', '/api/token/' + request[:token], request)
|
|
279
245
|
end
|
|
280
246
|
|
|
281
|
-
|
|
282
|
-
# Adds a test merchant account.
|
|
283
|
-
def get_merchants(request)
|
|
284
|
-
dashboard_request('POST', '/api/get-merchants', request)
|
|
285
|
-
end
|
|
286
|
-
|
|
287
|
-
# Adds or updates a merchant account. Can be used to create or update test
|
|
288
|
-
# merchants. Only gateway partners may create new live merchants.
|
|
289
|
-
def update_merchant(request)
|
|
290
|
-
dashboard_request('POST', '/api/update-merchant', request)
|
|
291
|
-
end
|
|
292
|
-
|
|
293
|
-
# List all active users and pending invites for a merchant account.
|
|
294
|
-
def merchant_users(request)
|
|
295
|
-
dashboard_request('POST', '/api/merchant-users', request)
|
|
296
|
-
end
|
|
297
|
-
|
|
298
|
-
# Invites a user to join a merchant account.
|
|
299
|
-
def invite_merchant_user(request)
|
|
300
|
-
dashboard_request('POST', '/api/invite-merchant-user', request)
|
|
301
|
-
end
|
|
302
|
-
|
|
303
|
-
# Adds a test merchant account.
|
|
304
|
-
def add_test_merchant(request)
|
|
305
|
-
dashboard_request('POST', '/api/add-test-merchant', request)
|
|
306
|
-
end
|
|
307
|
-
|
|
308
|
-
# Deletes a test merchant account. Supports partner scoped API credentials
|
|
309
|
-
# only. Live merchant accounts cannot be deleted.
|
|
310
|
-
def delete_test_merchant(request)
|
|
311
|
-
dashboard_request('DELETE', '/api/test-merchant/' + request[:merchantId], request)
|
|
312
|
-
end
|
|
313
|
-
|
|
314
|
-
# List all merchant platforms configured for a gateway merchant.
|
|
315
|
-
def merchant_platforms(request)
|
|
316
|
-
dashboard_request('GET', '/api/plugin-configs/' + request[:merchantId], request)
|
|
317
|
-
end
|
|
318
|
-
|
|
319
|
-
# List all merchant platforms configured for a gateway merchant.
|
|
320
|
-
def update_merchant_platforms(request)
|
|
321
|
-
dashboard_request('POST', '/api/plugin-configs', request)
|
|
322
|
-
end
|
|
323
|
-
|
|
324
|
-
# Deletes a boarding platform configuration.
|
|
325
|
-
def delete_merchant_platforms(request)
|
|
326
|
-
dashboard_request('DELETE', '/api/plugin-config/' + request[:platformId], request)
|
|
327
|
-
end
|
|
328
|
-
|
|
329
|
-
# Returns all terminals associated with the merchant account.
|
|
330
|
-
def terminals(request)
|
|
331
|
-
dashboard_request('GET', '/api/terminals', request)
|
|
332
|
-
end
|
|
333
|
-
|
|
334
|
-
# Deactivates a terminal.
|
|
335
|
-
def deactivate_terminal(request)
|
|
336
|
-
dashboard_request('DELETE', '/api/terminal/' + request[:terminalId], request)
|
|
337
|
-
end
|
|
338
|
-
|
|
339
|
-
# Activates a terminal.
|
|
340
|
-
def activate_terminal(request)
|
|
341
|
-
dashboard_request('POST', '/api/terminal-activate', request)
|
|
342
|
-
end
|
|
343
|
-
|
|
344
|
-
# Returns a list of terms and conditions templates associated with a
|
|
345
|
-
# merchant account.
|
|
346
|
-
def tc_templates(request)
|
|
347
|
-
dashboard_request('GET', '/api/tc-templates', request)
|
|
348
|
-
end
|
|
349
|
-
|
|
350
|
-
# Returns a single terms and conditions template.
|
|
351
|
-
def tc_template(request)
|
|
352
|
-
dashboard_request('GET', '/api/tc-templates/' + request[:templateId], request)
|
|
353
|
-
end
|
|
354
|
-
|
|
355
|
-
# Updates or creates a terms and conditions template.
|
|
356
|
-
def tc_update_template(request)
|
|
357
|
-
dashboard_request('POST', '/api/tc-templates', request)
|
|
358
|
-
end
|
|
359
|
-
|
|
360
|
-
# Deletes a single terms and conditions template.
|
|
361
|
-
def tc_delete_template(request)
|
|
362
|
-
dashboard_request('DELETE', '/api/tc-templates/' + request[:templateId], request)
|
|
363
|
-
end
|
|
364
|
-
|
|
365
|
-
# Returns up to 250 entries from the Terms and Conditions log.
|
|
366
|
-
def tc_log(request)
|
|
367
|
-
dashboard_request('POST', '/api/tc-log', request)
|
|
368
|
-
end
|
|
369
|
-
|
|
370
|
-
# Returns a single detailed Terms and Conditions entry.
|
|
371
|
-
def tc_entry(request)
|
|
372
|
-
dashboard_request('GET', '/api/tc-entry/' + request[:logEntryId], request)
|
|
373
|
-
end
|
|
374
|
-
|
|
375
|
-
# Returns all survey questions for a given merchant.
|
|
376
|
-
def survey_questions(request)
|
|
377
|
-
dashboard_request('GET', '/api/survey-questions', request)
|
|
378
|
-
end
|
|
379
|
-
|
|
380
|
-
# Returns a single survey question with response data.
|
|
381
|
-
def survey_question(request)
|
|
382
|
-
dashboard_request('GET', '/api/survey-questions/' + request[:questionId], request)
|
|
383
|
-
end
|
|
384
|
-
|
|
385
|
-
# Updates or creates a survey question.
|
|
386
|
-
def update_survey_question(request)
|
|
387
|
-
dashboard_request('POST', '/api/survey-questions', request)
|
|
388
|
-
end
|
|
389
|
-
|
|
390
|
-
# Deletes a survey question.
|
|
391
|
-
def delete_survey_question(request)
|
|
392
|
-
dashboard_request('DELETE', '/api/survey-questions/' + request[:questionId], request)
|
|
393
|
-
end
|
|
394
|
-
|
|
395
|
-
# Returns results for a single survey question.
|
|
396
|
-
def survey_results(request)
|
|
397
|
-
dashboard_request('POST', '/api/survey-results', request)
|
|
398
|
-
end
|
|
399
|
-
|
|
400
|
-
# Returns the media library for a given partner, merchant, or
|
|
401
|
-
# organization.
|
|
402
|
-
def media(request)
|
|
403
|
-
dashboard_request('GET', '/api/media', request)
|
|
404
|
-
end
|
|
405
|
-
|
|
406
|
-
# Uploads a media asset to the media library.
|
|
407
|
-
def upload_media(request, file)
|
|
408
|
-
upload_request('/api/upload-media', request, file)
|
|
409
|
-
end
|
|
410
|
-
|
|
411
|
-
# Retrieves the current status of a file upload.
|
|
412
|
-
def upload_status(request)
|
|
413
|
-
dashboard_request('GET', '/api/media-upload/' + request[:uploadId], request)
|
|
414
|
-
end
|
|
415
|
-
|
|
416
|
-
# Returns the media details for a single media asset.
|
|
417
|
-
def media_asset(request)
|
|
418
|
-
dashboard_request('GET', '/api/media/' + request[:mediaId], request)
|
|
419
|
-
end
|
|
420
|
-
|
|
421
|
-
# Deletes a media asset.
|
|
422
|
-
def delete_media_asset(request)
|
|
423
|
-
dashboard_request('DELETE', '/api/media/' + request[:mediaId], request)
|
|
424
|
-
end
|
|
425
|
-
|
|
426
|
-
# Returns a collection of slide shows.
|
|
427
|
-
def slide_shows(request)
|
|
428
|
-
dashboard_request('GET', '/api/slide-shows', request)
|
|
429
|
-
end
|
|
430
|
-
|
|
431
|
-
# Returns a single slide show with slides.
|
|
432
|
-
def slide_show(request)
|
|
433
|
-
dashboard_request('GET', '/api/slide-shows/' + request[:slideShowId], request)
|
|
434
|
-
end
|
|
435
|
-
|
|
436
|
-
# Updates or creates a slide show.
|
|
437
|
-
def update_slide_show(request)
|
|
438
|
-
dashboard_request('POST', '/api/slide-shows', request)
|
|
439
|
-
end
|
|
440
|
-
|
|
441
|
-
# Deletes a single slide show.
|
|
442
|
-
def delete_slide_show(request)
|
|
443
|
-
dashboard_request('DELETE', '/api/slide-shows/' + request[:slideShowId], request)
|
|
444
|
-
end
|
|
445
|
-
|
|
446
|
-
# Returns the terminal branding stack for a given set of API credentials.
|
|
447
|
-
def terminal_branding(request)
|
|
448
|
-
dashboard_request('GET', '/api/terminal-branding', request)
|
|
449
|
-
end
|
|
450
|
-
|
|
451
|
-
# Updates a branding asset.
|
|
452
|
-
def update_branding_asset(request)
|
|
453
|
-
dashboard_request('POST', '/api/terminal-branding', request)
|
|
454
|
-
end
|
|
455
|
-
|
|
456
|
-
# Deletes a branding asset.
|
|
457
|
-
def delete_branding_asset(request)
|
|
458
|
-
dashboard_request('DELETE', '/api/terminal-branding/' + request[:assetId], request)
|
|
459
|
-
end
|
|
460
|
-
|
|
461
247
|
end
|
|
462
248
|
end
|
data/lib/blockchyp_client.rb
CHANGED
|
@@ -21,7 +21,6 @@ module BlockChyp
|
|
|
21
21
|
@signing_key = signing_key
|
|
22
22
|
@gateway_host = 'https://api.blockchyp.com'
|
|
23
23
|
@test_gateway_host = 'https://test.blockchyp.com'
|
|
24
|
-
@dashboard_host = 'https://dashboard.blockchyp.com'
|
|
25
24
|
@https = false
|
|
26
25
|
@route_cache_location = File.join(Dir.tmpdir, '.blockchyp_route')
|
|
27
26
|
@route_cache_ttl = 60
|
|
@@ -39,7 +38,6 @@ module BlockChyp
|
|
|
39
38
|
attr_reader :offline_fixed_key
|
|
40
39
|
attr_accessor :gateway_host
|
|
41
40
|
attr_accessor :test_gateway_host
|
|
42
|
-
attr_accessor :dashboard_host
|
|
43
41
|
attr_accessor :https
|
|
44
42
|
attr_accessor :route_cache_ttl
|
|
45
43
|
attr_accessor :gateway_timeout
|
|
@@ -74,10 +72,6 @@ module BlockChyp
|
|
|
74
72
|
URI.parse(path.nil? ? url : url + path)
|
|
75
73
|
end
|
|
76
74
|
|
|
77
|
-
def resolve_dashboard_uri(path, request)
|
|
78
|
-
URI.parse(dashboard_host + path)
|
|
79
|
-
end
|
|
80
|
-
|
|
81
75
|
def generate_error_response(msg)
|
|
82
76
|
{
|
|
83
77
|
success: false,
|
|
@@ -171,78 +165,6 @@ module BlockChyp
|
|
|
171
165
|
URI.parse(url + port + path)
|
|
172
166
|
end
|
|
173
167
|
|
|
174
|
-
def dashboard_request(method, path, request = nil)
|
|
175
|
-
uri = resolve_dashboard_uri(path, request)
|
|
176
|
-
http = Net::HTTP.new(uri.host, uri.port)
|
|
177
|
-
http.use_ssl = uri.instance_of?(URI::HTTPS)
|
|
178
|
-
timeout = get_timeout(request, gateway_timeout)
|
|
179
|
-
http.open_timeout = timeout
|
|
180
|
-
http.read_timeout = timeout
|
|
181
|
-
|
|
182
|
-
req = get_http_request(method, uri)
|
|
183
|
-
|
|
184
|
-
req['User-Agent'] = user_agent
|
|
185
|
-
unless request.nil?
|
|
186
|
-
json = request.to_json
|
|
187
|
-
req['Content-Type'] = 'application/json'
|
|
188
|
-
req['Content-Length'] = json.length
|
|
189
|
-
req.body = json
|
|
190
|
-
end
|
|
191
|
-
|
|
192
|
-
headers = generate_gateway_headers
|
|
193
|
-
headers.each do |key, value|
|
|
194
|
-
req[key] = value
|
|
195
|
-
end
|
|
196
|
-
|
|
197
|
-
response = http.request(req)
|
|
198
|
-
|
|
199
|
-
if response.is_a?(Net::HTTPSuccess)
|
|
200
|
-
JSON.parse(response.body, symbolize_names: true)
|
|
201
|
-
else
|
|
202
|
-
raise response.message
|
|
203
|
-
end
|
|
204
|
-
end
|
|
205
|
-
|
|
206
|
-
def upload_request(path, request, content)
|
|
207
|
-
uri = resolve_dashboard_uri(path, request)
|
|
208
|
-
http = Net::HTTP.new(uri.host, uri.port)
|
|
209
|
-
http.use_ssl = uri.instance_of?(URI::HTTPS)
|
|
210
|
-
timeout = get_timeout(request, gateway_timeout)
|
|
211
|
-
http.open_timeout = timeout
|
|
212
|
-
http.read_timeout = timeout
|
|
213
|
-
|
|
214
|
-
req = get_http_request("POST", uri)
|
|
215
|
-
req.body = content
|
|
216
|
-
req['User-Agent'] = user_agent
|
|
217
|
-
req['Content-Type'] = 'application/octet-stream'
|
|
218
|
-
|
|
219
|
-
if request[:fileName]
|
|
220
|
-
req['X-Upload-File-Name'] = request[:fileName]
|
|
221
|
-
end
|
|
222
|
-
|
|
223
|
-
if request[:uploadId]
|
|
224
|
-
req['X-Upload-ID'] = request[:uploadId]
|
|
225
|
-
end
|
|
226
|
-
|
|
227
|
-
if request[:fileSize]
|
|
228
|
-
req['X-File-Size'] = request[:fileSize]
|
|
229
|
-
req['Content-Length'] = request[:fileSize]
|
|
230
|
-
end
|
|
231
|
-
|
|
232
|
-
headers = generate_gateway_headers
|
|
233
|
-
headers.each do |key, value|
|
|
234
|
-
req[key] = value
|
|
235
|
-
end
|
|
236
|
-
|
|
237
|
-
response = http.request(req)
|
|
238
|
-
|
|
239
|
-
if response.is_a?(Net::HTTPSuccess)
|
|
240
|
-
JSON.parse(response.body, symbolize_names: true)
|
|
241
|
-
else
|
|
242
|
-
raise response.message
|
|
243
|
-
end
|
|
244
|
-
end
|
|
245
|
-
|
|
246
168
|
def gateway_request(method, path, request = nil, relay = false)
|
|
247
169
|
uri = resolve_gateway_uri(path, request)
|
|
248
170
|
http = Net::HTTP.new(uri.host, uri.port)
|
data/test/batch_history_test.rb
CHANGED
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright 2019
|
|
3
|
+
# Copyright 2019 BlockChyp, Inc. All rights reserved. Use of this code is
|
|
4
4
|
# governed by a license that can be found in the LICENSE file.
|
|
5
5
|
#
|
|
6
|
-
# This file was generated automatically
|
|
7
|
-
#
|
|
6
|
+
# This file was generated automatically. Changes to this file will be lost
|
|
7
|
+
# every time the code is regenerated.
|
|
8
8
|
|
|
9
9
|
require ::File.expand_path('test_helper', __dir__)
|
|
10
10
|
|
|
11
11
|
module BlockChyp
|
|
12
12
|
class BatchHistoryTest < TestCase
|
|
13
13
|
def test_batch_history
|
|
14
|
-
|
|
15
|
-
puts "Running test_batch_history..."
|
|
16
|
-
|
|
17
14
|
config = load_test_config
|
|
18
15
|
|
|
19
16
|
blockchyp = BlockChyp.new(
|
|
@@ -23,11 +20,8 @@ module BlockChyp
|
|
|
23
20
|
)
|
|
24
21
|
blockchyp.gateway_host = config[:gatewayHost]
|
|
25
22
|
blockchyp.test_gateway_host = config[:testGatewayHost]
|
|
26
|
-
blockchyp.dashboard_host = config[:dashboardHost]
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
23
|
|
|
24
|
+
test_delay(blockchyp, 'batch_history_test', config[:defaultTerminalName])
|
|
31
25
|
|
|
32
26
|
# Set request parameters
|
|
33
27
|
setup_request = {
|
|
@@ -38,6 +32,7 @@ module BlockChyp
|
|
|
38
32
|
test: true,
|
|
39
33
|
transactionRef: uuid
|
|
40
34
|
}
|
|
35
|
+
|
|
41
36
|
response = blockchyp.charge(setup_request)
|
|
42
37
|
|
|
43
38
|
# Set request parameters
|
|
@@ -46,6 +41,7 @@ module BlockChyp
|
|
|
46
41
|
}
|
|
47
42
|
|
|
48
43
|
response = blockchyp.batch_history(request)
|
|
44
|
+
|
|
49
45
|
assert_not_nil(response)
|
|
50
46
|
# response assertions
|
|
51
47
|
assert(response[:success])
|
data/test/boolean_prompt_test.rb
CHANGED
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright 2019
|
|
3
|
+
# Copyright 2019 BlockChyp, Inc. All rights reserved. Use of this code is
|
|
4
4
|
# governed by a license that can be found in the LICENSE file.
|
|
5
5
|
#
|
|
6
|
-
# This file was generated automatically
|
|
7
|
-
#
|
|
6
|
+
# This file was generated automatically. Changes to this file will be lost
|
|
7
|
+
# every time the code is regenerated.
|
|
8
8
|
|
|
9
9
|
require ::File.expand_path('test_helper', __dir__)
|
|
10
10
|
|
|
11
11
|
module BlockChyp
|
|
12
12
|
class BooleanPromptTest < TestCase
|
|
13
13
|
def test_boolean_prompt
|
|
14
|
-
|
|
15
|
-
puts "Running test_boolean_prompt..."
|
|
16
|
-
|
|
17
14
|
config = load_test_config
|
|
18
15
|
|
|
19
16
|
blockchyp = BlockChyp.new(
|
|
@@ -23,13 +20,9 @@ module BlockChyp
|
|
|
23
20
|
)
|
|
24
21
|
blockchyp.gateway_host = config[:gatewayHost]
|
|
25
22
|
blockchyp.test_gateway_host = config[:testGatewayHost]
|
|
26
|
-
blockchyp.dashboard_host = config[:dashboardHost]
|
|
27
23
|
|
|
28
24
|
test_delay(blockchyp, 'boolean_prompt_test', config[:defaultTerminalName])
|
|
29
25
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
26
|
# Set request parameters
|
|
34
27
|
request = {
|
|
35
28
|
test: true,
|
|
@@ -40,6 +33,7 @@ module BlockChyp
|
|
|
40
33
|
}
|
|
41
34
|
|
|
42
35
|
response = blockchyp.boolean_prompt(request)
|
|
36
|
+
|
|
43
37
|
assert_not_nil(response)
|
|
44
38
|
# response assertions
|
|
45
39
|
assert(response[:success])
|
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright 2019
|
|
3
|
+
# Copyright 2019 BlockChyp, Inc. All rights reserved. Use of this code is
|
|
4
4
|
# governed by a license that can be found in the LICENSE file.
|
|
5
5
|
#
|
|
6
|
-
# This file was generated automatically
|
|
7
|
-
#
|
|
6
|
+
# This file was generated automatically. Changes to this file will be lost
|
|
7
|
+
# every time the code is regenerated.
|
|
8
8
|
|
|
9
9
|
require ::File.expand_path('test_helper', __dir__)
|
|
10
10
|
|
|
11
11
|
module BlockChyp
|
|
12
12
|
class CancelPaymentLinkTest < TestCase
|
|
13
13
|
def test_cancel_payment_link
|
|
14
|
-
|
|
15
|
-
puts "Running test_cancel_payment_link..."
|
|
16
|
-
|
|
17
14
|
config = load_test_config
|
|
18
15
|
|
|
19
16
|
blockchyp = BlockChyp.new(
|
|
@@ -23,11 +20,8 @@ module BlockChyp
|
|
|
23
20
|
)
|
|
24
21
|
blockchyp.gateway_host = config[:gatewayHost]
|
|
25
22
|
blockchyp.test_gateway_host = config[:testGatewayHost]
|
|
26
|
-
blockchyp.dashboard_host = config[:dashboardHost]
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
23
|
|
|
24
|
+
test_delay(blockchyp, 'cancel_payment_link_test', config[:defaultTerminalName])
|
|
31
25
|
|
|
32
26
|
# Set request parameters
|
|
33
27
|
setup_request = {
|
|
@@ -52,10 +46,11 @@ module BlockChyp
|
|
|
52
46
|
firstName: 'FirstName',
|
|
53
47
|
lastName: 'LastName',
|
|
54
48
|
companyName: 'Company Name',
|
|
55
|
-
emailAddress: '
|
|
49
|
+
emailAddress: 'support@blockchyp.com',
|
|
56
50
|
smsNumber: '(123) 123-1231'
|
|
57
51
|
}
|
|
58
52
|
}
|
|
53
|
+
|
|
59
54
|
response = blockchyp.send_payment_link(setup_request)
|
|
60
55
|
|
|
61
56
|
# Set request parameters
|
|
@@ -64,6 +59,7 @@ module BlockChyp
|
|
|
64
59
|
}
|
|
65
60
|
|
|
66
61
|
response = blockchyp.cancel_payment_link(request)
|
|
62
|
+
|
|
67
63
|
assert_not_nil(response)
|
|
68
64
|
# response assertions
|
|
69
65
|
assert(response[:success])
|
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright 2019
|
|
3
|
+
# Copyright 2019 BlockChyp, Inc. All rights reserved. Use of this code is
|
|
4
4
|
# governed by a license that can be found in the LICENSE file.
|
|
5
5
|
#
|
|
6
|
-
# This file was generated automatically
|
|
7
|
-
#
|
|
6
|
+
# This file was generated automatically. Changes to this file will be lost
|
|
7
|
+
# every time the code is regenerated.
|
|
8
8
|
|
|
9
9
|
require ::File.expand_path('test_helper', __dir__)
|
|
10
10
|
|
|
11
11
|
module BlockChyp
|
|
12
12
|
class CaptureSignatureTest < TestCase
|
|
13
13
|
def test_capture_signature
|
|
14
|
-
|
|
15
|
-
puts "Running test_capture_signature..."
|
|
16
|
-
|
|
17
14
|
config = load_test_config
|
|
18
15
|
|
|
19
16
|
blockchyp = BlockChyp.new(
|
|
@@ -23,13 +20,9 @@ module BlockChyp
|
|
|
23
20
|
)
|
|
24
21
|
blockchyp.gateway_host = config[:gatewayHost]
|
|
25
22
|
blockchyp.test_gateway_host = config[:testGatewayHost]
|
|
26
|
-
blockchyp.dashboard_host = config[:dashboardHost]
|
|
27
23
|
|
|
28
24
|
test_delay(blockchyp, 'capture_signature_test', config[:defaultTerminalName])
|
|
29
25
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
26
|
# Set request parameters
|
|
34
27
|
request = {
|
|
35
28
|
terminalName: config[:defaultTerminalName],
|
|
@@ -38,6 +31,7 @@ module BlockChyp
|
|
|
38
31
|
}
|
|
39
32
|
|
|
40
33
|
response = blockchyp.capture_signature(request)
|
|
34
|
+
|
|
41
35
|
assert_not_nil(response)
|
|
42
36
|
# response assertions
|
|
43
37
|
assert(response[:success])
|
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright 2019
|
|
3
|
+
# Copyright 2019 BlockChyp, Inc. All rights reserved. Use of this code is
|
|
4
4
|
# governed by a license that can be found in the LICENSE file.
|
|
5
5
|
#
|
|
6
|
-
# This file was generated automatically
|
|
7
|
-
#
|
|
6
|
+
# This file was generated automatically. Changes to this file will be lost
|
|
7
|
+
# every time the code is regenerated.
|
|
8
8
|
|
|
9
9
|
require ::File.expand_path('test_helper', __dir__)
|
|
10
10
|
|
|
11
11
|
module BlockChyp
|
|
12
12
|
class DeleteCustomerTest < TestCase
|
|
13
13
|
def test_delete_customer
|
|
14
|
-
|
|
15
|
-
puts "Running test_delete_customer..."
|
|
16
|
-
|
|
17
14
|
config = load_test_config
|
|
18
15
|
|
|
19
16
|
blockchyp = BlockChyp.new(
|
|
@@ -23,11 +20,8 @@ module BlockChyp
|
|
|
23
20
|
)
|
|
24
21
|
blockchyp.gateway_host = config[:gatewayHost]
|
|
25
22
|
blockchyp.test_gateway_host = config[:testGatewayHost]
|
|
26
|
-
blockchyp.dashboard_host = config[:dashboardHost]
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
23
|
|
|
24
|
+
test_delay(blockchyp, 'delete_customer_test', config[:defaultTerminalName])
|
|
31
25
|
|
|
32
26
|
# Set request parameters
|
|
33
27
|
setup_request = {
|
|
@@ -39,6 +33,7 @@ module BlockChyp
|
|
|
39
33
|
smsNumber: '(123) 123-1234'
|
|
40
34
|
}
|
|
41
35
|
}
|
|
36
|
+
|
|
42
37
|
response = blockchyp.update_customer(setup_request)
|
|
43
38
|
|
|
44
39
|
# Set request parameters
|
|
@@ -47,6 +42,7 @@ module BlockChyp
|
|
|
47
42
|
}
|
|
48
43
|
|
|
49
44
|
response = blockchyp.delete_customer(request)
|
|
45
|
+
|
|
50
46
|
assert_not_nil(response)
|
|
51
47
|
# response assertions
|
|
52
48
|
assert(response[:success])
|
data/test/delete_token_test.rb
CHANGED
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright 2019
|
|
3
|
+
# Copyright 2019 BlockChyp, Inc. All rights reserved. Use of this code is
|
|
4
4
|
# governed by a license that can be found in the LICENSE file.
|
|
5
5
|
#
|
|
6
|
-
# This file was generated automatically
|
|
7
|
-
#
|
|
6
|
+
# This file was generated automatically. Changes to this file will be lost
|
|
7
|
+
# every time the code is regenerated.
|
|
8
8
|
|
|
9
9
|
require ::File.expand_path('test_helper', __dir__)
|
|
10
10
|
|
|
11
11
|
module BlockChyp
|
|
12
12
|
class DeleteTokenTest < TestCase
|
|
13
13
|
def test_delete_token
|
|
14
|
-
|
|
15
|
-
puts "Running test_delete_token..."
|
|
16
|
-
|
|
17
14
|
config = load_test_config
|
|
18
15
|
|
|
19
16
|
blockchyp = BlockChyp.new(
|
|
@@ -23,22 +20,15 @@ module BlockChyp
|
|
|
23
20
|
)
|
|
24
21
|
blockchyp.gateway_host = config[:gatewayHost]
|
|
25
22
|
blockchyp.test_gateway_host = config[:testGatewayHost]
|
|
26
|
-
blockchyp.dashboard_host = config[:dashboardHost]
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
23
|
|
|
24
|
+
test_delay(blockchyp, 'delete_token_test', config[:defaultTerminalName])
|
|
31
25
|
|
|
32
26
|
# Set request parameters
|
|
33
27
|
setup_request = {
|
|
34
28
|
pan: '4111111111111111',
|
|
35
|
-
test: true
|
|
36
|
-
customer: {
|
|
37
|
-
customerRef: 'TESTCUSTOMER',
|
|
38
|
-
firstName: 'Test',
|
|
39
|
-
lastName: 'Customer'
|
|
40
|
-
}
|
|
29
|
+
test: true
|
|
41
30
|
}
|
|
31
|
+
|
|
42
32
|
response = blockchyp.enroll(setup_request)
|
|
43
33
|
|
|
44
34
|
# Set request parameters
|
|
@@ -47,6 +37,7 @@ module BlockChyp
|
|
|
47
37
|
}
|
|
48
38
|
|
|
49
39
|
response = blockchyp.delete_token(request)
|
|
40
|
+
|
|
50
41
|
assert_not_nil(response)
|
|
51
42
|
# response assertions
|
|
52
43
|
assert(response[:success])
|