blockchyp 1.24.14 → 2.0.0.pre.alpha7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +1 -41
  3. data/README.md +441 -3551
  4. data/lib/blockchyp/version.rb +1 -1
  5. data/lib/blockchyp.rb +41 -366
  6. data/lib/blockchyp_client.rb +125 -207
  7. data/test/boolean_prompt_test.rb +18 -32
  8. data/test/heartbeat_test.rb +10 -10
  9. data/test/new_transaction_display_test.rb +50 -44
  10. data/test/pan_charge_test.rb +27 -44
  11. data/test/pan_enroll_test.rb +25 -45
  12. data/test/pan_preauth_test.rb +26 -43
  13. data/test/simple_batch_close_test.rb +23 -37
  14. data/test/simple_capture_test.rb +21 -38
  15. data/test/simple_gift_activate_test.rb +15 -30
  16. data/test/simple_message_test.rb +15 -29
  17. data/test/simple_ping_test.rb +14 -28
  18. data/test/simple_refund_test.rb +22 -40
  19. data/test/simple_reversal_test.rb +22 -39
  20. data/test/simple_void_test.rb +22 -39
  21. data/test/terminal_charge_test.rb +25 -40
  22. data/test/terminal_clear_test.rb +14 -28
  23. data/test/terminal_ebt_balance_test.rb +16 -30
  24. data/test/terminal_ebt_charge_test.rb +27 -42
  25. data/test/terminal_enroll_test.rb +24 -39
  26. data/test/terminal_gift_card_balance_test.rb +15 -29
  27. data/test/terminal_keyed_charge_test.rb +26 -41
  28. data/test/terminal_manual_ebt_charge_test.rb +28 -43
  29. data/test/terminal_preauth_test.rb +25 -40
  30. data/test/terms_and_conditions_test.rb +19 -33
  31. data/test/test_helper.rb +10 -9
  32. data/test/text_prompt_test.rb +15 -29
  33. data/test/update_transaction_display_test.rb +50 -44
  34. metadata +5 -64
  35. data/test/activate_terminal_test.rb +0 -45
  36. data/test/add_test_merchant_test.rb +0 -56
  37. data/test/batch_history_test.rb +0 -54
  38. data/test/cancel_payment_link_test.rb +0 -72
  39. data/test/capture_signature_test.rb +0 -46
  40. data/test/deactivate_terminal_test.rb +0 -42
  41. data/test/delete_branding_asset_test.rb +0 -50
  42. data/test/delete_customer_test.rb +0 -55
  43. data/test/delete_media_asset_test.rb +0 -53
  44. data/test/delete_queued_transaction_test.rb +0 -56
  45. data/test/delete_slide_show_test.rb +0 -50
  46. data/test/delete_survey_question_test.rb +0 -51
  47. data/test/delete_test_merchant_test.rb +0 -59
  48. data/test/delete_token_test.rb +0 -55
  49. data/test/empty_branding_asset_test.rb +0 -44
  50. data/test/empty_slide_show_test.rb +0 -45
  51. data/test/gateway_timeout_test.rb +0 -49
  52. data/test/get_customer_test.rb +0 -55
  53. data/test/get_merchants_test.rb +0 -52
  54. data/test/invite_merchant_user_test.rb +0 -45
  55. data/test/link_token_test.rb +0 -56
  56. data/test/list_queued_transactions_test.rb +0 -55
  57. data/test/list_terminals_test.rb +0 -42
  58. data/test/media_asset_test.rb +0 -57
  59. data/test/media_test.rb +0 -42
  60. data/test/media_upload_test.rb +0 -52
  61. data/test/merchant_platforms_test.rb +0 -59
  62. data/test/merchant_profile_test.rb +0 -43
  63. data/test/merchant_users_test.rb +0 -42
  64. data/test/partial_refund_test.rb +0 -58
  65. data/test/search_customer_test.rb +0 -55
  66. data/test/send_payment_link_test.rb +0 -67
  67. data/test/simple_locate_test.rb +0 -44
  68. data/test/slide_show_test.rb +0 -51
  69. data/test/slide_shows_test.rb +0 -49
  70. data/test/survey_question_test.rb +0 -48
  71. data/test/survey_questions_test.rb +0 -50
  72. data/test/survey_results_test.rb +0 -48
  73. data/test/tc_delete_template_test.rb +0 -51
  74. data/test/tc_entry_test.rb +0 -56
  75. data/test/tc_log_test.rb +0 -42
  76. data/test/tc_template_test.rb +0 -53
  77. data/test/tc_template_update_test.rb +0 -48
  78. data/test/tc_templates_test.rb +0 -42
  79. data/test/terminal_branding_test.rb +0 -42
  80. data/test/terminal_queued_transaction_test.rb +0 -51
  81. data/test/terminal_status_test.rb +0 -45
  82. data/test/terminal_timeout_test.rb +0 -46
  83. data/test/testdata/aviato.png +0 -0
  84. data/test/token_metadata_test.rb +0 -55
  85. data/test/transaction_history_test.rb +0 -54
  86. data/test/unlink_token_test.rb +0 -56
  87. data/test/update_branding_asset_test.rb +0 -62
  88. data/test/update_customer_test.rb +0 -49
  89. data/test/update_merchant_platforms_test.rb +0 -61
  90. data/test/update_merchant_test.rb +0 -60
  91. data/test/update_slide_show_test.rb +0 -60
  92. data/test/update_survey_question_test.rb +0 -47
  93. data/test/upload_status_test.rb +0 -53
