blockchyp 2.0.0.pre.alpha7 → 2.0.1.pre.rc8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Makefile +33 -0
- data/README.md +136 -161
- data/lib/blockchyp.rb +32 -21
- data/lib/blockchyp/version.rb +1 -1
- data/lib/blockchyp_client.rb +93 -83
- data/test/boolean_prompt_test.rb +10 -2
- data/test/gateway_timeout_test.rb +40 -0
- data/test/heartbeat_test.rb +2 -2
- data/test/new_transaction_display_test.rb +10 -2
- data/test/pan_charge_test.rb +10 -1
- data/test/pan_enroll_test.rb +10 -1
- data/test/pan_preauth_test.rb +10 -1
- data/test/simple_batch_close_test.rb +10 -2
- data/test/simple_capture_test.rb +10 -1
- data/test/simple_gift_activate_test.rb +11 -2
- data/test/simple_message_test.rb +9 -1
- data/test/simple_ping_test.rb +9 -1
- data/test/simple_refund_test.rb +10 -1
- data/test/simple_reversal_test.rb +10 -1
- data/test/simple_void_test.rb +10 -1
- data/test/terminal_charge_test.rb +10 -1
- data/test/terminal_clear_test.rb +9 -1
- data/test/terminal_ebt_balance_test.rb +9 -1
- data/test/terminal_ebt_charge_test.rb +10 -1
- data/test/terminal_enroll_test.rb +10 -1
- data/test/terminal_gift_card_balance_test.rb +9 -1
- data/test/terminal_keyed_charge_test.rb +10 -1
- data/test/terminal_manual_ebt_charge_test.rb +10 -1
- data/test/terminal_preauth_test.rb +10 -1
- data/test/terminal_status_test.rb +39 -0
- data/test/terminal_timeout_test.rb +39 -0
- data/test/terms_and_conditions_test.rb +10 -2
- data/test/test_helper.rb +1 -1
- data/test/text_prompt_test.rb +10 -2
- data/test/update_transaction_display_test.rb +10 -2
- metadata +5 -2
@@ -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, '
|
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)
|
data/test/terminal_clear_test.rb
CHANGED
@@ -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, '
|
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, '
|
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, '
|
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, '
|
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, '
|
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, '
|
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, '
|
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, '
|
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, '
|
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
|
-
|
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
data/test/text_prompt_test.rb
CHANGED
@@ -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, '
|
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
|
-
|
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, '
|
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
|
-
|
31
|
+
|
32
|
+
response = blockchyp.update_transaction_display(request)
|
25
33
|
|
26
34
|
assert_not_nil(response)
|
27
35
|
# response assertions
|