blockchyp 2.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Makefile +71 -0
- data/README.md +997 -0
- data/Rakefile +39 -0
- data/lib/blockchyp.rb +190 -0
- data/lib/blockchyp/version.rb +5 -0
- data/lib/blockchyp_client.rb +346 -0
- data/lib/crypto_utils.rb +25 -0
- data/test/boolean_prompt_test.rb +43 -0
- data/test/capture_signature_test.rb +40 -0
- data/test/gateway_timeout_test.rb +40 -0
- data/test/heartbeat_test.rb +27 -0
- data/test/new_transaction_display_test.rb +78 -0
- data/test/pan_charge_test.rb +53 -0
- data/test/pan_enroll_test.rb +51 -0
- data/test/pan_preauth_test.rb +52 -0
- data/test/simple_batch_close_test.rb +48 -0
- data/test/simple_capture_test.rb +47 -0
- data/test/simple_gift_activate_test.rb +42 -0
- data/test/simple_message_test.rb +40 -0
- data/test/simple_ping_test.rb +39 -0
- data/test/simple_refund_test.rb +48 -0
- data/test/simple_reversal_test.rb +48 -0
- data/test/simple_void_test.rb +48 -0
- data/test/terminal_charge_test.rb +51 -0
- data/test/terminal_clear_test.rb +39 -0
- data/test/terminal_ebt_balance_test.rb +41 -0
- data/test/terminal_ebt_charge_test.rb +53 -0
- data/test/terminal_enroll_test.rb +50 -0
- data/test/terminal_gift_card_balance_test.rb +40 -0
- data/test/terminal_keyed_charge_test.rb +52 -0
- data/test/terminal_manual_ebt_charge_test.rb +54 -0
- data/test/terminal_preauth_test.rb +51 -0
- data/test/terminal_status_test.rb +39 -0
- data/test/terminal_timeout_test.rb +39 -0
- data/test/terms_and_conditions_test.rb +44 -0
- data/test/test_helper.rb +65 -0
- data/test/text_prompt_test.rb +41 -0
- data/test/update_transaction_display_test.rb +78 -0
- metadata +81 -0
@@ -0,0 +1,41 @@
|
|
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 TextPromptTest < TestCase
|
13
|
+
def test_text_prompt
|
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, 'text_prompt_test')
|
25
|
+
|
26
|
+
# setup request object
|
27
|
+
request = {}
|
28
|
+
request['test'] = true
|
29
|
+
request['terminalName'] = 'Test Terminal'
|
30
|
+
request['promptType'] = PromptType::EMAIL
|
31
|
+
|
32
|
+
response = blockchyp.text_prompt(request)
|
33
|
+
|
34
|
+
assert_not_nil(response)
|
35
|
+
# response assertions
|
36
|
+
assert(response['success'])
|
37
|
+
assert(!response['response'].empty?)
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,78 @@
|
|
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 UpdateTransactionDisplayTest < TestCase
|
13
|
+
def test_update_transaction_display
|
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, 'update_transaction_display_test')
|
25
|
+
|
26
|
+
# setup request object
|
27
|
+
request = {}
|
28
|
+
request['test'] = true
|
29
|
+
request['terminalName'] = 'Test Terminal'
|
30
|
+
request['transaction'] = new_transaction_display_transaction
|
31
|
+
|
32
|
+
response = blockchyp.update_transaction_display(request)
|
33
|
+
|
34
|
+
assert_not_nil(response)
|
35
|
+
# response assertions
|
36
|
+
assert(response['success'])
|
37
|
+
end
|
38
|
+
|
39
|
+
def new_transaction_display_transaction
|
40
|
+
val = {}
|
41
|
+
val['subtotal'] = '35.00'
|
42
|
+
val['tax'] = '5.00'
|
43
|
+
val['total'] = '70.00'
|
44
|
+
val['items'] = new_transaction_display_items
|
45
|
+
val
|
46
|
+
end
|
47
|
+
|
48
|
+
def new_transaction_display_items
|
49
|
+
val = []
|
50
|
+
val.push(new_transaction_display_item_2)
|
51
|
+
val
|
52
|
+
end
|
53
|
+
|
54
|
+
def new_transaction_display_item_2
|
55
|
+
val = {}
|
56
|
+
val['description'] = 'Leki Trekking Poles'
|
57
|
+
val['price'] = '35.00'
|
58
|
+
val['quantity'] = 2
|
59
|
+
val['extended'] = '70.00'
|
60
|
+
val['discounts'] = new_transaction_display_discounts
|
61
|
+
val
|
62
|
+
end
|
63
|
+
|
64
|
+
def new_transaction_display_discounts
|
65
|
+
val = []
|
66
|
+
val.push(new_transaction_display_discount_2)
|
67
|
+
val
|
68
|
+
end
|
69
|
+
|
70
|
+
def new_transaction_display_discount_2
|
71
|
+
val = {}
|
72
|
+
val['description'] = 'memberDiscount'
|
73
|
+
val['amount'] = '10.00'
|
74
|
+
val
|
75
|
+
end
|
76
|
+
|
77
|
+
end
|
78
|
+
end
|
metadata
ADDED
@@ -0,0 +1,81 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: blockchyp
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 2.2.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- BlockChyp
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-03-27 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description:
|
14
|
+
email:
|
15
|
+
executables: []
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files: []
|
18
|
+
files:
|
19
|
+
- Makefile
|
20
|
+
- README.md
|
21
|
+
- Rakefile
|
22
|
+
- lib/blockchyp.rb
|
23
|
+
- lib/blockchyp/version.rb
|
24
|
+
- lib/blockchyp_client.rb
|
25
|
+
- lib/crypto_utils.rb
|
26
|
+
- test/boolean_prompt_test.rb
|
27
|
+
- test/capture_signature_test.rb
|
28
|
+
- test/gateway_timeout_test.rb
|
29
|
+
- test/heartbeat_test.rb
|
30
|
+
- test/new_transaction_display_test.rb
|
31
|
+
- test/pan_charge_test.rb
|
32
|
+
- test/pan_enroll_test.rb
|
33
|
+
- test/pan_preauth_test.rb
|
34
|
+
- test/simple_batch_close_test.rb
|
35
|
+
- test/simple_capture_test.rb
|
36
|
+
- test/simple_gift_activate_test.rb
|
37
|
+
- test/simple_message_test.rb
|
38
|
+
- test/simple_ping_test.rb
|
39
|
+
- test/simple_refund_test.rb
|
40
|
+
- test/simple_reversal_test.rb
|
41
|
+
- test/simple_void_test.rb
|
42
|
+
- test/terminal_charge_test.rb
|
43
|
+
- test/terminal_clear_test.rb
|
44
|
+
- test/terminal_ebt_balance_test.rb
|
45
|
+
- test/terminal_ebt_charge_test.rb
|
46
|
+
- test/terminal_enroll_test.rb
|
47
|
+
- test/terminal_gift_card_balance_test.rb
|
48
|
+
- test/terminal_keyed_charge_test.rb
|
49
|
+
- test/terminal_manual_ebt_charge_test.rb
|
50
|
+
- test/terminal_preauth_test.rb
|
51
|
+
- test/terminal_status_test.rb
|
52
|
+
- test/terminal_timeout_test.rb
|
53
|
+
- test/terms_and_conditions_test.rb
|
54
|
+
- test/test_helper.rb
|
55
|
+
- test/text_prompt_test.rb
|
56
|
+
- test/update_transaction_display_test.rb
|
57
|
+
homepage: https://github.com/blockchyp/blockchyp-ruby
|
58
|
+
licenses:
|
59
|
+
- MIT
|
60
|
+
metadata:
|
61
|
+
github_repo: ssh://github.com/blockchyp/blockchyp-ruby.git
|
62
|
+
post_install_message:
|
63
|
+
rdoc_options: []
|
64
|
+
require_paths:
|
65
|
+
- lib
|
66
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: 2.3.0
|
71
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
requirements: []
|
77
|
+
rubygems_version: 3.0.3
|
78
|
+
signing_key:
|
79
|
+
specification_version: 4
|
80
|
+
summary: BlockChyp Ruby SDK
|
81
|
+
test_files: []
|