@@ -1,61 +1,44 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2019-2022 BlockChyp, Inc. All rights reserved. Use of this code is
4
- # governed by a license that can be found in the LICENSE file.
5
- #
6
- # This file was generated automatically by the BlockChyp SDK Generator.
7
- # Changes to this file will be lost every time the code is regenerated.
8
-
9
3
  require ::File.expand_path('test_helper', __dir__)
10
4
 
11
5
  module BlockChyp
12
6
  class PANChargeTest < TestCase
13
7
  def test_pan_charge
14
-
15
- puts "Running test_pan_charge..."
16
-
17
8
  config = load_test_config
18
9
 
19
10
  blockchyp = BlockChyp.new(
20
- config[:apiKey],
21
- config[:bearerToken],
22
- config[:signingKey]
11
+ config['apiKey'],
12
+ config['bearerToken'],
13
+ config['signingKey']
23
14
  )
24
- blockchyp.gateway_host = config[:gatewayHost]
25
- blockchyp.test_gateway_host = config[:testGatewayHost]
26
- blockchyp.dashboard_host = config[:dashboardHost]
27
-
28
- test_delay(blockchyp, 'pan_charge_test', config[:defaultTerminalName])
29
-
30
-
31
-
32
-
33
- # Set request parameters
34
- request = {
35
- pan: '4111111111111111',
36
- expMonth: '12',
37
- expYear: '2025',
38
- amount: '25.55',
39
- test: true,
40
- transactionRef: uuid
41
- }
42
-
15
+ blockchyp.gateway_host = config['gatewayHost']
16
+ blockchyp.test_gateway_host = config['testGatewayHost']
17
+
18
+ test_delay(blockchyp, 'PANChargeTest')
19
+ # setup request object
20
+ request = {}
21
+ request['pan'] = '4111111111111111'
22
+ request['amount'] = '25.55'
23
+ request['test'] = true
24
+ request['transactionRef'] = uuid
43
25
  response = blockchyp.charge(request)
26
+
44
27
  assert_not_nil(response)
45
28
  # response assertions
46
- assert(response[:success])
47
- assert(response[:approved])
48
- assert(response[:test])
49
- assert_equal(response[:authCode].length, 6)
50
- assert(!response[:transactionId].empty?)
51
- assert(!response[:timestamp].empty?)
52
- assert(!response[:tickBlock].empty?)
53
- assert_equal('approved', response[:responseDescription])
54
- assert(!response[:paymentType].empty?)
55
- assert(!response[:maskedPan].empty?)
56
- assert(!response[:entryMethod].empty?)
57
- assert_equal('25.55', response[:authorizedAmount])
58
- assert_equal('KEYED', response[:entryMethod])
29
+ assert(response['approved'])
30
+ assert(response['test'])
31
+ assert_equal(response['authCode'].length, 6)
32
+ assert(!response['transactionId'].empty?)
33
+ assert(!response['timestamp'].empty?)
34
+ assert(!response['tickBlock'].empty?)
35
+ assert_equal('Approved', response['responseDescription'])
36
+ assert(!response['paymentType'].empty?)
37
+ assert(!response['maskedPan'].empty?)
38
+ assert(!response['entryMethod'].empty?)
39
+ assert_equal('25.55', response['authorizedAmount'])
40
+ assert_equal('KEYED', response['entryMethod'])
59
41
  end
42
+
60
43
  end
61
44
  end
