blockchyp 2.0.0.pre.alpha7 → 2.0.1.pre.rc8

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.
@@ -1,5 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # Copyright 2019 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. Changes to this file will be lost
7
+ # every time the code is regenerated.
8
+
3
9
  require ::File.expand_path('test_helper', __dir__)
4
10
 
5
11
  module BlockChyp
@@ -15,16 +21,19 @@ module BlockChyp
15
21
  blockchyp.gateway_host = config['gatewayHost']
16
22
  blockchyp.test_gateway_host = config['testGatewayHost']
17
23
 
18
- test_delay(blockchyp, 'TerminalChargeTest')
24
+ test_delay(blockchyp, 'terminal_charge_test')
25
+
19
26
  # setup request object
20
27
  request = {}
21
28
  request['terminalName'] = 'Test Terminal'
22
29
  request['amount'] = '25.15'
23
30
  request['test'] = true
31
+
24
32
  response = blockchyp.charge(request)
25
33
 
26
34
  assert_not_nil(response)
27
35
  # response assertions
36
+ assert(response['success'])
28
37
  assert(response['approved'])
29
38
  assert(response['test'])
30
39
  assert_equal(response['authCode'].length, 6)
@@ -1,5 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # Copyright 2019 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. Changes to this file will be lost
7
+ # every time the code is regenerated.
8
+
3
9
  require ::File.expand_path('test_helper', __dir__)
4
10
 
5
11
  module BlockChyp
@@ -15,11 +21,13 @@ module BlockChyp
15
21
  blockchyp.gateway_host = config['gatewayHost']
16
22
  blockchyp.test_gateway_host = config['testGatewayHost']
17
23
 
18
- test_delay(blockchyp, 'TerminalClearTest')
24
+ test_delay(blockchyp, 'terminal_clear_test')
25
+
19
26
  # setup request object
20
27
  request = {}
21
28
  request['test'] = true
22
29
  request['terminalName'] = 'Test Terminal'
30
+
23
31
  response = blockchyp.clear(request)
24
32
 
25
33
  assert_not_nil(response)
@@ -1,5 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # Copyright 2019 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. Changes to this file will be lost
7
+ # every time the code is regenerated.
8
+
3
9
  require ::File.expand_path('test_helper', __dir__)
4
10
 
5
11
  module BlockChyp
@@ -15,12 +21,14 @@ module BlockChyp
15
21
  blockchyp.gateway_host = config['gatewayHost']
16
22
  blockchyp.test_gateway_host = config['testGatewayHost']
17
23
 
18
- test_delay(blockchyp, 'TerminalEBTBalanceTest')
24
+ test_delay(blockchyp, 'terminal_ebt_balance_test')
25
+
19
26
  # setup request object
20
27
  request = {}
21
28
  request['test'] = true
22
29
  request['terminalName'] = 'Test Terminal'
23
30
  request['cardType'] = CardType::EBT
31
+
24
32
  response = blockchyp.balance(request)
25
33
 
26
34
  assert_not_nil(response)
@@ -1,5 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # Copyright 2019 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. Changes to this file will be lost
7
+ # every time the code is regenerated.
8
+
3
9
  require ::File.expand_path('test_helper', __dir__)
4
10
 
5
11
  module BlockChyp
@@ -15,17 +21,20 @@ module BlockChyp
15
21
  blockchyp.gateway_host = config['gatewayHost']
16
22
  blockchyp.test_gateway_host = config['testGatewayHost']
17
23
 
18
- test_delay(blockchyp, 'TerminalEBTChargeTest')
24
+ test_delay(blockchyp, 'terminal_ebt_charge_test')
25
+
19
26
  # setup request object
20
27
  request = {}
21
28
  request['terminalName'] = 'Test Terminal'
22
29
  request['amount'] = '25.00'
23
30
  request['test'] = true
24
31
  request['cardType'] = CardType::EBT
32
+
25
33
  response = blockchyp.charge(request)
26
34
 
27
35
  assert_not_nil(response)
28
36
  # response assertions
37
+ assert(response['success'])
29
38
  assert(response['approved'])
30
39
  assert(response['test'])
31
40
  assert_equal(response['authCode'].length, 6)
@@ -1,5 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # Copyright 2019 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. Changes to this file will be lost
7
+ # every time the code is regenerated.
8
+
3
9
  require ::File.expand_path('test_helper', __dir__)
4
10
 
5
11
  module BlockChyp
@@ -15,15 +21,18 @@ module BlockChyp
15
21
  blockchyp.gateway_host = config['gatewayHost']
16
22
  blockchyp.test_gateway_host = config['testGatewayHost']
17
23
 
18
- test_delay(blockchyp, 'TerminalEnrollTest')
24
+ test_delay(blockchyp, 'terminal_enroll_test')
25
+
19
26
  # setup request object
20
27
  request = {}
21
28
  request['terminalName'] = 'Test Terminal'
22
29
  request['test'] = true
30
+
23
31
  response = blockchyp.enroll(request)
24
32
 
25
33
  assert_not_nil(response)
26
34
  # response assertions
35
+ assert(response['success'])
27
36
  assert(response['approved'])
