blockchyp 1.24.4
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 +7 -0
- data/Makefile +78 -0
- data/README.md +3917 -0
- data/Rakefile +39 -0
- data/lib/blockchyp/version.rb +5 -0
- data/lib/blockchyp.rb +462 -0
- data/lib/blockchyp_client.rb +416 -0
- data/lib/crypto_utils.rb +25 -0
- data/test/activate_terminal_test.rb +45 -0
- data/test/add_test_merchant_test.rb +56 -0
- data/test/batch_history_test.rb +54 -0
- data/test/boolean_prompt_test.rb +49 -0
- data/test/cancel_payment_link_test.rb +72 -0
- data/test/capture_signature_test.rb +46 -0
- data/test/deactivate_terminal_test.rb +42 -0
- data/test/delete_branding_asset_test.rb +50 -0
- data/test/delete_customer_test.rb +55 -0
- data/test/delete_media_asset_test.rb +53 -0
- data/test/delete_queued_transaction_test.rb +56 -0
- data/test/delete_slide_show_test.rb +50 -0
- data/test/delete_survey_question_test.rb +51 -0
- data/test/delete_test_merchant_test.rb +59 -0
- data/test/delete_token_test.rb +55 -0
- data/test/empty_branding_asset_test.rb +44 -0
- data/test/empty_slide_show_test.rb +45 -0
- data/test/gateway_timeout_test.rb +49 -0
- data/test/get_customer_test.rb +55 -0
- data/test/get_merchants_test.rb +52 -0
- data/test/heartbeat_test.rb +27 -0
- data/test/invite_merchant_user_test.rb +45 -0
- data/test/link_token_test.rb +56 -0
- data/test/list_queued_transactions_test.rb +55 -0
- data/test/list_terminals_test.rb +42 -0
- data/test/media_asset_test.rb +57 -0
- data/test/media_test.rb +42 -0
- data/test/media_upload_test.rb +52 -0
- data/test/merchant_platforms_test.rb +59 -0
- data/test/merchant_profile_test.rb +43 -0
- data/test/merchant_users_test.rb +42 -0
- data/test/new_transaction_display_test.rb +64 -0
- data/test/pan_charge_test.rb +61 -0
- data/test/pan_enroll_test.rb +62 -0
- data/test/pan_preauth_test.rb +60 -0
- data/test/partial_refund_test.rb +58 -0
- data/test/search_customer_test.rb +55 -0
- data/test/send_payment_link_test.rb +67 -0
- data/test/simple_batch_close_test.rb +54 -0
- data/test/simple_capture_test.rb +55 -0
- data/test/simple_gift_activate_test.rb +48 -0
- data/test/simple_locate_test.rb +44 -0
- data/test/simple_message_test.rb +46 -0
- data/test/simple_ping_test.rb +45 -0
- data/test/simple_refund_test.rb +57 -0
- data/test/simple_reversal_test.rb +56 -0
- data/test/simple_void_test.rb +56 -0
- data/test/slide_show_test.rb +51 -0
- data/test/slide_shows_test.rb +49 -0
- data/test/survey_question_test.rb +48 -0
- data/test/survey_questions_test.rb +50 -0
- data/test/survey_results_test.rb +48 -0
- data/test/tc_delete_template_test.rb +51 -0
- data/test/tc_entry_test.rb +56 -0
- data/test/tc_log_test.rb +42 -0
- data/test/tc_template_test.rb +53 -0
- data/test/tc_template_update_test.rb +48 -0
- data/test/tc_templates_test.rb +42 -0
- data/test/terminal_branding_test.rb +42 -0
- data/test/terminal_charge_test.rb +57 -0
- data/test/terminal_clear_test.rb +45 -0
- data/test/terminal_ebt_balance_test.rb +47 -0
- data/test/terminal_ebt_charge_test.rb +59 -0
- data/test/terminal_enroll_test.rb +56 -0
- data/test/terminal_gift_card_balance_test.rb +46 -0
- data/test/terminal_keyed_charge_test.rb +58 -0
- data/test/terminal_manual_ebt_charge_test.rb +60 -0
- data/test/terminal_preauth_test.rb +57 -0
- data/test/terminal_queued_transaction_test.rb +51 -0
- data/test/terminal_status_test.rb +45 -0
- data/test/terminal_timeout_test.rb +46 -0
- data/test/terms_and_conditions_test.rb +50 -0
- data/test/test_helper.rb +64 -0
- data/test/testdata/aviato.png +0 -0
- data/test/text_prompt_test.rb +47 -0
- data/test/token_metadata_test.rb +55 -0
- data/test/transaction_history_test.rb +54 -0
- data/test/unlink_token_test.rb +56 -0
- data/test/update_branding_asset_test.rb +62 -0
- data/test/update_customer_test.rb +49 -0
- data/test/update_merchant_platforms_test.rb +61 -0
- data/test/update_merchant_test.rb +60 -0
- data/test/update_slide_show_test.rb +60 -0
- data/test/update_survey_question_test.rb +47 -0
- data/test/update_transaction_display_test.rb +64 -0
- data/test/upload_status_test.rb +53 -0
- metadata +136 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
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
|
+
require ::File.expand_path('test_helper', __dir__)
|
|
10
|
+
|
|
11
|
+
module BlockChyp
|
|
12
|
+
class NewTransactionDisplayTest < TestCase
|
|
13
|
+
def test_new_transaction_display
|
|
14
|
+
|
|
15
|
+
puts "Running test_new_transaction_display..."
|
|
16
|
+
|
|
17
|
+
config = load_test_config
|
|
18
|
+
|
|
19
|
+
blockchyp = BlockChyp.new(
|
|
20
|
+
config[:apiKey],
|
|
21
|
+
config[:bearerToken],
|
|
22
|
+
config[:signingKey]
|
|
23
|
+
)
|
|
24
|
+
blockchyp.gateway_host = config[:gatewayHost]
|
|
25
|
+
blockchyp.test_gateway_host = config[:testGatewayHost]
|
|
26
|
+
blockchyp.dashboard_host = config[:dashboardHost]
|
|
27
|
+
|
|
28
|
+
test_delay(blockchyp, 'new_transaction_display_test', config[:defaultTerminalName])
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
# Set request parameters
|
|
34
|
+
request = {
|
|
35
|
+
test: true,
|
|
36
|
+
terminalName: config[:defaultTerminalName],
|
|
37
|
+
transaction: {
|
|
38
|
+
subtotal: '35.00',
|
|
39
|
+
tax: '5.00',
|
|
40
|
+
total: '70.00',
|
|
41
|
+
items: [
|
|
42
|
+
{
|
|
43
|
+
description: 'Leki Trekking Poles',
|
|
44
|
+
price: '35.00',
|
|
45
|
+
quantity: 2,
|
|
46
|
+
extended: '70.00',
|
|
47
|
+
discounts: [
|
|
48
|
+
{
|
|
49
|
+
description: 'memberDiscount',
|
|
50
|
+
amount: '10.00'
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
response = blockchyp.new_transaction_display(request)
|
|
59
|
+
assert_not_nil(response)
|
|
60
|
+
# response assertions
|
|
61
|
+
assert(response[:success])
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
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
|
+
require ::File.expand_path('test_helper', __dir__)
|
|
10
|
+
|
|
11
|
+
module BlockChyp
|
|
12
|
+
class PANChargeTest < TestCase
|
|
13
|
+
def test_pan_charge
|
|
14
|
+
|
|
15
|
+
puts "Running test_pan_charge..."
|
|
16
|
+
|
|
17
|
+
config = load_test_config
|
|
18
|
+
|
|
19
|
+
blockchyp = BlockChyp.new(
|
|
20
|
+
config[:apiKey],
|
|
21
|
+
config[:bearerToken],
|
|
22
|
+
config[:signingKey]
|
|
23
|
+
)
|
|
24
|
+
blockchyp.gateway_host = config[:gatewayHost]
|
|
25
|
+
blockchyp.test_gateway_host = config[:testGatewayHost]
|
|
26
|
+
blockchyp.dashboard_host = config[:dashboardHost]
|
|
27
|
+
|
|
28
|
+
test_delay(blockchyp, 'pan_charge_test', config[:defaultTerminalName])
|
|
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
|
+
transactionRef: uuid
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
response = blockchyp.charge(request)
|
|
44
|
+
assert_not_nil(response)
|
|
45
|
+
# response assertions
|
|
46
|
+
assert(response[:success])
|
|
47
|
+
assert(response[:approved])
|
|
48
|
+
assert(response[:test])
|
|
49
|
+
assert_equal(response[:authCode].length, 6)
|
|
50
|
+
assert(!response[:transactionId].empty?)
|
|
51
|
+
assert(!response[:timestamp].empty?)
|
|
52
|
+
assert(!response[:tickBlock].empty?)
|
|
53
|
+
assert_equal('approved', response[:responseDescription])
|
|
54
|
+
assert(!response[:paymentType].empty?)
|
|
55
|
+
assert(!response[:maskedPan].empty?)
|
|
56
|
+
assert(!response[:entryMethod].empty?)
|
|
57
|
+
assert_equal('25.55', response[:authorizedAmount])
|
|
58
|
+
assert_equal('KEYED', response[:entryMethod])
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
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
|
+
require ::File.expand_path('test_helper', __dir__)
|
|
10
|
+
|
|
11
|
+
module BlockChyp
|
|
12
|
+
class PANEnrollTest < TestCase
|
|
13
|
+
def test_pan_enroll
|
|
14
|
+
|
|
15
|
+
puts "Running test_pan_enroll..."
|
|
16
|
+
|
|
17
|
+
config = load_test_config
|
|
18
|
+
|
|
19
|
+
blockchyp = BlockChyp.new(
|
|
20
|
+
config[:apiKey],
|
|
21
|
+
config[:bearerToken],
|
|
22
|
+
config[:signingKey]
|
|
23
|
+
)
|
|
24
|
+
blockchyp.gateway_host = config[:gatewayHost]
|
|
25
|
+
blockchyp.test_gateway_host = config[:testGatewayHost]
|
|
26
|
+
blockchyp.dashboard_host = config[:dashboardHost]
|
|
27
|
+
|
|
28
|
+
test_delay(blockchyp, 'pan_enroll_test', config[:defaultTerminalName])
|
|
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
|
+
|
|
44
|
+
response = blockchyp.enroll(request)
|
|
45
|
+
assert_not_nil(response)
|
|
46
|
+
# response assertions
|
|
47
|
+
assert(response[:success])
|
|
48
|
+
assert(response[:approved])
|
|
49
|
+
assert(response[:test])
|
|
50
|
+
assert_equal(response[:authCode].length, 6)
|
|
51
|
+
assert(!response[:transactionId].empty?)
|
|
52
|
+
assert(!response[:timestamp].empty?)
|
|
53
|
+
assert(!response[:tickBlock].empty?)
|
|
54
|
+
assert_equal('approved', response[:responseDescription])
|
|
55
|
+
assert(!response[:paymentType].empty?)
|
|
56
|
+
assert(!response[:maskedPan].empty?)
|
|
57
|
+
assert(!response[:entryMethod].empty?)
|
|
58
|
+
assert_equal('KEYED', response[:entryMethod])
|
|
59
|
+
assert(!response[:token].empty?)
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
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
|
+
require ::File.expand_path('test_helper', __dir__)
|
|
10
|
+
|
|
11
|
+
module BlockChyp
|
|
12
|
+
class PANPreauthTest < TestCase
|
|
13
|
+
def test_pan_preauth
|
|
14
|
+
|
|
15
|
+
puts "Running test_pan_preauth..."
|
|
16
|
+
|
|
17
|
+
config = load_test_config
|
|
18
|
+
|
|
19
|
+
blockchyp = BlockChyp.new(
|
|
20
|
+
config[:apiKey],
|
|
21
|
+
config[:bearerToken],
|
|
22
|
+
config[:signingKey]
|
|
23
|
+
)
|
|
24
|
+
blockchyp.gateway_host = config[:gatewayHost]
|
|
25
|
+
blockchyp.test_gateway_host = config[:testGatewayHost]
|
|
26
|
+
blockchyp.dashboard_host = config[:dashboardHost]
|
|
27
|
+
|
|
28
|
+
test_delay(blockchyp, 'pan_preauth_test', config[:defaultTerminalName])
|
|
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
|
+
|
|
42
|
+
response = blockchyp.preauth(request)
|
|
43
|
+
assert_not_nil(response)
|
|
44
|
+
# response assertions
|
|
45
|
+
assert(response[:success])
|
|
46
|
+
assert(response[:approved])
|
|
47
|
+
assert(response[:test])
|
|
48
|
+
assert_equal(response[:authCode].length, 6)
|
|
49
|
+
assert(!response[:transactionId].empty?)
|
|
50
|
+
assert(!response[:timestamp].empty?)
|
|
51
|
+
assert(!response[:tickBlock].empty?)
|
|
52
|
+
assert_equal('approved', response[:responseDescription])
|
|
53
|
+
assert(!response[:paymentType].empty?)
|
|
54
|
+
assert(!response[:maskedPan].empty?)
|
|
55
|
+
assert(!response[:entryMethod].empty?)
|
|
56
|
+
assert_equal('25.55', response[:authorizedAmount])
|
|
57
|
+
assert_equal('KEYED', response[:entryMethod])
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
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
|
+
require ::File.expand_path('test_helper', __dir__)
|
|
10
|
+
|
|
11
|
+
module BlockChyp
|
|
12
|
+
class PartialRefundTest < TestCase
|
|
13
|
+
def test_partial_refund
|
|
14
|
+
|
|
15
|
+
puts "Running test_partial_refund..."
|
|
16
|
+
|
|
17
|
+
config = load_test_config
|
|
18
|
+
|
|
19
|
+
blockchyp = BlockChyp.new(
|
|
20
|
+
config[:apiKey],
|
|
21
|
+
config[:bearerToken],
|
|
22
|
+
config[:signingKey]
|
|
23
|
+
)
|
|
24
|
+
blockchyp.gateway_host = config[:gatewayHost]
|
|
25
|
+
blockchyp.test_gateway_host = config[:testGatewayHost]
|
|
26
|
+
blockchyp.dashboard_host = config[:dashboardHost]
|
|
27
|
+
|
|
28
|
+
test_delay(blockchyp, 'partial_refund_test', config[:defaultTerminalName])
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
# Set request parameters
|
|
34
|
+
setup_request = {
|
|
35
|
+
pan: '4111111111111111',
|
|
36
|
+
expMonth: '12',
|
|
37
|
+
expYear: '2025',
|
|
38
|
+
amount: '25.55',
|
|
39
|
+
test: true,
|
|
40
|
+
transactionRef: uuid
|
|
41
|
+
}
|
|
42
|
+
response = blockchyp.charge(setup_request)
|
|
43
|
+
|
|
44
|
+
# Set request parameters
|
|
45
|
+
request = {
|
|
46
|
+
transactionId: response[:transactionId],
|
|
47
|
+
amount: '5.00',
|
|
48
|
+
test: true
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
response = blockchyp.refund(request)
|
|
52
|
+
assert_not_nil(response)
|
|
53
|
+
# response assertions
|
|
54
|
+
assert(response[:success])
|
|
55
|
+
assert(response[:approved])
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
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
|
+
require ::File.expand_path('test_helper', __dir__)
|
|
10
|
+
|
|
11
|
+
module BlockChyp
|
|
12
|
+
class SearchCustomerTest < TestCase
|
|
13
|
+
def test_search_customer
|
|
14
|
+
|
|
15
|
+
puts "Running test_search_customer..."
|
|
16
|
+
|
|
17
|
+
config = load_test_config
|
|
18
|
+
|
|
19
|
+
blockchyp = BlockChyp.new(
|
|
20
|
+
config[:apiKey],
|
|
21
|
+
config[:bearerToken],
|
|
22
|
+
config[:signingKey]
|
|
23
|
+
)
|
|
24
|
+
blockchyp.gateway_host = config[:gatewayHost]
|
|
25
|
+
blockchyp.test_gateway_host = config[:testGatewayHost]
|
|
26
|
+
blockchyp.dashboard_host = config[:dashboardHost]
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
# Set request parameters
|
|
33
|
+
setup_request = {
|
|
34
|
+
customer: {
|
|
35
|
+
firstName: 'Test',
|
|
36
|
+
lastName: 'Customer',
|
|
37
|
+
companyName: 'Test Company',
|
|
38
|
+
emailAddress: 'support@blockchyp.com',
|
|
39
|
+
smsNumber: '(123) 123-1234'
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
response = blockchyp.update_customer(setup_request)
|
|
43
|
+
|
|
44
|
+
# Set request parameters
|
|
45
|
+
request = {
|
|
46
|
+
query: '123123'
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
response = blockchyp.customer_search(request)
|
|
50
|
+
assert_not_nil(response)
|
|
51
|
+
# response assertions
|
|
52
|
+
assert(response[:success])
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
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
|
+
require ::File.expand_path('test_helper', __dir__)
|
|
10
|
+
|
|
11
|
+
module BlockChyp
|
|
12
|
+
class SendPaymentLinkTest < TestCase
|
|
13
|
+
def test_send_payment_link
|
|
14
|
+
|
|
15
|
+
puts "Running test_send_payment_link..."
|
|
16
|
+
|
|
17
|
+
config = load_test_config
|
|
18
|
+
|
|
19
|
+
blockchyp = BlockChyp.new(
|
|
20
|
+
config[:apiKey],
|
|
21
|
+
config[:bearerToken],
|
|
22
|
+
config[:signingKey]
|
|
23
|
+
)
|
|
24
|
+
blockchyp.gateway_host = config[:gatewayHost]
|
|
25
|
+
blockchyp.test_gateway_host = config[:testGatewayHost]
|
|
26
|
+
blockchyp.dashboard_host = config[:dashboardHost]
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
# Set request parameters
|
|
33
|
+
request = {
|
|
34
|
+
amount: '199.99',
|
|
35
|
+
description: 'Widget',
|
|
36
|
+
subject: 'Widget invoice',
|
|
37
|
+
transaction: {
|
|
38
|
+
subtotal: '195.00',
|
|
39
|
+
tax: '4.99',
|
|
40
|
+
total: '199.99',
|
|
41
|
+
items: [
|
|
42
|
+
{
|
|
43
|
+
description: 'Widget',
|
|
44
|
+
price: '195.00',
|
|
45
|
+
quantity: 1
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
autoSend: true,
|
|
50
|
+
customer: {
|
|
51
|
+
customerRef: 'Customer reference string',
|
|
52
|
+
firstName: 'FirstName',
|
|
53
|
+
lastName: 'LastName',
|
|
54
|
+
companyName: 'Company Name',
|
|
55
|
+
emailAddress: 'notifications@blockchypteam.m8r.co',
|
|
56
|
+
smsNumber: '(123) 123-1231'
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
response = blockchyp.send_payment_link(request)
|
|
61
|
+
assert_not_nil(response)
|
|
62
|
+
# response assertions
|
|
63
|
+
assert(response[:success])
|
|
64
|
+
assert(!response[:url].empty?)
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
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
|
+
require ::File.expand_path('test_helper', __dir__)
|
|
10
|
+
|
|
11
|
+
module BlockChyp
|
|
12
|
+
class SimpleBatchCloseTest < TestCase
|
|
13
|
+
def test_simple_batch_close
|
|
14
|
+
|
|
15
|
+
puts "Running test_simple_batch_close..."
|
|
16
|
+
|
|
17
|
+
config = load_test_config
|
|
18
|
+
|
|
19
|
+
blockchyp = BlockChyp.new(
|
|
20
|
+
config[:apiKey],
|
|
21
|
+
config[:bearerToken],
|
|
22
|
+
config[:signingKey]
|
|
23
|
+
)
|
|
24
|
+
blockchyp.gateway_host = config[:gatewayHost]
|
|
25
|
+
blockchyp.test_gateway_host = config[:testGatewayHost]
|
|
26
|
+
blockchyp.dashboard_host = config[:dashboardHost]
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
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
|
+
assert_not_nil(response)
|
|
50
|
+
# response assertions
|
|
51
|
+
assert(response[:success])
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
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
|
+
require ::File.expand_path('test_helper', __dir__)
|
|
10
|
+
|
|
11
|
+
module BlockChyp
|
|
12
|
+
class SimpleCaptureTest < TestCase
|
|
13
|
+
def test_simple_capture
|
|
14
|
+
|
|
15
|
+
puts "Running test_simple_capture..."
|
|
16
|
+
|
|
17
|
+
config = load_test_config
|
|
18
|
+
|
|
19
|
+
blockchyp = BlockChyp.new(
|
|
20
|
+
config[:apiKey],
|
|
21
|
+
config[:bearerToken],
|
|
22
|
+
config[:signingKey]
|
|
23
|
+
)
|
|
24
|
+
blockchyp.gateway_host = config[:gatewayHost]
|
|
25
|
+
blockchyp.test_gateway_host = config[:testGatewayHost]
|
|
26
|
+
blockchyp.dashboard_host = config[:dashboardHost]
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
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
|
+
}
|
|
40
|
+
response = blockchyp.preauth(setup_request)
|
|
41
|
+
|
|
42
|
+
# Set request parameters
|
|
43
|
+
request = {
|
|
44
|
+
transactionId: response[:transactionId],
|
|
45
|
+
test: true
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
response = blockchyp.capture(request)
|
|
49
|
+
assert_not_nil(response)
|
|
50
|
+
# response assertions
|
|
51
|
+
assert(response[:success])
|
|
52
|
+
assert(response[:approved])
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
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
|
+
require ::File.expand_path('test_helper', __dir__)
|
|
10
|
+
|
|
11
|
+
module BlockChyp
|
|
12
|
+
class SimpleGiftActivateTest < TestCase
|
|
13
|
+
def test_simple_gift_activate
|
|
14
|
+
|
|
15
|
+
puts "Running test_simple_gift_activate..."
|
|
16
|
+
|
|
17
|
+
config = load_test_config
|
|
18
|
+
|
|
19
|
+
blockchyp = BlockChyp.new(
|
|
20
|
+
config[:apiKey],
|
|
21
|
+
config[:bearerToken],
|
|
22
|
+
config[:signingKey]
|
|
23
|
+
)
|
|
24
|
+
blockchyp.gateway_host = config[:gatewayHost]
|
|
25
|
+
blockchyp.test_gateway_host = config[:testGatewayHost]
|
|
26
|
+
blockchyp.dashboard_host = config[:dashboardHost]
|
|
27
|
+
|
|
28
|
+
test_delay(blockchyp, 'simple_gift_activate_test', config[:defaultTerminalName])
|
|
29
|
+
|
|
30
|
+
|
|
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
|
+
assert_not_nil(response)
|
|
42
|
+
# response assertions
|
|
43
|
+
assert(response[:success])
|
|
44
|
+
assert(response[:approved])
|
|
45
|
+
assert(!response[:publicKey].empty?)
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
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
|
+
require ::File.expand_path('test_helper', __dir__)
|
|
10
|
+
|
|
11
|
+
module BlockChyp
|
|
12
|
+
class SimpleLocateTest < TestCase
|
|
13
|
+
def test_simple_locate
|
|
14
|
+
|
|
15
|
+
puts "Running test_simple_locate..."
|
|
16
|
+
|
|
17
|
+
config = load_test_config
|
|
18
|
+
|
|
19
|
+
blockchyp = BlockChyp.new(
|
|
20
|
+
config[:apiKey],
|
|
21
|
+
config[:bearerToken],
|
|
22
|
+
config[:signingKey]
|
|
23
|
+
)
|
|
24
|
+
blockchyp.gateway_host = config[:gatewayHost]
|
|
25
|
+
blockchyp.test_gateway_host = config[:testGatewayHost]
|
|
26
|
+
blockchyp.dashboard_host = config[:dashboardHost]
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
# Set request parameters
|
|
33
|
+
request = {
|
|
34
|
+
test: true,
|
|
35
|
+
terminalName: config[:defaultTerminalName]
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
response = blockchyp.locate(request)
|
|
39
|
+
assert_not_nil(response)
|
|
40
|
+
# response assertions
|
|
41
|
+
assert(response[:success])
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
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
|
+
require ::File.expand_path('test_helper', __dir__)
|
|
10
|
+
|
|
11
|
+
module BlockChyp
|
|
12
|
+
class SimpleMessageTest < TestCase
|
|
13
|
+
def test_simple_message
|
|
14
|
+
|
|
15
|
+
puts "Running test_simple_message..."
|
|
16
|
+
|
|
17
|
+
config = load_test_config
|
|
18
|
+
|
|
19
|
+
blockchyp = BlockChyp.new(
|
|
20
|
+
config[:apiKey],
|
|
21
|
+
config[:bearerToken],
|
|
22
|
+
config[:signingKey]
|
|
23
|
+
)
|
|
24
|
+
blockchyp.gateway_host = config[:gatewayHost]
|
|
25
|
+
blockchyp.test_gateway_host = config[:testGatewayHost]
|
|
26
|
+
blockchyp.dashboard_host = config[:dashboardHost]
|
|
27
|
+
|
|
28
|
+
test_delay(blockchyp, 'simple_message_test', config[:defaultTerminalName])
|
|
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
|
+
|
|
40
|
+
response = blockchyp.message(request)
|
|
41
|
+
assert_not_nil(response)
|
|
42
|
+
# response assertions
|
|
43
|
+
assert(response[:success])
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|