@@ -1,62 +1,42 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2019-2022 BlockChyp, Inc. All rights reserved. Use of this code is
4
- # governed by a license that can be found in the LICENSE file.
5
- #
6
- # This file was generated automatically by the BlockChyp SDK Generator.
7
- # Changes to this file will be lost every time the code is regenerated.
8
-
9
3
  require ::File.expand_path('test_helper', __dir__)
10
4
 
11
5
  module BlockChyp
12
6
  class PANEnrollTest < TestCase
13
7
  def test_pan_enroll
14
-
15
- puts "Running test_pan_enroll..."
16
-
17
8
  config = load_test_config
18
9
 
19
10
  blockchyp = BlockChyp.new(
20
- config[:apiKey],
21
- config[:bearerToken],
22
- config[:signingKey]
11
+ config['apiKey'],
12
+ config['bearerToken'],
13
+ config['signingKey']
23
14
  )
24
- blockchyp.gateway_host = config[:gatewayHost]
25
- blockchyp.test_gateway_host = config[:testGatewayHost]
26
- blockchyp.dashboard_host = config[:dashboardHost]
27
-
28
- test_delay(blockchyp, 'pan_enroll_test', config[:defaultTerminalName])
29
-
30
-
31
-
32
-
33
- # Set request parameters
34
- request = {
35
- pan: '4111111111111111',
36
- test: true,
37
- customer: {
38
- customerRef: 'TESTCUSTOMER',
39
- firstName: 'Test',
40
- lastName: 'Customer'
41
- }
42
- }
43
-
15
+ blockchyp.gateway_host = config['gatewayHost']
16
+ blockchyp.test_gateway_host = config['testGatewayHost']
17
+
18
+ test_delay(blockchyp, 'PANEnrollTest')
19
+ # setup request object
20
+ request = {}
21
+ request['pan'] = '4111111111111111'
22
+ request['test'] = true
44
23
  response = blockchyp.enroll(request)
24
+
45
25
  assert_not_nil(response)
46
26
  # response assertions
47
- assert(response[:success])
48
- assert(response[:approved])
49
- assert(response[:test])
50
- assert_equal(response[:authCode].length, 6)
51
- assert(!response[:transactionId].empty?)
52
- assert(!response[:timestamp].empty?)
53
- assert(!response[:tickBlock].empty?)
54
- assert_equal('approved', response[:responseDescription])
55
- assert(!response[:paymentType].empty?)
56
- assert(!response[:maskedPan].empty?)
57
- assert(!response[:entryMethod].empty?)
58
- assert_equal('KEYED', response[:entryMethod])
59
- assert(!response[:token].empty?)
27
+ assert(response['approved'])
28
+ assert(response['test'])
29
+ assert_equal(response['authCode'].length, 6)
30
+ assert(!response['transactionId'].empty?)
31
+ assert(!response['timestamp'].empty?)
32
+ assert(!response['tickBlock'].empty?)
33
+ assert_equal('Approved', response['responseDescription'])
34
+ assert(!response['paymentType'].empty?)
35
+ assert(!response['maskedPan'].empty?)
36
+ assert(!response['entryMethod'].empty?)
37
+ assert_equal('KEYED', response['entryMethod'])
38
+ assert(!response['token'].empty?)
60
39
  end
40
+
61
41
  end
62
42
  end
@@ -1,60 +1,43 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2019-2022 BlockChyp, Inc. All rights reserved. Use of this code is
4
- # governed by a license that can be found in the LICENSE file.
5
- #
6
- # This file was generated automatically by the BlockChyp SDK Generator.
7
- # Changes to this file will be lost every time the code is regenerated.
8
-
9
3
  require ::File.expand_path('test_helper', __dir__)
10
4
 
11
5
  module BlockChyp
12
6
  class PANPreauthTest < TestCase
13
7
  def test_pan_preauth
14
-
15
- puts "Running test_pan_preauth..."
16
-
17
8
  config = load_test_config
18
9
 
19
10
  blockchyp = BlockChyp.new(
20
- config[:apiKey],
21
- config[:bearerToken],
22
- config[:signingKey]
11
+ config['apiKey'],
12
+ config['bearerToken'],
13
+ config['signingKey']
23
14
  )
