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.
- checksums.yaml +4 -4
- data/Makefile +1 -41
- data/README.md +441 -3551
- data/lib/blockchyp/version.rb +1 -1
- data/lib/blockchyp.rb +41 -366
- data/lib/blockchyp_client.rb +125 -207
- data/test/boolean_prompt_test.rb +18 -32
- data/test/heartbeat_test.rb +10 -10
- data/test/new_transaction_display_test.rb +50 -44
- data/test/pan_charge_test.rb +27 -44
- data/test/pan_enroll_test.rb +25 -45
- data/test/pan_preauth_test.rb +26 -43
- data/test/simple_batch_close_test.rb +23 -37
- data/test/simple_capture_test.rb +21 -38
- data/test/simple_gift_activate_test.rb +15 -30
- data/test/simple_message_test.rb +15 -29
- data/test/simple_ping_test.rb +14 -28
- data/test/simple_refund_test.rb +22 -40
- data/test/simple_reversal_test.rb +22 -39
- data/test/simple_void_test.rb +22 -39
- data/test/terminal_charge_test.rb +25 -40
- data/test/terminal_clear_test.rb +14 -28
- data/test/terminal_ebt_balance_test.rb +16 -30
- data/test/terminal_ebt_charge_test.rb +27 -42
- data/test/terminal_enroll_test.rb +24 -39
- data/test/terminal_gift_card_balance_test.rb +15 -29
- data/test/terminal_keyed_charge_test.rb +26 -41
- data/test/terminal_manual_ebt_charge_test.rb +28 -43
- data/test/terminal_preauth_test.rb +25 -40
- data/test/terms_and_conditions_test.rb +19 -33
- data/test/test_helper.rb +10 -9
- data/test/text_prompt_test.rb +15 -29
- data/test/update_transaction_display_test.rb +50 -44
- metadata +5 -64
- data/test/activate_terminal_test.rb +0 -45
- data/test/add_test_merchant_test.rb +0 -56
- data/test/batch_history_test.rb +0 -54
- data/test/cancel_payment_link_test.rb +0 -72
- data/test/capture_signature_test.rb +0 -46
- data/test/deactivate_terminal_test.rb +0 -42
- data/test/delete_branding_asset_test.rb +0 -50
- data/test/delete_customer_test.rb +0 -55
- data/test/delete_media_asset_test.rb +0 -53
- data/test/delete_queued_transaction_test.rb +0 -56
- data/test/delete_slide_show_test.rb +0 -50
- data/test/delete_survey_question_test.rb +0 -51
- data/test/delete_test_merchant_test.rb +0 -59
- data/test/delete_token_test.rb +0 -55
- data/test/empty_branding_asset_test.rb +0 -44
- data/test/empty_slide_show_test.rb +0 -45
- data/test/gateway_timeout_test.rb +0 -49
- data/test/get_customer_test.rb +0 -55
- data/test/get_merchants_test.rb +0 -52
- data/test/invite_merchant_user_test.rb +0 -45
- data/test/link_token_test.rb +0 -56
- data/test/list_queued_transactions_test.rb +0 -55
- data/test/list_terminals_test.rb +0 -42
- data/test/media_asset_test.rb +0 -57
- data/test/media_test.rb +0 -42
- data/test/media_upload_test.rb +0 -52
- data/test/merchant_platforms_test.rb +0 -59
- data/test/merchant_profile_test.rb +0 -43
- data/test/merchant_users_test.rb +0 -42
- data/test/partial_refund_test.rb +0 -58
- data/test/search_customer_test.rb +0 -55
- data/test/send_payment_link_test.rb +0 -67
- data/test/simple_locate_test.rb +0 -44
- data/test/slide_show_test.rb +0 -51
- data/test/slide_shows_test.rb +0 -49
- data/test/survey_question_test.rb +0 -48
- data/test/survey_questions_test.rb +0 -50
- data/test/survey_results_test.rb +0 -48
- data/test/tc_delete_template_test.rb +0 -51
- data/test/tc_entry_test.rb +0 -56
- data/test/tc_log_test.rb +0 -42
- data/test/tc_template_test.rb +0 -53
- data/test/tc_template_update_test.rb +0 -48
- data/test/tc_templates_test.rb +0 -42
- data/test/terminal_branding_test.rb +0 -42
- data/test/terminal_queued_transaction_test.rb +0 -51
- data/test/terminal_status_test.rb +0 -45
- data/test/terminal_timeout_test.rb +0 -46
- data/test/testdata/aviato.png +0 -0
- data/test/token_metadata_test.rb +0 -55
- data/test/transaction_history_test.rb +0 -54
- data/test/unlink_token_test.rb +0 -56
- data/test/update_branding_asset_test.rb +0 -62
- data/test/update_customer_test.rb +0 -49
- data/test/update_merchant_platforms_test.rb +0 -61
- data/test/update_merchant_test.rb +0 -60
- data/test/update_slide_show_test.rb +0 -60
- data/test/update_survey_question_test.rb +0 -47
- data/test/upload_status_test.rb +0 -53
data/test/simple_refund_test.rb
CHANGED
@@ -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[
|
21
|
-
config[
|
22
|
-
config[
|
11
|
+
config['apiKey'],
|
12
|
+
config['bearerToken'],
|
13
|
+
config['signingKey']
|
23
14
|
)
|
24
|
-
blockchyp.gateway_host = config[
|
25
|
-
blockchyp.test_gateway_host = config[
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
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[
|
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[
|
21
|
-
config[
|
22
|
-
config[
|
11
|
+
config['apiKey'],
|
12
|
+
config['bearerToken'],
|
13
|
+
config['signingKey']
|
23
14
|
)
|
24
|
-
blockchyp.gateway_host = config[
|
25
|
-
blockchyp.test_gateway_host = config[
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
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[
|
53
|
-
assert(response[:approved])
|
35
|
+
assert(response['approved'])
|
54
36
|
end
|
37
|
+
|
55
38
|
end
|
56
39
|
end
|
data/test/simple_void_test.rb
CHANGED
@@ -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[
|
21
|
-
config[
|
22
|
-
config[
|
11
|
+
config['apiKey'],
|
12
|
+
config['bearerToken'],
|
13
|
+
config['signingKey']
|
23
14
|
)
|
24
|
-
blockchyp.gateway_host = config[
|
25
|
-
blockchyp.test_gateway_host = config[
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
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[
|
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[
|
21
|
-
config[
|
22
|
-
config[
|
11
|
+
config['apiKey'],
|
12
|
+
config['bearerToken'],
|
13
|
+
config['signingKey']
|
23
14
|
)
|
24
|
-
blockchyp.gateway_host = config[
|
25
|
-
blockchyp.test_gateway_host = config[
|
26
|
-
|
27
|
-
|
28
|
-
|
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[
|
44
|
-
assert(response[
|
45
|
-
|
46
|
-
|
47
|
-
assert(!response[
|
48
|
-
assert(!response[
|
49
|
-
|
50
|
-
|
51
|
-
assert(!response[
|
52
|
-
assert(!response[
|
53
|
-
|
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
|
data/test/terminal_clear_test.rb
CHANGED
@@ -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[
|
21
|
-
config[
|
22
|
-
config[
|
11
|
+
config['apiKey'],
|
12
|
+
config['bearerToken'],
|
13
|
+
config['signingKey']
|
23
14
|
)
|
24
|
-
blockchyp.gateway_host = config[
|
25
|
-
blockchyp.test_gateway_host = config[
|
26
|
-
|
27
|
-
|
28
|
-
|
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[
|
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[
|
21
|
-
config[
|
22
|
-
config[
|
11
|
+
config['apiKey'],
|
12
|
+
config['bearerToken'],
|
13
|
+
config['signingKey']
|
23
14
|
)
|
24
|
-
blockchyp.gateway_host = config[
|
25
|
-
blockchyp.test_gateway_host = config[
|
26
|
-
|
27
|
-
|
28
|
-
|
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[
|
44
|
-
assert(!response[
|
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[
|
21
|
-
config[
|
22
|
-
config[
|
11
|
+
config['apiKey'],
|
12
|
+
config['bearerToken'],
|
13
|
+
config['signingKey']
|
23
14
|
)
|
24
|
-
blockchyp.gateway_host = config[
|
25
|
-
blockchyp.test_gateway_host = config[
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
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[
|
45
|
-
assert(response[
|
46
|
-
|
47
|
-
|
48
|
-
assert(!response[
|
49
|
-
assert(!response[
|
50
|
-
|
51
|
-
|
52
|
-
assert(!response[
|
53
|
-
assert(!response[
|
54
|
-
|
55
|
-
assert_equal('
|
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[
|
21
|
-
config[
|
22
|
-
config[
|
11
|
+
config['apiKey'],
|
12
|
+
config['bearerToken'],
|
13
|
+
config['signingKey']
|
23
14
|
)
|
24
|
-
blockchyp.gateway_host = config[
|
25
|
-
blockchyp.test_gateway_host = config[
|
26
|
-
|
27
|
-
|
28
|
-
|
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[
|
43
|
-
assert(response[
|
44
|
-
|
45
|
-
|
46
|
-
assert(!response[
|
47
|
-
assert(!response[
|
48
|
-
|
49
|
-
|
50
|
-
assert(!response[
|
51
|
-
assert(!response[
|
52
|
-
assert(!response[
|
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
|