blockchyp 2.3.3 → 2.4.0
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.
- checksums.yaml +4 -4
- data/README.md +359 -151
- data/lib/blockchyp.rb +21 -1
- data/lib/blockchyp/version.rb +1 -1
- data/lib/blockchyp_client.rb +50 -60
- data/test/batch_history_test.rb +48 -0
- data/test/boolean_prompt_test.rb +12 -12
- data/test/capture_signature_test.rb +9 -9
- data/test/gateway_timeout_test.rb +10 -10
- data/test/get_customer_test.rb +13 -13
- data/test/heartbeat_test.rb +10 -10
- data/test/merchant_profile_test.rb +38 -0
- data/test/new_transaction_display_test.rb +20 -20
- data/test/pan_charge_test.rb +22 -22
- data/test/pan_enroll_test.rb +20 -20
- data/test/pan_preauth_test.rb +21 -21
- data/test/search_customer_test.rb +13 -13
- data/test/send_payment_link_test.rb +26 -26
- data/test/simple_batch_close_test.rb +11 -13
- data/test/simple_capture_test.rb +12 -12
- data/test/simple_gift_activate_test.rb +11 -11
- data/test/simple_message_test.rb +9 -9
- data/test/simple_ping_test.rb +8 -8
- data/test/simple_refund_test.rb +13 -13
- data/test/simple_reversal_test.rb +13 -13
- data/test/simple_void_test.rb +13 -13
- data/test/terminal_charge_test.rb +20 -20
- data/test/terminal_clear_test.rb +8 -8
- data/test/terminal_ebt_balance_test.rb +10 -10
- data/test/terminal_ebt_charge_test.rb +22 -22
- data/test/terminal_enroll_test.rb +19 -19
- data/test/terminal_gift_card_balance_test.rb +9 -9
- data/test/terminal_keyed_charge_test.rb +21 -21
- data/test/terminal_manual_ebt_charge_test.rb +23 -23
- data/test/terminal_preauth_test.rb +20 -20
- data/test/terminal_status_test.rb +8 -8
- data/test/terminal_timeout_test.rb +9 -9
- data/test/terms_and_conditions_test.rb +13 -13
- data/test/test_helper.rb +7 -6
- data/test/text_prompt_test.rb +10 -10
- data/test/transaction_history_test.rb +48 -0
- data/test/update_customer_test.rb +12 -12
- data/test/update_transaction_display_test.rb +20 -20
- metadata +5 -2
data/test/test_helper.rb
CHANGED
|
@@ -31,7 +31,7 @@ module BlockChyp
|
|
|
31
31
|
config_file = File.open(file_name)
|
|
32
32
|
content = config_file.read
|
|
33
33
|
|
|
34
|
-
JSON.parse(content)
|
|
34
|
+
JSON.parse(content, symbolize_names: true)
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
def test_delay(client, test_name)
|
|
@@ -40,15 +40,16 @@ module BlockChyp
|
|
|
40
40
|
if test_delay
|
|
41
41
|
test_delay_int = Integer(test_delay)
|
|
42
42
|
if test_delay_int.positive?
|
|
43
|
-
request = {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
request = {
|
|
44
|
+
test: true,
|
|
45
|
+
terminalName: 'Test Terminal',
|
|
46
|
+
message: "Running #{test_name} in #{test_delay} seconds.."
|
|
47
|
+
}
|
|
47
48
|
response = client.message(request)
|
|
48
49
|
|
|
49
50
|
assert_not_nil(response)
|
|
50
51
|
# response assertions
|
|
51
|
-
assert(response[
|
|
52
|
+
assert(response[:success])
|
|
52
53
|
sleep test_delay_int
|
|
53
54
|
end
|
|
54
55
|
end
|
data/test/text_prompt_test.rb
CHANGED
|
@@ -14,28 +14,28 @@ module BlockChyp
|
|
|
14
14
|
config = load_test_config
|
|
15
15
|
|
|
16
16
|
blockchyp = BlockChyp.new(
|
|
17
|
-
config[
|
|
18
|
-
config[
|
|
19
|
-
config[
|
|
17
|
+
config[:apiKey],
|
|
18
|
+
config[:bearerToken],
|
|
19
|
+
config[:signingKey]
|
|
20
20
|
)
|
|
21
|
-
blockchyp.gateway_host = config[
|
|
22
|
-
blockchyp.test_gateway_host = config[
|
|
21
|
+
blockchyp.gateway_host = config[:gatewayHost]
|
|
22
|
+
blockchyp.test_gateway_host = config[:testGatewayHost]
|
|
23
23
|
|
|
24
24
|
test_delay(blockchyp, 'text_prompt_test')
|
|
25
25
|
|
|
26
26
|
# Set request parameters
|
|
27
27
|
request = {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
test: true,
|
|
29
|
+
terminalName: 'Test Terminal',
|
|
30
|
+
promptType: PromptType::EMAIL
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
response = blockchyp.text_prompt(request)
|
|
34
34
|
|
|
35
35
|
assert_not_nil(response)
|
|
36
36
|
# response assertions
|
|
37
|
-
assert(response[
|
|
38
|
-
assert(!response[
|
|
37
|
+
assert(response[:success])
|
|
38
|
+
assert(!response[:response].empty?)
|
|
39
39
|
end
|
|
40
40
|
end
|
|
41
41
|
end
|
|
@@ -0,0 +1,48 @@
|
|
|
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 TransactionHistoryTest < TestCase
|
|
13
|
+
def test_transaction_history
|
|
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, 'transaction_history_test')
|
|
25
|
+
|
|
26
|
+
# Set request parameters
|
|
27
|
+
setup_request = {
|
|
28
|
+
pan: '4111111111111111',
|
|
29
|
+
amount: '25.55',
|
|
30
|
+
test: true,
|
|
31
|
+
transactionRef: uuid
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
response = blockchyp.charge(setup_request)
|
|
35
|
+
|
|
36
|
+
# Set request parameters
|
|
37
|
+
request = {
|
|
38
|
+
maxResults: 10
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
response = blockchyp.transaction_history(request)
|
|
42
|
+
|
|
43
|
+
assert_not_nil(response)
|
|
44
|
+
# response assertions
|
|
45
|
+
assert(response[:success])
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -14,23 +14,23 @@ module BlockChyp
|
|
|
14
14
|
config = load_test_config
|
|
15
15
|
|
|
16
16
|
blockchyp = BlockChyp.new(
|
|
17
|
-
config[
|
|
18
|
-
config[
|
|
19
|
-
config[
|
|
17
|
+
config[:apiKey],
|
|
18
|
+
config[:bearerToken],
|
|
19
|
+
config[:signingKey]
|
|
20
20
|
)
|
|
21
|
-
blockchyp.gateway_host = config[
|
|
22
|
-
blockchyp.test_gateway_host = config[
|
|
21
|
+
blockchyp.gateway_host = config[:gatewayHost]
|
|
22
|
+
blockchyp.test_gateway_host = config[:testGatewayHost]
|
|
23
23
|
|
|
24
24
|
test_delay(blockchyp, 'update_customer_test')
|
|
25
25
|
|
|
26
26
|
# Set request parameters
|
|
27
27
|
request = {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
customer: {
|
|
29
|
+
firstName: 'Test',
|
|
30
|
+
lastName: 'Customer',
|
|
31
|
+
companyName: 'Test Company',
|
|
32
|
+
emailAddress: 'support@blockchyp.com',
|
|
33
|
+
smsNumber: '(123) 123-1234'
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
|
|
@@ -38,7 +38,7 @@ module BlockChyp
|
|
|
38
38
|
|
|
39
39
|
assert_not_nil(response)
|
|
40
40
|
# response assertions
|
|
41
|
-
assert(response[
|
|
41
|
+
assert(response[:success])
|
|
42
42
|
end
|
|
43
43
|
end
|
|
44
44
|
end
|
|
@@ -14,33 +14,33 @@ module BlockChyp
|
|
|
14
14
|
config = load_test_config
|
|
15
15
|
|
|
16
16
|
blockchyp = BlockChyp.new(
|
|
17
|
-
config[
|
|
18
|
-
config[
|
|
19
|
-
config[
|
|
17
|
+
config[:apiKey],
|
|
18
|
+
config[:bearerToken],
|
|
19
|
+
config[:signingKey]
|
|
20
20
|
)
|
|
21
|
-
blockchyp.gateway_host = config[
|
|
22
|
-
blockchyp.test_gateway_host = config[
|
|
21
|
+
blockchyp.gateway_host = config[:gatewayHost]
|
|
22
|
+
blockchyp.test_gateway_host = config[:testGatewayHost]
|
|
23
23
|
|
|
24
24
|
test_delay(blockchyp, 'update_transaction_display_test')
|
|
25
25
|
|
|
26
26
|
# Set request parameters
|
|
27
27
|
request = {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
test: true,
|
|
29
|
+
terminalName: 'Test Terminal',
|
|
30
|
+
transaction: {
|
|
31
|
+
subtotal: '35.00',
|
|
32
|
+
tax: '5.00',
|
|
33
|
+
total: '70.00',
|
|
34
|
+
items: [
|
|
35
35
|
{
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
description: 'Leki Trekking Poles',
|
|
37
|
+
price: '35.00',
|
|
38
|
+
quantity: 2,
|
|
39
|
+
extended: '70.00',
|
|
40
|
+
discounts: [
|
|
41
41
|
{
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
description: 'memberDiscount',
|
|
43
|
+
amount: '10.00'
|
|
44
44
|
}
|
|
45
45
|
]
|
|
46
46
|
}
|
|
@@ -52,7 +52,7 @@ module BlockChyp
|
|
|
52
52
|
|
|
53
53
|
assert_not_nil(response)
|
|
54
54
|
# response assertions
|
|
55
|
-
assert(response[
|
|
55
|
+
assert(response[:success])
|
|
56
56
|
end
|
|
57
57
|
end
|
|
58
58
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: blockchyp
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- BlockChyp
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-
|
|
11
|
+
date: 2020-08-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description:
|
|
14
14
|
email:
|
|
@@ -23,11 +23,13 @@ files:
|
|
|
23
23
|
- lib/blockchyp/version.rb
|
|
24
24
|
- lib/blockchyp_client.rb
|
|
25
25
|
- lib/crypto_utils.rb
|
|
26
|
+
- test/batch_history_test.rb
|
|
26
27
|
- test/boolean_prompt_test.rb
|
|
27
28
|
- test/capture_signature_test.rb
|
|
28
29
|
- test/gateway_timeout_test.rb
|
|
29
30
|
- test/get_customer_test.rb
|
|
30
31
|
- test/heartbeat_test.rb
|
|
32
|
+
- test/merchant_profile_test.rb
|
|
31
33
|
- test/new_transaction_display_test.rb
|
|
32
34
|
- test/pan_charge_test.rb
|
|
33
35
|
- test/pan_enroll_test.rb
|
|
@@ -56,6 +58,7 @@ files:
|
|
|
56
58
|
- test/terms_and_conditions_test.rb
|
|
57
59
|
- test/test_helper.rb
|
|
58
60
|
- test/text_prompt_test.rb
|
|
61
|
+
- test/transaction_history_test.rb
|
|
59
62
|
- test/update_customer_test.rb
|
|
60
63
|
- test/update_transaction_display_test.rb
|
|
61
64
|
homepage: https://github.com/blockchyp/blockchyp-ruby
|