24
- blockchyp.gateway_host = config[:gatewayHost]
25
- blockchyp.test_gateway_host = config[:testGatewayHost]
26
- blockchyp.dashboard_host = config[:dashboardHost]
27
-
28
- test_delay(blockchyp, 'pan_preauth_test', config[:defaultTerminalName])
29
-
30
-
31
-
32
-
33
- # Set request parameters
34
- request = {
35
- pan: '4111111111111111',
36
- expMonth: '12',
37
- expYear: '2025',
38
- amount: '25.55',
39
- test: true
40
- }
41
-
15
+ blockchyp.gateway_host = config['gatewayHost']
16
+ blockchyp.test_gateway_host = config['testGatewayHost']
17
+
18
+ test_delay(blockchyp, 'PANPreauthTest')
19
+ # setup request object
20
+ request = {}
21
+ request['pan'] = '4111111111111111'
22
+ request['amount'] = '25.55'
23
+ request['test'] = true
42
24
  response = blockchyp.preauth(request)
25
+
43
26
  assert_not_nil(response)
44
27
  # response assertions
45
- assert(response[:success])
46
- assert(response[:approved])
47
- assert(response[:test])
48
- assert_equal(response[:authCode].length, 6)
49
- assert(!response[:transactionId].empty?)
50
- assert(!response[:timestamp].empty?)
51
- assert(!response[:tickBlock].empty?)
52
- assert_equal('approved', response[:responseDescription])
53
- assert(!response[:paymentType].empty?)
54
- assert(!response[:maskedPan].empty?)
55
- assert(!response[:entryMethod].empty?)
56
- assert_equal('25.55', response[:authorizedAmount])
57
- assert_equal('KEYED', response[:entryMethod])
28
+ assert(response['approved'])
29
+ assert(response['test'])
30
+ assert_equal(response['authCode'].length, 6)
31
+ assert(!response['transactionId'].empty?)
32
+ assert(!response['timestamp'].empty?)
33
+ assert(!response['tickBlock'].empty?)
34
+ assert_equal('Approved', response['responseDescription'])
35
+ assert(!response['paymentType'].empty?)
36
+ assert(!response['maskedPan'].empty?)
37
+ assert(!response['entryMethod'].empty?)
38
+ assert_equal('25.55', response['authorizedAmount'])
39
+ assert_equal('KEYED', response['entryMethod'])
58
40
  end
41
+
59
42
  end
60
43
  end
@@ -1,54 +1,40 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2019-2022 BlockChyp, Inc. All rights reserved. Use of this code is
4
- # governed by a license that can be found in the LICENSE file.
5
- #
6
- # This file was generated automatically by the BlockChyp SDK Generator.
7
- # Changes to this file will be lost every time the code is regenerated.
8
-
9
3
  require ::File.expand_path('test_helper', __dir__)
10
4
 
11
5
  module BlockChyp
12
6
  class SimpleBatchCloseTest < TestCase
13
7
  def test_simple_batch_close
14
-
15
- puts "Running test_simple_batch_close..."
16
-
17
8
  config = load_test_config
18
9
 
19
10
  blockchyp = BlockChyp.new(
20
- config[:apiKey],
21
- config[:bearerToken],
22
- config[:signingKey]
11
+ config['apiKey'],
12
+ config['bearerToken'],
13
+ config['signingKey']
23
14
  )
24
- blockchyp.gateway_host = config[:gatewayHost]
25
- blockchyp.test_gateway_host = config[:testGatewayHost]
26
- blockchyp.dashboard_host = config[:dashboardHost]
27
-
28
-
15
+ blockchyp.gateway_host = config['gatewayHost']
16
+ blockchyp.test_gateway_host = config['testGatewayHost']
17
+
18
+ test_delay(blockchyp, 'SimpleBatchCloseTest')
19
+ # setup request object
20
+ request = {}
21
+ request['pan'] = '4111111111111111'
22
+ request['amount'] = '25.55'
23
+ request['test'] = true
24
+ request['transactionRef'] = uuid
25
+ response = blockchyp.charge(request)
26
+
27
+ # setup request object
28
+ request = {}
29
+ request['test'] = true
30
+ response = blockchyp.closeBatch(request)
29
31
 
30
-
31
-
32
- # Set request parameters
33
- setup_request = {
34
- pan: '4111111111111111',
35
- expMonth: '12',
36
- expYear: '2025',
37
- amount: '25.55',
38
- test: true,
39
- transactionRef: uuid
40
- }
41
- response = blockchyp.charge(setup_request)
42
-
43
- # Set request parameters
44
- request = {
45
- test: true
46
- }
47
-
48
- response = blockchyp.close_batch(request)
49
32
  assert_not_nil(response)
50
33
  # response assertions
