blockchyp 2.3.7 → 2.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +118 -113
- data/lib/blockchyp.rb +1 -1
- data/lib/blockchyp/version.rb +1 -1
- data/lib/blockchyp_client.rb +50 -60
- data/test/batch_history_test.rb +13 -11
- data/test/boolean_prompt_test.rb +12 -12
- data/test/capture_signature_test.rb +9 -9
- data/test/gateway_timeout_test.rb +12 -10
- data/test/get_customer_test.rb +13 -13
- data/test/heartbeat_test.rb +10 -10
- data/test/merchant_profile_test.rb +7 -7
- data/test/new_transaction_display_test.rb +20 -20
- data/test/pan_charge_test.rb +24 -22
- data/test/pan_enroll_test.rb +20 -20
- data/test/pan_preauth_test.rb +23 -21
- data/test/partial_refund_test.rb +53 -0
- data/test/search_customer_test.rb +13 -13
- data/test/send_payment_link_test.rb +26 -26
- data/test/simple_batch_close_test.rb +13 -11
- data/test/simple_capture_test.rb +14 -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 +15 -13
- data/test/simple_reversal_test.rb +15 -13
- data/test/simple_void_test.rb +15 -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 +13 -11
- data/test/update_customer_test.rb +12 -12
- data/test/update_transaction_display_test.rb +20 -20
- metadata +4 -3
@@ -14,31 +14,31 @@ 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, 'terms_and_conditions_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
|
+
tcName: 'HIPPA Disclosure',
|
31
|
+
tcContent: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum ullamcorper id urna quis pulvinar. Pellentesque vestibulum justo ac nulla consectetur tristique. Suspendisse arcu arcu, viverra vel luctus non, dapibus vitae augue. Aenean ac volutpat purus. Curabitur in lacus nisi. Nam vel sagittis eros. Curabitur faucibus ut nisl in pulvinar. Nunc egestas, orci ut porttitor tempus, ante mauris pellentesque ex, nec feugiat purus arcu ac metus. Cras sodales ornare lobortis. Aenean lacinia ultricies purus quis pharetra. Cras vestibulum nulla et magna eleifend eleifend. Nunc nibh dolor, malesuada ut suscipit vitae, bibendum quis dolor. Phasellus ultricies ex vitae dolor malesuada, vel dignissim neque accumsan.',
|
32
|
+
sigFormat: SignatureFormat::PNG,
|
33
|
+
sigWidth: 200,
|
34
|
+
sigRequired: true
|
35
35
|
}
|
36
36
|
|
37
37
|
response = blockchyp.terms_and_conditions(request)
|
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
|
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
|
@@ -14,35 +14,37 @@ 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, 'transaction_history_test')
|
25
25
|
|
26
26
|
# Set request parameters
|
27
27
|
setup_request = {
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
28
|
+
pan: '4111111111111111',
|
29
|
+
expMonth: '12',
|
30
|
+
expYear: '2025',
|
31
|
+
amount: '25.55',
|
32
|
+
test: true,
|
33
|
+
transactionRef: uuid
|
32
34
|
}
|
33
35
|
|
34
36
|
response = blockchyp.charge(setup_request)
|
35
37
|
|
36
38
|
# Set request parameters
|
37
39
|
request = {
|
38
|
-
|
40
|
+
maxResults: 10
|
39
41
|
}
|
40
42
|
|
41
43
|
response = blockchyp.transaction_history(request)
|
42
44
|
|
43
45
|
assert_not_nil(response)
|
44
46
|
# response assertions
|
45
|
-
assert(response[
|
47
|
+
assert(response[:success])
|
46
48
|
end
|
47
49
|
end
|
48
50
|
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.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- BlockChyp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|
@@ -34,6 +34,7 @@ files:
|
|
34
34
|
- test/pan_charge_test.rb
|
35
35
|
- test/pan_enroll_test.rb
|
36
36
|
- test/pan_preauth_test.rb
|
37
|
+
- test/partial_refund_test.rb
|
37
38
|
- test/search_customer_test.rb
|
38
39
|
- test/send_payment_link_test.rb
|
39
40
|
- test/simple_batch_close_test.rb
|
@@ -81,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
81
82
|
- !ruby/object:Gem::Version
|
82
83
|
version: '0'
|
83
84
|
requirements: []
|
84
|
-
rubygems_version: 3.0.3
|
85
|
+
rubygems_version: 3.0.3.1
|
85
86
|
signing_key:
|
86
87
|
specification_version: 4
|
87
88
|
summary: BlockChyp Ruby SDK
|