blockchyp 2.3.4 → 2.5.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 +344 -147
- 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/partial_refund_test.rb +51 -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 +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 +6 -2
@@ -14,37 +14,35 @@ 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, 'simple_batch_close_test')
|
25
25
|
|
26
26
|
# Set request parameters
|
27
27
|
setup_request = {
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
28
|
+
pan: '4111111111111111',
|
29
|
+
amount: '25.55',
|
30
|
+
test: true,
|
31
|
+
transactionRef: uuid
|
32
32
|
}
|
33
33
|
|
34
34
|
response = blockchyp.charge(setup_request)
|
35
35
|
|
36
36
|
# Set request parameters
|
37
37
|
request = {
|
38
|
-
|
38
|
+
test: true
|
39
39
|
}
|
40
40
|
|
41
41
|
response = blockchyp.close_batch(request)
|
42
42
|
|
43
43
|
assert_not_nil(response)
|
44
44
|
# response assertions
|
45
|
-
assert(response[
|
46
|
-
assert(!response['capturedTotal'].empty?)
|
47
|
-
assert(!response['openPreauths'].empty?)
|
45
|
+
assert(response[:success])
|
48
46
|
end
|
49
47
|
end
|
50
48
|
end
|
data/test/simple_capture_test.rb
CHANGED
@@ -14,36 +14,36 @@ 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, 'simple_capture_test')
|
25
25
|
|
26
26
|
# Set request parameters
|
27
27
|
setup_request = {
|
28
|
-
|
29
|
-
|
30
|
-
|
28
|
+
pan: '4111111111111111',
|
29
|
+
amount: '25.55',
|
30
|
+
test: true
|
31
31
|
}
|
32
32
|
|
33
33
|
response = blockchyp.preauth(setup_request)
|
34
34
|
|
35
35
|
# Set request parameters
|
36
36
|
request = {
|
37
|
-
|
38
|
-
|
37
|
+
transactionId: response[:transactionId],
|
38
|
+
test: true
|
39
39
|
}
|
40
40
|
|
41
41
|
response = blockchyp.capture(request)
|
42
42
|
|
43
43
|
assert_not_nil(response)
|
44
44
|
# response assertions
|
45
|
-
assert(response[
|
46
|
-
assert(response[
|
45
|
+
assert(response[:success])
|
46
|
+
assert(response[:approved])
|
47
47
|
end
|
48
48
|
end
|
49
49
|
end
|
@@ -14,29 +14,29 @@ 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, 'simple_gift_activate_test')
|
25
25
|
|
26
26
|
# Set request parameters
|
27
27
|
request = {
|
28
|
-
|
29
|
-
|
30
|
-
|
28
|
+
test: true,
|
29
|
+
terminalName: 'Test Terminal',
|
30
|
+
amount: '50.00'
|
31
31
|
}
|
32
32
|
|
33
33
|
response = blockchyp.gift_activate(request)
|
34
34
|
|
35
35
|
assert_not_nil(response)
|
36
36
|
# response assertions
|
37
|
-
assert(response[
|
38
|
-
assert(response[
|
39
|
-
assert(!response[
|
37
|
+
assert(response[:success])
|
38
|
+
assert(response[:approved])
|
39
|
+
assert(!response[:publicKey].empty?)
|
40
40
|
end
|
41
41
|
end
|
42
42
|
end
|
data/test/simple_message_test.rb
CHANGED
@@ -14,27 +14,27 @@ 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, 'simple_message_test')
|
25
25
|
|
26
26
|
# Set request parameters
|
27
27
|
request = {
|
28
|
-
|
29
|
-
|
30
|
-
|
28
|
+
test: true,
|
29
|
+
terminalName: 'Test Terminal',
|
30
|
+
message: 'Thank You For Your Business'
|
31
31
|
}
|
32
32
|
|
33
33
|
response = blockchyp.message(request)
|
34
34
|
|
35
35
|
assert_not_nil(response)
|
36
36
|
# response assertions
|
37
|
-
assert(response[
|
37
|
+
assert(response[:success])
|
38
38
|
end
|
39
39
|
end
|
40
40
|
end
|
data/test/simple_ping_test.rb
CHANGED
@@ -14,26 +14,26 @@ 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, 'simple_ping_test')
|
25
25
|
|
26
26
|
# Set request parameters
|
27
27
|
request = {
|
28
|
-
|
29
|
-
|
28
|
+
test: true,
|
29
|
+
terminalName: 'Test Terminal'
|
30
30
|
}
|
31
31
|
|
32
32
|
response = blockchyp.ping(request)
|
33
33
|
|
34
34
|
assert_not_nil(response)
|
35
35
|
# response assertions
|
36
|
-
assert(response[
|
36
|
+
assert(response[:success])
|
37
37
|
end
|
38
38
|
end
|
39
39
|
end
|
data/test/simple_refund_test.rb
CHANGED
@@ -14,37 +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, 'simple_refund_test')
|
25
25
|
|
26
26
|
# Set request parameters
|
27
27
|
setup_request = {
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
28
|
+
pan: '4111111111111111',
|
29
|
+
amount: '25.55',
|
30
|
+
test: true,
|
31
|
+
transactionRef: uuid
|
32
32
|
}
|
33
33
|
|
34
34
|
response = blockchyp.charge(setup_request)
|
35
35
|
|
36
36
|
# Set request parameters
|
37
37
|
request = {
|
38
|
-
|
39
|
-
|
38
|
+
transactionId: response[:transactionId],
|
39
|
+
test: true
|
40
40
|
}
|
41
41
|
|
42
42
|
response = blockchyp.refund(request)
|
43
43
|
|
44
44
|
assert_not_nil(response)
|
45
45
|
# response assertions
|
46
|
-
assert(response[
|
47
|
-
assert(response[
|
46
|
+
assert(response[:success])
|
47
|
+
assert(response[:approved])
|
48
48
|
end
|
49
49
|
end
|
50
50
|
end
|
@@ -14,37 +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, 'simple_reversal_test')
|
25
25
|
|
26
26
|
# Set request parameters
|
27
27
|
setup_request = {
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
28
|
+
pan: '4111111111111111',
|
29
|
+
amount: '25.55',
|
30
|
+
test: true,
|
31
|
+
transactionRef: uuid
|
32
32
|
}
|
33
33
|
|
34
34
|
response = blockchyp.charge(setup_request)
|
35
35
|
|
36
36
|
# Set request parameters
|
37
37
|
request = {
|
38
|
-
|
39
|
-
|
38
|
+
transactionRef: response[:transactionRef],
|
39
|
+
test: true
|
40
40
|
}
|
41
41
|
|
42
42
|
response = blockchyp.reverse(request)
|
43
43
|
|
44
44
|
assert_not_nil(response)
|
45
45
|
# response assertions
|
46
|
-
assert(response[
|
47
|
-
assert(response[
|
46
|
+
assert(response[:success])
|
47
|
+
assert(response[:approved])
|
48
48
|
end
|
49
49
|
end
|
50
50
|
end
|
data/test/simple_void_test.rb
CHANGED
@@ -14,37 +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, 'simple_void_test')
|
25
25
|
|
26
26
|
# Set request parameters
|
27
27
|
setup_request = {
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
28
|
+
pan: '4111111111111111',
|
29
|
+
amount: '25.55',
|
30
|
+
test: true,
|
31
|
+
transactionRef: uuid
|
32
32
|
}
|
33
33
|
|
34
34
|
response = blockchyp.charge(setup_request)
|
35
35
|
|
36
36
|
# Set request parameters
|
37
37
|
request = {
|
38
|
-
|
39
|
-
|
38
|
+
transactionId: response[:transactionId],
|
39
|
+
test: true
|
40
40
|
}
|
41
41
|
|
42
42
|
response = blockchyp.void(request)
|
43
43
|
|
44
44
|
assert_not_nil(response)
|
45
45
|
# response assertions
|
46
|
-
assert(response[
|
47
|
-
assert(response[
|
46
|
+
assert(response[:success])
|
47
|
+
assert(response[:approved])
|
48
48
|
end
|
49
49
|
end
|
50
50
|
end
|
@@ -14,38 +14,38 @@ 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, 'terminal_charge_test')
|
25
25
|
|
26
26
|
# Set request parameters
|
27
27
|
request = {
|
28
|
-
|
29
|
-
|
30
|
-
|
28
|
+
terminalName: 'Test Terminal',
|
29
|
+
amount: '25.15',
|
30
|
+
test: true
|
31
31
|
}
|
32
32
|
|
33
33
|
response = blockchyp.charge(request)
|
34
34
|
|
35
35
|
assert_not_nil(response)
|
36
36
|
# response assertions
|
37
|
-
assert(response[
|
38
|
-
assert(response[
|
39
|
-
assert(response[
|
40
|
-
assert_equal(response[
|
41
|
-
assert(!response[
|
42
|
-
assert(!response[
|
43
|
-
assert(!response[
|
44
|
-
assert_equal('approved', response[
|
45
|
-
assert(!response[
|
46
|
-
assert(!response[
|
47
|
-
assert(!response[
|
48
|
-
assert_equal('25.15', response[
|
37
|
+
assert(response[:success])
|
38
|
+
assert(response[:approved])
|
39
|
+
assert(response[:test])
|
40
|
+
assert_equal(response[:authCode].length, 6)
|
41
|
+
assert(!response[:transactionId].empty?)
|
42
|
+
assert(!response[:timestamp].empty?)
|
43
|
+
assert(!response[:tickBlock].empty?)
|
44
|
+
assert_equal('approved', response[:responseDescription])
|
45
|
+
assert(!response[:paymentType].empty?)
|
46
|
+
assert(!response[:maskedPan].empty?)
|
47
|
+
assert(!response[:entryMethod].empty?)
|
48
|
+
assert_equal('25.15', response[:authorizedAmount])
|
49
49
|
end
|
50
50
|
end
|
51
51
|
end
|
data/test/terminal_clear_test.rb
CHANGED
@@ -14,26 +14,26 @@ 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, 'terminal_clear_test')
|
25
25
|
|
26
26
|
# Set request parameters
|
27
27
|
request = {
|
28
|
-
|
29
|
-
|
28
|
+
test: true,
|
29
|
+
terminalName: 'Test Terminal'
|
30
30
|
}
|
31
31
|
|
32
32
|
response = blockchyp.clear(request)
|
33
33
|
|
34
34
|
assert_not_nil(response)
|
35
35
|
# response assertions
|
36
|
-
assert(response[
|
36
|
+
assert(response[:success])
|
37
37
|
end
|
38
38
|
end
|
39
39
|
end
|