51
- assert(response[:success])
34
+ assert(response['success'])
35
+ assert(!response['capturedTotal'].empty?)
36
+ assert(!response['openPreauths'].empty?)
52
37
  end
38
+
53
39
  end
54
40
  end
@@ -1,55 +1,38 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2019-2022 BlockChyp, Inc. All rights reserved. Use of this code is
4
- # governed by a license that can be found in the LICENSE file.
5
- #
6
- # This file was generated automatically by the BlockChyp SDK Generator.
7
- # Changes to this file will be lost every time the code is regenerated.
8
-
9
3
  require ::File.expand_path('test_helper', __dir__)
10
4
 
11
5
  module BlockChyp
12
6
  class SimpleCaptureTest < TestCase
13
7
  def test_simple_capture
14
-
15
- puts "Running test_simple_capture..."
16
-
17
8
  config = load_test_config
18
9
 
19
10
  blockchyp = BlockChyp.new(
20
- config[:apiKey],
21
- config[:bearerToken],
22
- config[:signingKey]
11
+ config['apiKey'],
12
+ config['bearerToken'],
13
+ config['signingKey']
23
14
  )
24
- blockchyp.gateway_host = config[:gatewayHost]
25
- blockchyp.test_gateway_host = config[:testGatewayHost]
26
- blockchyp.dashboard_host = config[:dashboardHost]
27
-
28
-
29
-
30
-
31
-
32
- # Set request parameters
33
- setup_request = {
34
- pan: '4111111111111111',
35
- expMonth: '12',
36
- expYear: '2025',
37
- amount: '25.55',
38
- test: true
39
- }
40
- response = blockchyp.preauth(setup_request)
41
-
42
- # Set request parameters
43
- request = {
44
- transactionId: response[:transactionId],
45
- test: true
46
- }
47
-
15
+ blockchyp.gateway_host = config['gatewayHost']
16
+ blockchyp.test_gateway_host = config['testGatewayHost']
17
+
18
+ test_delay(blockchyp, 'SimpleCaptureTest')
19
+ # setup request object
20
+ request = {}
21
+ request['pan'] = '4111111111111111'
22
+ request['amount'] = '25.55'
23
+ request['test'] = true
24
+ response = blockchyp.preauth(request)
25
+
26
+ # setup request object
27
+ request = {}
28
+ request['transactionId'] = response['transactionId']
29
+ request['test'] = true
48
30
  response = blockchyp.capture(request)
31
+
49
32
  assert_not_nil(response)
50
33
  # response assertions
51
- assert(response[:success])
52
- assert(response[:approved])
34
+ assert(response['approved'])
53
35
  end
36
+
54
37
  end
55
38
  end
@@ -1,48 +1,33 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2019-2022 BlockChyp, Inc. All rights reserved. Use of this code is
4
- # governed by a license that can be found in the LICENSE file.
5
- #
6
- # This file was generated automatically by the BlockChyp SDK Generator.
7
- # Changes to this file will be lost every time the code is regenerated.
8
-
9
3
  require ::File.expand_path('test_helper', __dir__)
10
4
 
11
5
  module BlockChyp
12
6
  class SimpleGiftActivateTest < TestCase
13
7
  def test_simple_gift_activate
14
-
15
- puts "Running test_simple_gift_activate..."
16
-
17
8
  config = load_test_config
18
9
 
19
10
  blockchyp = BlockChyp.new(
20
- config[:apiKey],
21
- config[:bearerToken],
22
- config[:signingKey]
11
+ config['apiKey'],
12
+ config['bearerToken'],
13
+ config['signingKey']
23
14
  )
24
- blockchyp.gateway_host = config[:gatewayHost]
25
- blockchyp.test_gateway_host = config[:testGatewayHost]
26
- blockchyp.dashboard_host = config[:dashboardHost]
27
-
28
- test_delay(blockchyp, 'simple_gift_activate_test', config[:defaultTerminalName])
15
+ blockchyp.gateway_host = config['gatewayHost']
16
+ blockchyp.test_gateway_host = config['testGatewayHost']
29
17
 
18
+ test_delay(blockchyp, 'SimpleGiftActivateTest')
19
+ # setup request object
20
+ request = {}
21
+ request['test'] = true
22
+ request['terminalName'] = 'Test Terminal'
23
+ request['amount'] = '50.00'
24
+ response = blockchyp.giftActivate(request)
30
25
 
31
-
32
-
33
- # Set request parameters
34
- request = {
35
- test: true,
36
- terminalName: config[:defaultTerminalName],
37
- amount: '50.00'
38
- }
39
-
40
- response = blockchyp.gift_activate(request)
41
26
  assert_not_nil(response)
