blockchyp 2.11.0 → 2.12.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +36 -0
- data/lib/blockchyp/version.rb +1 -1
- data/lib/blockchyp.rb +5 -0
- data/test/simple_locate_test.rb +39 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7da8a06a2cbe8a774c1d32e9173e6dbb4133983b3d6cc35bc4fd3fb608e66eac
|
4
|
+
data.tar.gz: fe6475f6e7fa6bf8833a060a36442277a572f7e0fb52791c9e269347badf74d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3074bb48d5b30437dff33215a9e26b6fe52635569021817be27725fc42bfa0b48c47b54e4fa58884ac8ad0c8f0a342c777bab5e95ae48c0c57af7d53f5cfe1d5
|
7
|
+
data.tar.gz: 1c441ce375500443c98836aea6835cfd8da0347eff185fdbe30d7a6842ac6c2de3787f737efe36a6cc6944afb4df030c028fc17498b7e82bbb35f6f1f1fddf17
|
data/README.md
CHANGED
@@ -112,6 +112,42 @@ response = blockchyp.ping(request)
|
|
112
112
|
puts "Response: #{response.inspect}"
|
113
113
|
|
114
114
|
|
115
|
+
```
|
116
|
+
|
117
|
+
#### Terminal Locate
|
118
|
+
|
119
|
+
|
120
|
+
This endpoint returns routing and location information for a terminal.
|
121
|
+
|
122
|
+
The result will indicate whether or not the terminal is in cloud relay mode and will
|
123
|
+
return the local IP address if the terminal is in local mode.
|
124
|
+
|
125
|
+
The terminal will also return the public key for the terminal.
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
```ruby
|
131
|
+
# frozen_string_literal: true
|
132
|
+
|
133
|
+
require 'blockchyp'
|
134
|
+
|
135
|
+
blockchyp = BlockChyp::BlockChyp.new(
|
136
|
+
ENV['BC_API_KEY'],
|
137
|
+
ENV['BC_BEARER_TOKEN'],
|
138
|
+
ENV['BC_SIGNING_KEY']
|
139
|
+
)
|
140
|
+
|
141
|
+
# Set request parameters
|
142
|
+
request = {
|
143
|
+
terminalName: 'Test Terminal'
|
144
|
+
}
|
145
|
+
|
146
|
+
response = blockchyp.locate(request)
|
147
|
+
|
148
|
+
puts "Response: #{response.inspect}"
|
149
|
+
|
150
|
+
|
115
151
|
```
|
116
152
|
|
117
153
|
#### Charge
|
data/lib/blockchyp/version.rb
CHANGED
data/lib/blockchyp.rb
CHANGED
@@ -150,6 +150,11 @@ module BlockChyp
|
|
150
150
|
route_terminal_request('POST', '/api/queue/delete', '/api/queue/delete', request)
|
151
151
|
end
|
152
152
|
|
153
|
+
# Returns routing and location data for a payment terminal.
|
154
|
+
def locate(request)
|
155
|
+
gateway_request('POST', '/api/terminal-locate', request)
|
156
|
+
end
|
157
|
+
|
153
158
|
# Captures a preauthorization.
|
154
159
|
def capture(request)
|
155
160
|
gateway_request('POST', '/api/capture', request)
|
@@ -0,0 +1,39 @@
|
|
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 SimpleLocateTest < TestCase
|
13
|
+
def test_simple_locate
|
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, 'simple_locate_test', config[:defaultTerminalName])
|
25
|
+
|
26
|
+
# Set request parameters
|
27
|
+
request = {
|
28
|
+
test: true,
|
29
|
+
terminalName: config[:defaultTerminalName]
|
30
|
+
}
|
31
|
+
|
32
|
+
response = blockchyp.locate(request)
|
33
|
+
|
34
|
+
assert_not_nil(response)
|
35
|
+
# response assertions
|
36
|
+
assert(response[:success])
|
37
|
+
end
|
38
|
+
end
|
39
|
+
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.12.1
|
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: 2022-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|
@@ -44,6 +44,7 @@ files:
|
|
44
44
|
- test/simple_batch_close_test.rb
|
45
45
|
- test/simple_capture_test.rb
|
46
46
|
- test/simple_gift_activate_test.rb
|
47
|
+
- test/simple_locate_test.rb
|
47
48
|
- test/simple_message_test.rb
|
48
49
|
- test/simple_ping_test.rb
|
49
50
|
- test/simple_refund_test.rb
|