blockchyp 1.16.1

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.
Files changed (97) hide show
  1. checksums.yaml +7 -0
  2. data/Makefile +78 -0
  3. data/README.md +4023 -0
  4. data/Rakefile +39 -0
  5. data/lib/blockchyp/version.rb +5 -0
  6. data/lib/blockchyp.rb +478 -0
  7. data/lib/blockchyp_client.rb +416 -0
  8. data/lib/crypto_utils.rb +25 -0
  9. data/test/activate_terminal_test.rb +45 -0
  10. data/test/add_test_merchant_test.rb +56 -0
  11. data/test/batch_history_test.rb +54 -0
  12. data/test/boolean_prompt_test.rb +49 -0
  13. data/test/cancel_payment_link_test.rb +72 -0
  14. data/test/capture_signature_test.rb +46 -0
  15. data/test/deactivate_terminal_test.rb +42 -0
  16. data/test/delete_branding_asset_test.rb +50 -0
  17. data/test/delete_customer_test.rb +55 -0
  18. data/test/delete_media_asset_test.rb +53 -0
  19. data/test/delete_queued_transaction_test.rb +56 -0
  20. data/test/delete_slide_show_test.rb +50 -0
  21. data/test/delete_survey_question_test.rb +51 -0
  22. data/test/delete_test_merchant_test.rb +59 -0
  23. data/test/delete_token_test.rb +55 -0
  24. data/test/empty_branding_asset_test.rb +44 -0
  25. data/test/empty_slide_show_test.rb +45 -0
  26. data/test/gateway_timeout_test.rb +49 -0
  27. data/test/get_customer_test.rb +55 -0
  28. data/test/get_merchants_test.rb +52 -0
  29. data/test/heartbeat_test.rb +27 -0
  30. data/test/invite_merchant_user_test.rb +45 -0
  31. data/test/link_token_test.rb +56 -0
  32. data/test/list_queued_transactions_test.rb +55 -0
  33. data/test/list_terminals_test.rb +42 -0
  34. data/test/media_asset_test.rb +57 -0
  35. data/test/media_test.rb +42 -0
  36. data/test/media_upload_test.rb +52 -0
  37. data/test/merchant_platforms_test.rb +59 -0
  38. data/test/merchant_profile_test.rb +43 -0
  39. data/test/merchant_users_test.rb +42 -0
  40. data/test/new_transaction_display_test.rb +64 -0
  41. data/test/pan_charge_test.rb +61 -0
  42. data/test/pan_enroll_test.rb +62 -0
  43. data/test/pan_preauth_test.rb +60 -0
  44. data/test/partial_refund_test.rb +58 -0
  45. data/test/payment_link_status_test.rb +72 -0
  46. data/test/resend_payment_link_test.rb +49 -0
  47. data/test/search_customer_test.rb +55 -0
  48. data/test/send_payment_link_test.rb +67 -0
  49. data/test/simple_batch_close_test.rb +54 -0
  50. data/test/simple_capture_test.rb +55 -0
  51. data/test/simple_gift_activate_test.rb +48 -0
  52. data/test/simple_locate_test.rb +44 -0
  53. data/test/simple_message_test.rb +46 -0
  54. data/test/simple_ping_test.rb +45 -0
  55. data/test/simple_refund_test.rb +57 -0
  56. data/test/simple_reversal_test.rb +56 -0
  57. data/test/simple_void_test.rb +56 -0
  58. data/test/slide_show_test.rb +51 -0
  59. data/test/slide_shows_test.rb +49 -0
  60. data/test/survey_question_test.rb +48 -0
  61. data/test/survey_questions_test.rb +50 -0
  62. data/test/survey_results_test.rb +48 -0
  63. data/test/tc_delete_template_test.rb +51 -0
  64. data/test/tc_entry_test.rb +56 -0
  65. data/test/tc_log_test.rb +42 -0
  66. data/test/tc_template_test.rb +53 -0
  67. data/test/tc_template_update_test.rb +48 -0
  68. data/test/tc_templates_test.rb +42 -0
  69. data/test/terminal_branding_test.rb +42 -0
  70. data/test/terminal_charge_test.rb +57 -0
  71. data/test/terminal_clear_test.rb +45 -0
  72. data/test/terminal_ebt_balance_test.rb +47 -0
  73. data/test/terminal_ebt_charge_test.rb +59 -0
  74. data/test/terminal_enroll_test.rb +56 -0
  75. data/test/terminal_gift_card_balance_test.rb +46 -0
  76. data/test/terminal_keyed_charge_test.rb +58 -0
  77. data/test/terminal_manual_ebt_charge_test.rb +60 -0
  78. data/test/terminal_preauth_test.rb +57 -0
  79. data/test/terminal_queued_transaction_test.rb +51 -0
  80. data/test/terminal_status_test.rb +45 -0
  81. data/test/terminal_timeout_test.rb +46 -0
  82. data/test/terms_and_conditions_test.rb +50 -0
  83. data/test/test_helper.rb +64 -0
  84. data/test/testdata/aviato.png +0 -0
  85. data/test/text_prompt_test.rb +47 -0
  86. data/test/token_metadata_test.rb +55 -0
  87. data/test/transaction_history_test.rb +54 -0
  88. data/test/unlink_token_test.rb +56 -0
  89. data/test/update_branding_asset_test.rb +62 -0
  90. data/test/update_customer_test.rb +49 -0
  91. data/test/update_merchant_platforms_test.rb +61 -0
  92. data/test/update_merchant_test.rb +60 -0
  93. data/test/update_slide_show_test.rb +60 -0
  94. data/test/update_survey_question_test.rb +47 -0
  95. data/test/update_transaction_display_test.rb +64 -0
  96. data/test/upload_status_test.rb +53 -0
  97. metadata +138 -0
