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/pan_charge_test.rb
CHANGED
@@ -1,61 +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 PANChargeTest < TestCase
|
13
7
|
def test_pan_charge
|
14
|
-
|
15
|
-
puts "Running test_pan_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
|
-
pan: '4111111111111111',
|
36
|
-
expMonth: '12',
|
37
|
-
expYear: '2025',
|
38
|
-
amount: '25.55',
|
39
|
-
test: true,
|
40
|
-
transactionRef: uuid
|
41
|
-
}
|
42
|
-
|
15
|
+
blockchyp.gateway_host = config['gatewayHost']
|
16
|
+
blockchyp.test_gateway_host = config['testGatewayHost']
|
17
|
+
|
18
|
+
test_delay(blockchyp, 'PANChargeTest')
|
19
|
+
# setup request object
|
20
|
+
request = {}
|
21
|
+
request['pan'] = '4111111111111111'
|
22
|
+
request['amount'] = '25.55'
|
23
|
+
request['test'] = true
|
24
|
+
request['transactionRef'] = uuid
|
43
25
|
response = blockchyp.charge(request)
|
26
|
+
|
44
27
|
assert_not_nil(response)
|
45
28
|
# response assertions
|
46
|
-
assert(response[
|
47
|
-
assert(response[
|
48
|
-
|
49
|
-
|
50
|
-
assert(!response[
|
51
|
-
assert(!response[
|
52
|
-
|
53
|
-
|
54
|
-
assert(!response[
|
55
|
-
assert(!response[
|
56
|
-
|
57
|
-
assert_equal('
|
58
|
-
assert_equal('KEYED', response[:entryMethod])
|
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.55', response['authorizedAmount'])
|
40
|
+
assert_equal('KEYED', response['entryMethod'])
|
59
41
|
end
|
42
|
+
|
60
43
|
end
|
61
44
|
end
|
data/test/pan_enroll_test.rb
CHANGED
@@ -1,62 +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 PANEnrollTest < TestCase
|
13
7
|
def test_pan_enroll
|
14
|
-
|
15
|
-
puts "Running test_pan_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
|
-
pan: '4111111111111111',
|
36
|
-
test: true,
|
37
|
-
customer: {
|
38
|
-
customerRef: 'TESTCUSTOMER',
|
39
|
-
firstName: 'Test',
|
40
|
-
lastName: 'Customer'
|
41
|
-
}
|
42
|
-
}
|
43
|
-
|
15
|
+
blockchyp.gateway_host = config['gatewayHost']
|
16
|
+
blockchyp.test_gateway_host = config['testGatewayHost']
|
17
|
+
|
18
|
+
test_delay(blockchyp, 'PANEnrollTest')
|
19
|
+
# setup request object
|
20
|
+
request = {}
|
21
|
+
request['pan'] = '4111111111111111'
|
22
|
+
request['test'] = true
|
44
23
|
response = blockchyp.enroll(request)
|
24
|
+
|
45
25
|
assert_not_nil(response)
|
46
26
|
# response assertions
|
47
|
-
assert(response[
|
48
|
-
assert(response[
|
49
|
-
|
50
|
-
|
51
|
-
assert(!response[
|
52
|
-
assert(!response[
|
53
|
-
|
54
|
-
|
55
|
-
assert(!response[
|
56
|
-
assert(!response[
|
57
|
-
|
58
|
-
|
59
|
-
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_equal('KEYED', response['entryMethod'])
|
38
|
+
assert(!response['token'].empty?)
|
60
39
|
end
|
40
|
+
|
61
41
|
end
|
62
42
|
end
|
data/test/pan_preauth_test.rb
CHANGED
@@ -1,60 +1,43 @@
|
|
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 PANPreauthTest < TestCase
|
13
7
|
def test_pan_preauth
|
14
|
-
|
15
|
-
puts "Running test_pan_preauth..."
|
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
|
-
pan: '4111111111111111',
|
36
|
-
expMonth: '12',
|
37
|
-
expYear: '2025',
|
38
|
-
amount: '25.55',
|
39
|
-
test: true
|
40
|
-
}
|
41
|
-
|
15
|
+
blockchyp.gateway_host = config['gatewayHost']
|
16
|
+
blockchyp.test_gateway_host = config['testGatewayHost']
|
17
|
+
|
18
|
+
test_delay(blockchyp, 'PANPreauthTest')
|
19
|
+
# setup request object
|
20
|
+
request = {}
|
21
|
+
request['pan'] = '4111111111111111'
|
22
|
+
request['amount'] = '25.55'
|
23
|
+
request['test'] = true
|
42
24
|
response = blockchyp.preauth(request)
|
25
|
+
|
43
26
|
assert_not_nil(response)
|
44
27
|
# response assertions
|
45
|
-
assert(response[
|
46
|
-
assert(response[
|
47
|
-
|
48
|
-
|
49
|
-
assert(!response[
|
50
|
-
assert(!response[
|
51
|
-
|
52
|
-
|
53
|
-
assert(!response[
|
54
|
-
assert(!response[
|
55
|
-
|
56
|
-
assert_equal('
|
57
|
-
assert_equal('KEYED', response[:entryMethod])
|
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.55', response['authorizedAmount'])
|
39
|
+
assert_equal('KEYED', response['entryMethod'])
|
58
40
|
end
|
41
|
+
|
59
42
|
end
|
60
43
|
end
|
@@ -1,54 +1,40 @@
|
|
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 SimpleBatchCloseTest < TestCase
|
13
7
|
def test_simple_batch_close
|
14
|
-
|
15
|
-
puts "Running test_simple_batch_close..."
|
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
|
-
|
15
|
+
blockchyp.gateway_host = config['gatewayHost']
|
16
|
+
blockchyp.test_gateway_host = config['testGatewayHost']
|
17
|
+
|
18
|
+
test_delay(blockchyp, 'SimpleBatchCloseTest')
|
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['test'] = true
|
30
|
+
response = blockchyp.closeBatch(request)
|
29
31
|
|
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
|
-
test: true
|
46
|
-
}
|
47
|
-
|
48
|
-
response = blockchyp.close_batch(request)
|
49
32
|
assert_not_nil(response)
|
50
33
|
# response assertions
|
51
|
-
assert(response[
|
34
|
+
assert(response['success'])
|
35
|
+
assert(!response['capturedTotal'].empty?)
|
36
|
+
assert(!response['openPreauths'].empty?)
|
52
37
|
end
|
38
|
+
|
53
39
|
end
|
54
40
|
end
|
data/test/simple_capture_test.rb
CHANGED
@@ -1,55 +1,38 @@
|
|
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 SimpleCaptureTest < TestCase
|
13
7
|
def test_simple_capture
|
14
|
-
|
15
|
-
puts "Running test_simple_capture..."
|
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
|
-
response = blockchyp.preauth(setup_request)
|
41
|
-
|
42
|
-
# Set request parameters
|
43
|
-
request = {
|
44
|
-
transactionId: response[:transactionId],
|
45
|
-
test: true
|
46
|
-
}
|
47
|
-
|
15
|
+
blockchyp.gateway_host = config['gatewayHost']
|
16
|
+
blockchyp.test_gateway_host = config['testGatewayHost']
|
17
|
+
|
18
|
+
test_delay(blockchyp, 'SimpleCaptureTest')
|
19
|
+
# setup request object
|
20
|
+
request = {}
|
21
|
+
request['pan'] = '4111111111111111'
|
22
|
+
request['amount'] = '25.55'
|
23
|
+
request['test'] = true
|
24
|
+
response = blockchyp.preauth(request)
|
25
|
+
|
26
|
+
# setup request object
|
27
|
+
request = {}
|
28
|
+
request['transactionId'] = response['transactionId']
|
29
|
+
request['test'] = true
|
48
30
|
response = blockchyp.capture(request)
|
31
|
+
|
49
32
|
assert_not_nil(response)
|
50
33
|
# response assertions
|
51
|
-
assert(response[
|
52
|
-
assert(response[:approved])
|
34
|
+
assert(response['approved'])
|
53
35
|
end
|
36
|
+
|
54
37
|
end
|
55
38
|
end
|
@@ -1,48 +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 SimpleGiftActivateTest < TestCase
|
13
7
|
def test_simple_gift_activate
|
14
|
-
|
15
|
-
puts "Running test_simple_gift_activate..."
|
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
|
-
blockchyp.dashboard_host = config[:dashboardHost]
|
27
|
-
|
28
|
-
test_delay(blockchyp, 'simple_gift_activate_test', config[:defaultTerminalName])
|
15
|
+
blockchyp.gateway_host = config['gatewayHost']
|
16
|
+
blockchyp.test_gateway_host = config['testGatewayHost']
|
29
17
|
|
18
|
+
test_delay(blockchyp, 'SimpleGiftActivateTest')
|
19
|
+
# setup request object
|
20
|
+
request = {}
|
21
|
+
request['test'] = true
|
22
|
+
request['terminalName'] = 'Test Terminal'
|
23
|
+
request['amount'] = '50.00'
|
24
|
+
response = blockchyp.giftActivate(request)
|
30
25
|
|
31
|
-
|
32
|
-
|
33
|
-
# Set request parameters
|
34
|
-
request = {
|
35
|
-
test: true,
|
36
|
-
terminalName: config[:defaultTerminalName],
|
37
|
-
amount: '50.00'
|
38
|
-
}
|
39
|
-
|
40
|
-
response = blockchyp.gift_activate(request)
|
41
26
|
assert_not_nil(response)
|
42
27
|
# response assertions
|
43
|
-
assert(response[
|
44
|
-
assert(response[
|
45
|
-
assert(!response[:publicKey].empty?)
|
28
|
+
assert(response['approved'])
|
29
|
+
assert(!response['publicKey'].empty?)
|
46
30
|
end
|
31
|
+
|
47
32
|
end
|
48
33
|
end
|
data/test/simple_message_test.rb
CHANGED
@@ -1,46 +1,32 @@
|
|
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 SimpleMessageTest < TestCase
|
13
7
|
def test_simple_message
|
14
|
-
|
15
|
-
puts "Running test_simple_message..."
|
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
|
-
message: 'Thank You For Your Business'
|
38
|
-
}
|
39
|
-
|
15
|
+
blockchyp.gateway_host = config['gatewayHost']
|
16
|
+
blockchyp.test_gateway_host = config['testGatewayHost']
|
17
|
+
|
18
|
+
test_delay(blockchyp, 'SimpleMessageTest')
|
19
|
+
# setup request object
|
20
|
+
request = {}
|
21
|
+
request['test'] = true
|
22
|
+
request['terminalName'] = 'Test Terminal'
|
23
|
+
request['message'] = 'Thank You For Your Business'
|
40
24
|
response = blockchyp.message(request)
|
25
|
+
|
41
26
|
assert_not_nil(response)
|
42
27
|
# response assertions
|
43
|
-
assert(response[
|
28
|
+
assert(response['success'])
|
44
29
|
end
|
30
|
+
|
45
31
|
end
|
46
32
|
end
|
data/test/simple_ping_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 SimplePingTest < TestCase
|
13
7
|
def test_simple_ping
|
14
|
-
|
15
|
-
puts "Running test_simple_ping..."
|
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, 'SimplePingTest')
|
19
|
+
# setup request object
|
20
|
+
request = {}
|
21
|
+
request['test'] = true
|
22
|
+
request['terminalName'] = 'Test Terminal'
|
39
23
|
response = blockchyp.ping(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
|