28
37
  assert(response['test'])
29
38
  assert_equal(response['authCode'].length, 6)
@@ -1,5 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # Copyright 2019 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. Changes to this file will be lost
7
+ # every time the code is regenerated.
8
+
3
9
  require ::File.expand_path('test_helper', __dir__)
4
10
 
5
11
  module BlockChyp
@@ -15,11 +21,13 @@ module BlockChyp
15
21
  blockchyp.gateway_host = config['gatewayHost']
16
22
  blockchyp.test_gateway_host = config['testGatewayHost']
17
23
 
18
- test_delay(blockchyp, 'TerminalGiftCardBalanceTest')
24
+ test_delay(blockchyp, 'terminal_gift_card_balance_test')
25
+
19
26
  # setup request object
20
27
  request = {}
21
28
  request['test'] = true
22
29
  request['terminalName'] = 'Test Terminal'
30
+
23
31
  response = blockchyp.balance(request)
24
32
 
25
33
  assert_not_nil(response)
@@ -1,5 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # Copyright 2019 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. Changes to this file will be lost
7
+ # every time the code is regenerated.
8
+
3
9
  require ::File.expand_path('test_helper', __dir__)
4
10
 
5
11
  module BlockChyp
@@ -15,17 +21,20 @@ module BlockChyp
15
21
  blockchyp.gateway_host = config['gatewayHost']
16
22
  blockchyp.test_gateway_host = config['testGatewayHost']
17
23
 
18
- test_delay(blockchyp, 'TerminalKeyedChargeTest')
24
+ test_delay(blockchyp, 'terminal_keyed_charge_test')
25
+
19
26
  # setup request object
20
27
  request = {}
21
28
  request['terminalName'] = 'Test Terminal'
22
29
  request['amount'] = '11.11'
23
30
  request['manualEntry'] = true
24
31
  request['test'] = true
32
+
25
33
  response = blockchyp.charge(request)
26
34
 
27
35
  assert_not_nil(response)
28
36
  # response assertions
37
+ assert(response['success'])
29
38
  assert(response['approved'])
30
39
  assert(response['test'])
31
40
  assert_equal(response['authCode'].length, 6)
@@ -1,5 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # Copyright 2019 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. Changes to this file will be lost
7
+ # every time the code is regenerated.
8
+
3
9
  require ::File.expand_path('test_helper', __dir__)
4
10
 
5
11
  module BlockChyp
@@ -15,7 +21,8 @@ module BlockChyp
15
21
  blockchyp.gateway_host = config['gatewayHost']
16
22
  blockchyp.test_gateway_host = config['testGatewayHost']
17
23
 
18
- test_delay(blockchyp, 'TerminalManualEBTChargeTest')
24
+ test_delay(blockchyp, 'terminal_manual_ebt_charge_test')
25
+
19
26
  # setup request object
20
27
  request = {}
21
28
  request['terminalName'] = 'Test Terminal'
@@ -23,10 +30,12 @@ module BlockChyp
23
30
  request['test'] = true
24
31
  request['cardType'] = CardType::EBT
25
32
  request['manualEntry'] = true
33
+
26
34
  response = blockchyp.charge(request)
27
35
 
28
36
  assert_not_nil(response)
29
37
  # response assertions
38
+ assert(response['success'])
30
39
  assert(response['approved'])
31
40
  assert(response['test'])
32
41
  assert_equal(response['authCode'].length, 6)
@@ -1,5 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # Copyright 2019 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. Changes to this file will be lost
7
+ # every time the code is regenerated.
8
+
3
9
  require ::File.expand_path('test_helper', __dir__)
4
10
 
5
11
  module BlockChyp
@@ -15,16 +21,19 @@ module BlockChyp
15
21
  blockchyp.gateway_host = config['gatewayHost']
16
22
  blockchyp.test_gateway_host = config['testGatewayHost']
17
23
 
18
- test_delay(blockchyp, 'TerminalPreauthTest')
24
+ test_delay(blockchyp, 'terminal_preauth_test')
25
+
19
26
  # setup request object
20
27
  request = {}
21
28
  request['terminalName'] = 'Test Terminal'
22
29
  request['amount'] = '15.15'
23
30
  request['test'] = true
31
+
24
32
  response = blockchyp.preauth(request)
25
33
 
26
34
  assert_not_nil(response)
27
35
  # response assertions
36
+ assert(response['success'])
28
37
  assert(response['approved'])
29
38
  assert(response['test'])
