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,57 +1,39 @@
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 SimpleRefundTest < TestCase
13
7
  def test_simple_refund
14
-
15
- puts "Running test_simple_refund..."
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_refund_test', config[:defaultTerminalName])
29
-
30
-
31
-
32
-
33
- # Set request parameters
34
- setup_request = {
35
- pan: '4111111111111111',
36
- expMonth: '12',
37
- expYear: '2025',
38
- amount: '25.55',
39
- test: true,
40
- transactionRef: uuid
41
- }
42
- response = blockchyp.charge(setup_request)
43
-
44
- # Set request parameters
45
- request = {
46
- transactionId: response[:transactionId],
47
- test: true
48
- }
49
-
15
+ blockchyp.gateway_host = config['gatewayHost']
16
+ blockchyp.test_gateway_host = config['testGatewayHost']
17
+
18
+ test_delay(blockchyp, 'SimpleRefundTest')
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['transactionId'] = response['transactionId']
30
+ request['test'] = true
50
31
  response = blockchyp.refund(request)
32
+
51
33
  assert_not_nil(response)
52
34
  # response assertions
53
- assert(response[:success])
54
- assert(response[:approved])
35
+ assert(response['approved'])
55
36
  end
37
+
56
38
  end
57
39
  end
@@ -1,56 +1,39 @@
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 SimpleReversalTest < TestCase
13
7
  def test_simple_reversal
14
-
15
- puts "Running test_simple_reversal..."
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
- transactionRef: uuid
40
- }
41
- response = blockchyp.charge(setup_request)
42
-
43
- # Set request parameters
44
- request = {
45
- transactionRef: response[:transactionRef],
46
- test: true
47
- }
48
-
15
+ blockchyp.gateway_host = config['gatewayHost']
16
+ blockchyp.test_gateway_host = config['testGatewayHost']
17
+
18
+ test_delay(blockchyp, 'SimpleReversalTest')
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['transactionRef'] = response['transactionRef']
30
+ request['test'] = true
49
31
  response = blockchyp.reverse(request)
32
+
50
33
  assert_not_nil(response)
51
34
  # response assertions
52
- assert(response[:success])
53
- assert(response[:approved])
35
+ assert(response['approved'])
54
36
  end
37
+
55
38
  end
56
39
  end
@@ -1,56 +1,39 @@
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 SimpleVoidTest < TestCase
13
7
  def test_simple_void
14
-
15
- puts "Running test_simple_void..."
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
- transactionRef: uuid
40
- }
41
- response = blockchyp.charge(setup_request)
42
-
43
- # Set request parameters
44
- request = {
45
- transactionId: response[:transactionId],
46
- test: true
47
- }
48
-
15
+ blockchyp.gateway_host = config['gatewayHost']
16
+ blockchyp.test_gateway_host = config['testGatewayHost']
17
+
18
+ test_delay(blockchyp, 'SimpleVoidTest')
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['transactionId'] = response['transactionId']
30
+ request['test'] = true
49
31
  response = blockchyp.void(request)
32
+
50
33
  assert_not_nil(response)
51
34
  # response assertions
52
- assert(response[:success])
53
- assert(response[:approved])
35
+ assert(response['approved'])
54
36
  end
37
+
55
38
  end
56
39
  end
@@ -1,57 +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 TerminalChargeTest < TestCase
13
7
  def test_terminal_charge
14
-
15
- puts "Running test_terminal_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, 'terminal_charge_test', config[:defaultTerminalName])
29
-
30
-
31
-
32
-
33
- # Set request parameters
34
- request = {
35
- terminalName: config[:defaultTerminalName],
36
- amount: '25.15',
37
- test: true
38
- }
39
-
15
+ blockchyp.gateway_host = config['gatewayHost']
16
+ blockchyp.test_gateway_host = config['testGatewayHost']
17
+
18
+ test_delay(blockchyp, 'TerminalChargeTest')
19
+ # setup request object
20
+ request = {}
21
+ request['terminalName'] = 'Test Terminal'
22
+ request['amount'] = '25.15'
23
+ request['test'] = true
40
24
  response = blockchyp.charge(request)
25
+
41
26
  assert_not_nil(response)
42
27
  # response assertions
43
- assert(response[:success])
44
- assert(response[:approved])
45
- assert(response[:test])
46
- assert_equal(response[:authCode].length, 6)
47
- assert(!response[:transactionId].empty?)
48
- assert(!response[:timestamp].empty?)
49
- assert(!response[:tickBlock].empty?)
50
- assert_equal('approved', response[:responseDescription])
51
- assert(!response[:paymentType].empty?)
52
- assert(!response[:maskedPan].empty?)
53
- assert(!response[:entryMethod].empty?)
54
- assert_equal('25.15', response[:authorizedAmount])
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.15', response['authorizedAmount'])
55
39
  end
40
+
56
41
  end
57
42
  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 TerminalClearTest < TestCase
13
7
  def test_terminal_clear