42
27
  # response assertions
43
- assert(response[:success])
44
- assert(response[:approved])
45
- assert(!response[:publicKey].empty?)
28
+ assert(response['approved'])
29
+ assert(!response['publicKey'].empty?)
46
30
  end
31
+
47
32
  end
48
33
  end
@@ -1,46 +1,32 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2019-2022 BlockChyp, Inc. All rights reserved. Use of this code is
4
- # governed by a license that can be found in the LICENSE file.
5
- #
6
- # This file was generated automatically by the BlockChyp SDK Generator.
7
- # Changes to this file will be lost every time the code is regenerated.
8
-
9
3
  require ::File.expand_path('test_helper', __dir__)
10
4
 
11
5
  module BlockChyp
12
6
  class SimpleMessageTest < TestCase
13
7
  def test_simple_message
14
-
15
- puts "Running test_simple_message..."
16
-
17
8
  config = load_test_config
18
9
 
19
10
  blockchyp = BlockChyp.new(
20
- config[:apiKey],
21
- config[:bearerToken],
22
- config[:signingKey]
11
+ config['apiKey'],
12
+ config['bearerToken'],
13
+ config['signingKey']
23
14
  )
24
- blockchyp.gateway_host = config[:gatewayHost]
25
- blockchyp.test_gateway_host = config[:testGatewayHost]
26
- blockchyp.dashboard_host = config[:dashboardHost]
27
-
28
- test_delay(blockchyp, 'simple_message_test', config[:defaultTerminalName])
29
-
30
-
31
-
32
-
33
- # Set request parameters
34
- request = {
35
- test: true,
36
- terminalName: config[:defaultTerminalName],
37
- message: 'Thank You For Your Business'
38
- }
39
-
15
+ blockchyp.gateway_host = config['gatewayHost']
16
+ blockchyp.test_gateway_host = config['testGatewayHost']
17
+
18
+ test_delay(blockchyp, 'SimpleMessageTest')
19
+ # setup request object
20
+ request = {}
21
+ request['test'] = true
22
+ request['terminalName'] = 'Test Terminal'
23
+ request['message'] = 'Thank You For Your Business'
40
24
  response = blockchyp.message(request)
25
+
41
26
  assert_not_nil(response)
42
27
  # response assertions
43
- assert(response[:success])
28
+ assert(response['success'])
44
29
  end
30
+
45
31
  end
46
32
  end
@@ -1,45 +1,31 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2019-2022 BlockChyp, Inc. All rights reserved. Use of this code is
4
- # governed by a license that can be found in the LICENSE file.
5
- #
6
- # This file was generated automatically by the BlockChyp SDK Generator.
7
- # Changes to this file will be lost every time the code is regenerated.
8
-
9
3
  require ::File.expand_path('test_helper', __dir__)
10
4
 
11
5
  module BlockChyp
12
6
  class SimplePingTest < TestCase
13
7
  def test_simple_ping
14
-
15
- puts "Running test_simple_ping..."
16
-
17
8
  config = load_test_config
18
9
 
19
10
  blockchyp = BlockChyp.new(
20
- config[:apiKey],
21
- config[:bearerToken],
22
- config[:signingKey]
11
+ config['apiKey'],
12
+ config['bearerToken'],
13
+ config['signingKey']
23
14
  )
24
- blockchyp.gateway_host = config[:gatewayHost]
25
- blockchyp.test_gateway_host = config[:testGatewayHost]
26
- blockchyp.dashboard_host = config[:dashboardHost]
27
-
28
- test_delay(blockchyp, 'simple_ping_test', config[:defaultTerminalName])
29
-
30
-
31
-
32
-
33
- # Set request parameters
34
- request = {
35
- test: true,
36
- terminalName: config[:defaultTerminalName]
37
- }
38
-
15
+ blockchyp.gateway_host = config['gatewayHost']
16
+ blockchyp.test_gateway_host = config['testGatewayHost']
17
+
18
+ test_delay(blockchyp, 'SimplePingTest')
19
+ # setup request object
20
+ request = {}
21
+ request['test'] = true
22
+ request['terminalName'] = 'Test Terminal'
39
23
  response = blockchyp.ping(request)
24
+
40
25
  assert_not_nil(response)
41
26
  # response assertions
42
- assert(response[:success])
27
+ assert(response['success'])
43
28
  end
29
+
44
30
  end
45
31
  end