30
39
  assert_equal(response['authCode'].length, 6)
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2019 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. Changes to this file will be lost
7
+ # every time the code is regenerated.
8
+
9
+ require ::File.expand_path('test_helper', __dir__)
10
+
11
+ module BlockChyp
12
+ class TerminalStatusTest < TestCase
13
+ def test_terminal_status
14
+ config = load_test_config
15
+
16
+ blockchyp = BlockChyp.new(
17
+ config['apiKey'],
18
+ config['bearerToken'],
19
+ config['signingKey']
20
+ )
21
+ blockchyp.gateway_host = config['gatewayHost']
22
+ blockchyp.test_gateway_host = config['testGatewayHost']
23
+
24
+ test_delay(blockchyp, 'terminal_status_test')
25
+
26
+ # setup request object
27
+ request = {}
28
+ request['terminalName'] = 'Test Terminal'
29
+
30
+ response = blockchyp.terminal_status(request)
31
+
32
+ assert_not_nil(response)
33
+ # response assertions
34
+ assert(response['success'])
35
+ assert(response['idle'])
36
+ end
37
+
38
+ end
39
+ end
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2019 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. Changes to this file will be lost
7
+ # every time the code is regenerated.
8
+
9
+ require ::File.expand_path('test_helper', __dir__)
10
+
11
+ module BlockChyp
12
+ class TerminalTimeoutTest < TestCase
13
+ def test_terminal_timeout
14
+ config = load_test_config
15
+
16
+ blockchyp = BlockChyp.new(
17
+ config['apiKey'],
18
+ config['bearerToken'],
19
+ config['signingKey']
20
+ )
21
+ blockchyp.gateway_host = config['gatewayHost']
22
+ blockchyp.test_gateway_host = config['testGatewayHost']
23
+
24
+ test_delay(blockchyp, 'terminal_timeout_test')
25
+
26
+ # setup request object
27
+ request = {}
28
+ request['timeout'] = 1
29
+ request['terminalName'] = 'Test Terminal'
30
+ request['amount'] = '25.15'
31
+ request['test'] = true
32
+
33
+ assert_raise Net::ReadTimeout do
34
+ blockchyp.charge(request)
35
+ end
36
+ end
37
+
38
+ end
39
+ end
@@ -1,5 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # Copyright 2019 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. Changes to this file will be lost
7
+ # every time the code is regenerated.
8
+
3
9
  require ::File.expand_path('test_helper', __dir__)
4
10
 
5
11
  module BlockChyp
@@ -15,7 +21,8 @@ module BlockChyp
15
21
  blockchyp.gateway_host = config['gatewayHost']
16
22
  blockchyp.test_gateway_host = config['testGatewayHost']
17
23
 
18
- test_delay(blockchyp, 'TermsAndConditionsTest')
24
+ test_delay(blockchyp, 'terms_and_conditions_test')
25
+
19
26
  # setup request object
20
27
  request = {}
21
28
  request['test'] = true
@@ -25,7 +32,8 @@ module BlockChyp
25
32
  request['sigFormat'] = SignatureFormat::PNG
26
33
  request['sigWidth'] = 200
27
34
  request['sigRequired'] = true
28
- response = blockchyp.termsAndConditions(request)
35
+
36
+ response = blockchyp.terms_and_conditions(request)
29
37
 
30
38
  assert_not_nil(response)
31
39
  # response assertions
data/test/test_helper.rb CHANGED
@@ -39,7 +39,7 @@ module BlockChyp
39
39
 
40
40
  if test_delay
41
41
  test_delay_int = Integer(test_delay)
42
- if test_delay_int.positive
42
+ if test_delay_int.positive?
43
43
  request = {}
44
44
  request['test'] = true
45
45
  request['terminalName'] = 'Test Terminal'
@@ -1,5 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # Copyright 2019 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. Changes to this file will be lost
7
+ # every time the code is regenerated.
8
+
3
9
  require ::File.expand_path('test_helper', __dir__)
4
10
 
5
11
  module BlockChyp
@@ -15,13 +21,15 @@ module BlockChyp
15
21
  blockchyp.gateway_host = config['gatewayHost']
16
22
  blockchyp.test_gateway_host = config['testGatewayHost']
17
23
 
18
- test_delay(blockchyp, 'TextPromptTest')
24
+ test_delay(blockchyp, 'text_prompt_test')
25
+
19
26
  # setup request object
20
27
  request = {}
21
28
  request['test'] = true
22
29
  request['terminalName'] = 'Test Terminal'
23
30
  request['promptType'] = PromptType::EMAIL
24
- response = blockchyp.textPrompt(request)
31
+
32
+ response = blockchyp.text_prompt(request)
25
33
 
26
34
  assert_not_nil(response)
27
35
  # response assertions
@@ -1,5 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # Copyright 2019 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. Changes to this file will be lost
7
+ # every time the code is regenerated.
8
+
3
9
  require ::File.expand_path('test_helper', __dir__)
4
10
 
5
11
  module BlockChyp
@@ -15,13 +21,15 @@ module BlockChyp
15
21
  blockchyp.gateway_host = config['gatewayHost']
16
22
  blockchyp.test_gateway_host = config['testGatewayHost']
17
23
 
18
- test_delay(blockchyp, 'UpdateTransactionDisplayTest')
24
+ test_delay(blockchyp, 'update_transaction_display_test')
25
+
19
26
  # setup request object
20
27
  request = {}
21
28
  request['test'] = true
22
29
  request['terminalName'] = 'Test Terminal'
23
30
  request['transaction'] = new_transaction_display_transaction
24
- response = blockchyp.updateTransactionDisplay(request)
31
+
32
+ response = blockchyp.update_transaction_display(request)
25
33
 
26
34
  assert_not_nil(response)
27
35
  # response assertions