@@ -0,0 +1,56 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2019-2023 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
+ require ::File.expand_path('test_helper', __dir__)
10
+
11
+ module BlockChyp
12
+ class TCEntryTest < TestCase
13
+ def test_tc_entry
14
+
15
+ puts "Running test_tc_entry..."
16
+
17
+ config = load_test_config
18
+
19
+ blockchyp = BlockChyp.new(
20
+ config[:apiKey],
21
+ config[:bearerToken],
22
+ config[:signingKey]
23
+ )
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
+ }
35
+ response = blockchyp.tc_log(setup_request)
36
+
37
+ # Set request parameters
38
+ request = {
39
+ logEntryId: response[:results][0][:id]
40
+ }
41
+
42
+ response = blockchyp.tc_entry(request)
43
+ assert_not_nil(response)
44
+ # response assertions
45
+ assert(response[:success])
46
+ assert(!response[:id].empty?)
47
+ assert(!response[:terminalId].empty?)
48
+ assert(!response[:terminalName].empty?)
49
+ assert(!response[:timestamp].empty?)
50
+ assert(!response[:name].empty?)
51
+ assert(!response[:content].empty?)
52
+ assert(response[:hasSignature])
53
+ assert(!response[:signature].empty?)
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2019-2023 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
+ require ::File.expand_path('test_helper', __dir__)
10
+
11
+ module BlockChyp
12
+ class TCLogTest < TestCase
13
+ def test_tc_log
14
+
15
+ puts "Running test_tc_log..."
16
+
17
+ config = load_test_config
18
+
19
+ blockchyp = BlockChyp.new(
20
+ config[:apiKey],
21
+ config[:bearerToken],
22
+ config[:signingKey]
23
+ )
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
+ request = {
34
+ }
35
+
36
+ response = blockchyp.tc_log(request)
37
+ assert_not_nil(response)
38
+ # response assertions
39
+ assert(response[:success])
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,53 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2019-2023 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
+ require ::File.expand_path('test_helper', __dir__)
10
+
11
+ module BlockChyp
12
+ class TCTemplateTest < TestCase
13
+ def test_tc_template
14
+
15
+ puts "Running test_tc_template..."
16
+
17
+ config = load_test_config
18
+
19
+ blockchyp = BlockChyp.new(
20
+ config[:apiKey],
21
+ config[:bearerToken],
22
+ config[:signingKey]
23
+ )
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
+ alias: uuid,
35
+ name: 'HIPPA Disclosure',
36
+ content: 'Lorem ipsum dolor sit amet.'
37
+ }
38
+ response = blockchyp.tc_update_template(setup_request)
39
+
40
+ # Set request parameters
41
+ request = {
42
+ templateId: response[:id]
43
+ }
44
+
45
+ response = blockchyp.tc_template(request)
46
+ assert_not_nil(response)
47
+ # response assertions
48
+ assert(response[:success])
49
+ assert_equal('HIPPA Disclosure', response[:name])
50
+ assert_equal('Lorem ipsum dolor sit amet.', response[:content])
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2019-2023 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
+ require ::File.expand_path('test_helper', __dir__)
10
+
11
+ module BlockChyp
12
+ class TCTemplateUpdateTest < TestCase
13
+ def test_tc_template_update
14
+
15
+ puts "Running test_tc_template_update..."
16
+
17
+ config = load_test_config
18
+
19
+ blockchyp = BlockChyp.new(
20
+ config[:apiKey],
21
+ config[:bearerToken],
22
+ config[:signingKey]
23
+ )
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
+ request = {
34
+ alias: uuid,
35
+ name: 'HIPPA Disclosure',
36
+ content: 'Lorem ipsum dolor sit amet.'
37
+ }
38
+
39
+ response = blockchyp.tc_update_template(request)
40
+ assert_not_nil(response)
41
+ # response assertions
42
+ assert(response[:success])
43
+ assert(!response[:alias].empty?)
44
+ assert_equal('HIPPA Disclosure', response[:name])
45
+ assert_equal('Lorem ipsum dolor sit amet.', response[:content])
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2019-2023 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
+ require ::File.expand_path('test_helper', __dir__)
10
+
11
+ module BlockChyp
12
+ class TCTemplatesTest < TestCase
13
+ def test_tc_templates
14
+
15
+ puts "Running test_tc_templates..."
16
+
17
+ config = load_test_config
18
+
19
+ blockchyp = BlockChyp.new(
20
+ config[:apiKey],
21
+ config[:bearerToken],
22
+ config[:signingKey]
23
+ )
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
+ request = {
34
+ }
35
+
36
+ response = blockchyp.tc_templates(request)
37
+ assert_not_nil(response)
38
+ # response assertions
39
+ assert(response[:success])
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2019-2023 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
+ require ::File.expand_path('test_helper', __dir__)
10
+
11
+ module BlockChyp
12
+ class TerminalBrandingTest < TestCase
13
+ def test_terminal_branding
14
+
15
+ puts "Running test_terminal_branding..."
16
+
17
+ config = load_test_config
18
+
19
+ blockchyp = BlockChyp.new(
20
+ config[:apiKey],
21
+ config[:bearerToken],
22
+ config[:signingKey]
23
+ )
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
+ request = {
34
+ }
35
+
36
+ response = blockchyp.terminal_branding(request)
37
+ assert_not_nil(response)
38
+ # response assertions
39
+ assert(response[:success])
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,57 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2019-2023 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
+ require ::File.expand_path('test_helper', __dir__)
10
+
11
+ module BlockChyp
12
+ class TerminalChargeTest < TestCase
13
+ def test_terminal_charge
14
+
15
+ puts "Running test_terminal_charge..."
16
+
17
+ config = load_test_config
18
+
19
+ blockchyp = BlockChyp.new(
20
+ config[:apiKey],
21
+ config[:bearerToken],
22
+ config[:signingKey]
23
+ )
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
+
40
+ response = blockchyp.charge(request)
41
+ assert_not_nil(response)
42
+ # 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])
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2019-2023 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
+ require ::File.expand_path('test_helper', __dir__)
10
+
11
+ module BlockChyp
12
+ class TerminalClearTest < TestCase
13
+ def test_terminal_clear
14
+
15
+ puts "Running test_terminal_clear..."
16
+
17
+ config = load_test_config
18
+
19
+ blockchyp = BlockChyp.new(
20
+ config[:apiKey],
21
+ config[:bearerToken],
22
+ config[:signingKey]
23
+ )
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
+
39
+ response = blockchyp.clear(request)
40
+ assert_not_nil(response)
41
+ # response assertions
42
+ assert(response[:success])
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2019-2023 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
+ require ::File.expand_path('test_helper', __dir__)
10
+
11
+ module BlockChyp
12
+ class TerminalEBTBalanceTest < TestCase
13
+ def test_terminal_ebt_balance
14
+
15
+ puts "Running test_terminal_ebt_balance..."
16
+
17
+ config = load_test_config
18
+
19
+ blockchyp = BlockChyp.new(
20
+ config[:apiKey],
21
+ config[:bearerToken],
22
+ config[:signingKey]
23
+ )
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
+
40
+ response = blockchyp.balance(request)
41
+ assert_not_nil(response)
42
+ # response assertions
43
+ assert(response[:success])
44
+ assert(!response[:remainingBalance].empty?)
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,59 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2019-2023 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
+ require ::File.expand_path('test_helper', __dir__)
10
+
11
+ module BlockChyp
12
+ class TerminalEBTChargeTest < TestCase
13
+ def test_terminal_ebt_charge
14
+
15
+ puts "Running test_terminal_ebt_charge..."
16
+
17
+ config = load_test_config
18
+
19
+ blockchyp = BlockChyp.new(
20
+ config[:apiKey],
21
+ config[:bearerToken],
22
+ config[:signingKey]
23
+ )
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
+
41
+ response = blockchyp.charge(request)
42
+ assert_not_nil(response)
43
+ # 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])
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,56 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2019-2023 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
+ require ::File.expand_path('test_helper', __dir__)
10
+
11
+ module BlockChyp
12
+ class TerminalEnrollTest < TestCase
13
+ def test_terminal_enroll
14
+
15
+ puts "Running test_terminal_enroll..."
16
+
17
+ config = load_test_config
18
+
19
+ blockchyp = BlockChyp.new(
20
+ config[:apiKey],
21
+ config[:bearerToken],
22
+ config[:signingKey]
23
+ )
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
+
39
+ response = blockchyp.enroll(request)
40
+ assert_not_nil(response)
41
+ # 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?)
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2019-2023 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
+ require ::File.expand_path('test_helper', __dir__)
10
+
11
+ module BlockChyp
12
+ class TerminalGiftCardBalanceTest < TestCase
13
+ def test_terminal_gift_card_balance
14
+
15
+ puts "Running test_terminal_gift_card_balance..."
16
+
17
+ config = load_test_config
18
+
19
+ blockchyp = BlockChyp.new(
20
+ config[:apiKey],
21
+ config[:bearerToken],
22
+ config[:signingKey]
23
+ )
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_gift_card_balance_test', config[:defaultTerminalName])
29
+
30
+
31
+
32
+
33
+ # Set request parameters
34
+ request = {
35
+ test: true,
36
+ terminalName: config[:defaultTerminalName]
37
+ }
38
+
39
+ response = blockchyp.balance(request)
40
+ assert_not_nil(response)
41
+ # response assertions
42
+ assert(response[:success])
43
+ assert(!response[:remainingBalance].empty?)
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,58 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2019-2023 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
+ require ::File.expand_path('test_helper', __dir__)
10
+
11
+ module BlockChyp
12
+ class TerminalKeyedChargeTest < TestCase
13
+ def test_terminal_keyed_charge
14
+
15
+ puts "Running test_terminal_keyed_charge..."
16
+
17
+ config = load_test_config
18
+
19
+ blockchyp = BlockChyp.new(
20
+ config[:apiKey],
21
+ config[:bearerToken],
22
+ config[:signingKey]
23
+ )
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_keyed_charge_test', config[:defaultTerminalName])
29
+
30
+
31
+
32
+
33
+ # Set request parameters
34
+ request = {
35
+ terminalName: config[:defaultTerminalName],
36
+ amount: '11.11',
37
+ manualEntry: true,
38
+ test: true
39
+ }
40
+
41
+ response = blockchyp.charge(request)
42
+ assert_not_nil(response)
43
+ # 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('11.11', response[:authorizedAmount])
56
+ end
57
+ end
58
+ end