14
-
15
- puts "Running test_terminal_clear..."
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, 'terminal_clear_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, 'TerminalClearTest')
19
+ # setup request object
20
+ request = {}
21
+ request['test'] = true
22
+ request['terminalName'] = 'Test Terminal'
39
23
  response = blockchyp.clear(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
@@ -1,47 +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 TerminalEBTBalanceTest < TestCase
13
7
  def test_terminal_ebt_balance
14
-
15
- puts "Running test_terminal_ebt_balance..."
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, 'terminal_ebt_balance_test', config[:defaultTerminalName])
29
-
30
-
31
-
32
-
33
- # Set request parameters
34
- request = {
35
- test: true,
36
- terminalName: config[:defaultTerminalName],
37
- cardType: CardType::EBT
38
- }
39
-
15
+ blockchyp.gateway_host = config['gatewayHost']
16
+ blockchyp.test_gateway_host = config['testGatewayHost']
17
+
18
+ test_delay(blockchyp, 'TerminalEBTBalanceTest')
19
+ # setup request object
20
+ request = {}
21
+ request['test'] = true
22
+ request['terminalName'] = 'Test Terminal'
23
+ request['cardType'] = CardType::EBT
40
24
  response = blockchyp.balance(request)
25
+
41
26
  assert_not_nil(response)
42
27
  # response assertions
43
- assert(response[:success])
44
- assert(!response[:remainingBalance].empty?)
28
+ assert(response['success'])
29
+ assert(!response['remainingBalance'].empty?)
45
30
  end
31
+
46
32
  end
47
33
  end
@@ -1,59 +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 TerminalEBTChargeTest < TestCase
13
7
  def test_terminal_ebt_charge
14
-
15
- puts "Running test_terminal_ebt_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, 'terminal_ebt_charge_test', config[:defaultTerminalName])
29
-
30
-
31
-
32
-
33
- # Set request parameters
34
- request = {
35
- terminalName: config[:defaultTerminalName],
36
- amount: '25.00',
37
- test: true,
38
- cardType: CardType::EBT
39
- }
40
-
15
+ blockchyp.gateway_host = config['gatewayHost']
16
+ blockchyp.test_gateway_host = config['testGatewayHost']
17
+
18
+ test_delay(blockchyp, 'TerminalEBTChargeTest')
19
+ # setup request object
20
+ request = {}
21
+ request['terminalName'] = 'Test Terminal'
22
+ request['amount'] = '25.00'
23
+ request['test'] = true
24
+ request['cardType'] = CardType::EBT
41
25
  response = blockchyp.charge(request)
26
+
42
27
  assert_not_nil(response)
43
28
  # response assertions
44
- assert(response[:success])
45
- assert(response[:approved])
46
- assert(response[:test])
47
- assert_equal(response[:authCode].length, 6)
48
- assert(!response[:transactionId].empty?)
49
- assert(!response[:timestamp].empty?)
50
- assert(!response[:tickBlock].empty?)
51
- assert_equal('approved', response[:responseDescription])
52
- assert(!response[:paymentType].empty?)
53
- assert(!response[:maskedPan].empty?)
54
- assert(!response[:entryMethod].empty?)
55
- assert_equal('25.00', response[:authorizedAmount])
56
- assert_equal('75.00', response[:remainingBalance])
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.00', response['authorizedAmount'])
40
+ assert_equal('75.00', response['remainingBalance'])
57
41
  end
42
+
58
43
  end
59
44
  end
@@ -1,56 +1,41 @@
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 TerminalEnrollTest < TestCase
13
7
  def test_terminal_enroll
14
-
15
- puts "Running test_terminal_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, 'terminal_enroll_test', config[:defaultTerminalName])
29
-
30
-
31
-
32
-
33
- # Set request parameters
34
- request = {
35
- terminalName: config[:defaultTerminalName],
36
- test: true
37
- }
38
-
15
+ blockchyp.gateway_host = config['gatewayHost']
16
+ blockchyp.test_gateway_host = config['testGatewayHost']
17
+
18
+ test_delay(blockchyp, 'TerminalEnrollTest')
19
+ # setup request object
20
+ request = {}
21
+ request['terminalName'] = 'Test Terminal'
22
+ request['test'] = true
39
23
  response = blockchyp.enroll(request)
24
+
40
25
  assert_not_nil(response)
41
26
  # response assertions
42
- assert(response[:success])
43
- assert(response[:approved])
44
- assert(response[:test])
45
- assert_equal(response[:authCode].length, 6)
46
- assert(!response[:transactionId].empty?)
47
- assert(!response[:timestamp].empty?)
48
- assert(!response[:tickBlock].empty?)
49
- assert_equal('approved', response[:responseDescription])
50
- assert(!response[:paymentType].empty?)
51
- assert(!response[:maskedPan].empty?)
52
- assert(!response[:entryMethod].empty?)
53
- 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(!response['token'].empty?)
54
38
  end
39
+
55
40
  end
56
41
  end