blockchyp 2.9.3 → 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 +318 -0
- data/lib/blockchyp/version.rb +1 -1
- data/lib/blockchyp.rb +45 -0
- data/lib/blockchyp_client.rb +2 -0
- data/test/batch_history_test.rb +1 -1
- data/test/boolean_prompt_test.rb +2 -2
- data/test/cancel_payment_link_test.rb +68 -0
- data/test/capture_signature_test.rb +2 -2
- data/test/delete_customer_test.rb +51 -0
- data/test/delete_token_test.rb +51 -0
- data/test/gateway_timeout_test.rb +1 -1
- data/test/get_customer_test.rb +1 -1
- data/test/link_token_test.rb +52 -0
- data/test/merchant_profile_test.rb +1 -1
- data/test/new_transaction_display_test.rb +2 -2
- data/test/pan_charge_test.rb +1 -1
- data/test/pan_enroll_test.rb +7 -2
- data/test/pan_preauth_test.rb +1 -1
- data/test/partial_refund_test.rb +1 -1
- data/test/search_customer_test.rb +1 -1
- data/test/send_payment_link_test.rb +1 -1
- data/test/simple_batch_close_test.rb +1 -1
- data/test/simple_capture_test.rb +1 -1
- data/test/simple_gift_activate_test.rb +2 -2
- data/test/simple_locate_test.rb +39 -0
- data/test/simple_message_test.rb +2 -2
- data/test/simple_ping_test.rb +2 -2
- data/test/simple_refund_test.rb +1 -1
- data/test/simple_reversal_test.rb +1 -1
- data/test/simple_void_test.rb +1 -1
- data/test/terminal_charge_test.rb +2 -2
- data/test/terminal_clear_test.rb +2 -2
- data/test/terminal_ebt_balance_test.rb +2 -2
- data/test/terminal_ebt_charge_test.rb +2 -2
- data/test/terminal_enroll_test.rb +2 -2
- data/test/terminal_gift_card_balance_test.rb +2 -2
- data/test/terminal_keyed_charge_test.rb +2 -2
- data/test/terminal_manual_ebt_charge_test.rb +2 -2
- data/test/terminal_preauth_test.rb +2 -2
- data/test/terminal_status_test.rb +2 -2
- data/test/terminal_timeout_test.rb +2 -2
- data/test/terms_and_conditions_test.rb +2 -2
- data/test/test_helper.rb +2 -2
- data/test/text_prompt_test.rb +2 -2
- data/test/token_metadata_test.rb +51 -0
- data/test/transaction_history_test.rb +1 -1
- data/test/unlink_token_test.rb +52 -0
- data/test/update_customer_test.rb +1 -1
- data/test/update_transaction_display_test.rb +2 -2
- metadata +9 -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
|
@@ -804,6 +840,38 @@ response = blockchyp.sendPaymentLink(request)
|
|
804
840
|
puts "Response: #{response.inspect}"
|
805
841
|
|
806
842
|
|
843
|
+
```
|
844
|
+
|
845
|
+
#### Cancel Payment Link
|
846
|
+
|
847
|
+
|
848
|
+
|
849
|
+
Cancels a payment link.
|
850
|
+
|
851
|
+
|
852
|
+
|
853
|
+
|
854
|
+
```ruby
|
855
|
+
# frozen_string_literal: true
|
856
|
+
|
857
|
+
require 'blockchyp'
|
858
|
+
|
859
|
+
blockchyp = BlockChyp::BlockChyp.new(
|
860
|
+
ENV['BC_API_KEY'],
|
861
|
+
ENV['BC_BEARER_TOKEN'],
|
862
|
+
ENV['BC_SIGNING_KEY']
|
863
|
+
)
|
864
|
+
|
865
|
+
# Set request parameters
|
866
|
+
request = {
|
867
|
+
linkCode: 'Payment link code to cancel'
|
868
|
+
}
|
869
|
+
|
870
|
+
response = blockchyp.cancelPaymentLink(request)
|
871
|
+
|
872
|
+
puts "Response: #{response.inspect}"
|
873
|
+
|
874
|
+
|
807
875
|
```
|
808
876
|
|
809
877
|
#### Transaction Status
|
@@ -1653,6 +1721,15 @@ None of the above filters are mutually exclusive. You can combine any of the
|
|
1653
1721
|
above properties in a single request to restrict transaction results to a
|
1654
1722
|
narrower set of results.
|
1655
1723
|
|
1724
|
+
**Searching Transaction History**
|
1725
|
+
|
1726
|
+
You can search transaction history by passing in search criteria with the
|
1727
|
+
`query` option. The search system will match on amount (requested and authorized),
|
1728
|
+
last four of the card number, cardholder name, and the auth code.
|
1729
|
+
|
1730
|
+
Note that when search queries are used, terminalName or
|
1731
|
+
batch id filters are not supported.
|
1732
|
+
|
1656
1733
|
|
1657
1734
|
|
1658
1735
|
|
@@ -1710,6 +1787,247 @@ response = blockchyp.merchantProfile(request)
|
|
1710
1787
|
puts "Response: #{response.inspect}"
|
1711
1788
|
|
1712
1789
|
|
1790
|
+
```
|
1791
|
+
|
1792
|
+
#### List Queued Transactions
|
1793
|
+
|
1794
|
+
|
1795
|
+
|
1796
|
+
Returns a list of transaction refs of transactions queued on a terminal.
|
1797
|
+
Details about the transactions can be retrieved using the Transaction Status
|
1798
|
+
API.
|
1799
|
+
|
1800
|
+
|
1801
|
+
|
1802
|
+
|
1803
|
+
```ruby
|
1804
|
+
# frozen_string_literal: true
|
1805
|
+
|
1806
|
+
require 'blockchyp'
|
1807
|
+
|
1808
|
+
blockchyp = BlockChyp::BlockChyp.new(
|
1809
|
+
ENV['BC_API_KEY'],
|
1810
|
+
ENV['BC_BEARER_TOKEN'],
|
1811
|
+
ENV['BC_SIGNING_KEY']
|
1812
|
+
)
|
1813
|
+
|
1814
|
+
# Set request parameters
|
1815
|
+
request = {
|
1816
|
+
terminalName: 'Test Terminal'
|
1817
|
+
}
|
1818
|
+
|
1819
|
+
response = blockchyp.listQueuedTransactions(request)
|
1820
|
+
|
1821
|
+
puts "Response: #{response.inspect}"
|
1822
|
+
|
1823
|
+
|
1824
|
+
```
|
1825
|
+
|
1826
|
+
#### Delete Queued Transaction
|
1827
|
+
|
1828
|
+
|
1829
|
+
|
1830
|
+
Deletes one or all queued transactions from a terminal. If `*` is passed as
|
1831
|
+
a transaction ref, then the entire terminal queue will be cleared. An error is
|
1832
|
+
returned if the passed transaction ref is not queued on the terminal.
|
1833
|
+
|
1834
|
+
|
1835
|
+
|
1836
|
+
|
1837
|
+
```ruby
|
1838
|
+
# frozen_string_literal: true
|
1839
|
+
|
1840
|
+
require 'blockchyp'
|
1841
|
+
|
1842
|
+
blockchyp = BlockChyp::BlockChyp.new(
|
1843
|
+
ENV['BC_API_KEY'],
|
1844
|
+
ENV['BC_BEARER_TOKEN'],
|
1845
|
+
ENV['BC_SIGNING_KEY']
|
1846
|
+
)
|
1847
|
+
|
1848
|
+
# Set request parameters
|
1849
|
+
request = {
|
1850
|
+
terminalName: 'Test Terminal',
|
1851
|
+
transactionRef: '*'
|
1852
|
+
}
|
1853
|
+
|
1854
|
+
response = blockchyp.deleteQueuedTransaction(request)
|
1855
|
+
|
1856
|
+
puts "Response: #{response.inspect}"
|
1857
|
+
|
1858
|
+
|
1859
|
+
```
|
1860
|
+
|
1861
|
+
#### Delete Customer
|
1862
|
+
|
1863
|
+
|
1864
|
+
|
1865
|
+
Deletes a customer record.
|
1866
|
+
|
1867
|
+
|
1868
|
+
|
1869
|
+
|
1870
|
+
```ruby
|
1871
|
+
# frozen_string_literal: true
|
1872
|
+
|
1873
|
+
require 'blockchyp'
|
1874
|
+
|
1875
|
+
blockchyp = BlockChyp::BlockChyp.new(
|
1876
|
+
ENV['BC_API_KEY'],
|
1877
|
+
ENV['BC_BEARER_TOKEN'],
|
1878
|
+
ENV['BC_SIGNING_KEY']
|
1879
|
+
)
|
1880
|
+
|
1881
|
+
# Set request parameters
|
1882
|
+
request = {
|
1883
|
+
customerId: 'ID of the customer to delete'
|
1884
|
+
}
|
1885
|
+
|
1886
|
+
response = blockchyp.deleteCustomer(request)
|
1887
|
+
|
1888
|
+
puts "Response: #{response.inspect}"
|
1889
|
+
|
1890
|
+
|
1891
|
+
```
|
1892
|
+
|
1893
|
+
#### Delete Token
|
1894
|
+
|
1895
|
+
|
1896
|
+
|
1897
|
+
Deletes a payment token from the gateway.
|
1898
|
+
|
1899
|
+
|
1900
|
+
|
1901
|
+
|
1902
|
+
```ruby
|
1903
|
+
# frozen_string_literal: true
|
1904
|
+
|
1905
|
+
require 'blockchyp'
|
1906
|
+
|
1907
|
+
blockchyp = BlockChyp::BlockChyp.new(
|
1908
|
+
ENV['BC_API_KEY'],
|
1909
|
+
ENV['BC_BEARER_TOKEN'],
|
1910
|
+
ENV['BC_SIGNING_KEY']
|
1911
|
+
)
|
1912
|
+
|
1913
|
+
# Set request parameters
|
1914
|
+
request = {
|
1915
|
+
token: 'Token to delete'
|
1916
|
+
}
|
1917
|
+
|
1918
|
+
response = blockchyp.deleteToken(request)
|
1919
|
+
|
1920
|
+
puts "Response: #{response.inspect}"
|
1921
|
+
|
1922
|
+
|
1923
|
+
```
|
1924
|
+
|
1925
|
+
#### Token Metadata
|
1926
|
+
|
1927
|
+
|
1928
|
+
|
1929
|
+
Retrieves status and metadata information about a token,
|
1930
|
+
including any links to customer records.
|
1931
|
+
|
1932
|
+
This will also return any customer records related to the card
|
1933
|
+
behind the token. If the underlying card has been tokenized
|
1934
|
+
multiple times, all customers related to the card will be returned,
|
1935
|
+
even if those customer associations are related to other tokens.
|
1936
|
+
|
1937
|
+
|
1938
|
+
|
1939
|
+
|
1940
|
+
```ruby
|
1941
|
+
# frozen_string_literal: true
|
1942
|
+
|
1943
|
+
require 'blockchyp'
|
1944
|
+
|
1945
|
+
blockchyp = BlockChyp::BlockChyp.new(
|
1946
|
+
ENV['BC_API_KEY'],
|
1947
|
+
ENV['BC_BEARER_TOKEN'],
|
1948
|
+
ENV['BC_SIGNING_KEY']
|
1949
|
+
)
|
1950
|
+
|
1951
|
+
# Set request parameters
|
1952
|
+
request = {
|
1953
|
+
token: 'Token to retrieve'
|
1954
|
+
}
|
1955
|
+
|
1956
|
+
response = blockchyp.tokenMetadata(request)
|
1957
|
+
|
1958
|
+
puts "Response: #{response.inspect}"
|
1959
|
+
|
1960
|
+
|
1961
|
+
```
|
1962
|
+
|
1963
|
+
#### Link Token
|
1964
|
+
|
1965
|
+
|
1966
|
+
|
1967
|
+
Links a payment token with a customer record. Usually this would only be used
|
1968
|
+
to reverse a previous unlink operation.
|
1969
|
+
|
1970
|
+
|
1971
|
+
|
1972
|
+
|
1973
|
+
```ruby
|
1974
|
+
# frozen_string_literal: true
|
1975
|
+
|
1976
|
+
require 'blockchyp'
|
1977
|
+
|
1978
|
+
blockchyp = BlockChyp::BlockChyp.new(
|
1979
|
+
ENV['BC_API_KEY'],
|
1980
|
+
ENV['BC_BEARER_TOKEN'],
|
1981
|
+
ENV['BC_SIGNING_KEY']
|
1982
|
+
)
|
1983
|
+
|
1984
|
+
# Set request parameters
|
1985
|
+
request = {
|
1986
|
+
token: 'Token to link',
|
1987
|
+
customerId: 'Customer to link'
|
1988
|
+
}
|
1989
|
+
|
1990
|
+
response = blockchyp.linkToken(request)
|
1991
|
+
|
1992
|
+
puts "Response: #{response.inspect}"
|
1993
|
+
|
1994
|
+
|
1995
|
+
```
|
1996
|
+
|
1997
|
+
#### Unlink Token
|
1998
|
+
|
1999
|
+
|
2000
|
+
|
2001
|
+
Removes a payment token link from a customer record.
|
2002
|
+
|
2003
|
+
This will remove links between the customer record and all tokens
|
2004
|
+
for the same underlying card.
|
2005
|
+
|
2006
|
+
|
2007
|
+
|
2008
|
+
|
2009
|
+
```ruby
|
2010
|
+
# frozen_string_literal: true
|
2011
|
+
|
2012
|
+
require 'blockchyp'
|
2013
|
+
|
2014
|
+
blockchyp = BlockChyp::BlockChyp.new(
|
2015
|
+
ENV['BC_API_KEY'],
|
2016
|
+
ENV['BC_BEARER_TOKEN'],
|
2017
|
+
ENV['BC_SIGNING_KEY']
|
2018
|
+
)
|
2019
|
+
|
2020
|
+
# Set request parameters
|
2021
|
+
request = {
|
2022
|
+
token: 'Token to unlink',
|
2023
|
+
customerId: 'Customer to unlink'
|
2024
|
+
}
|
2025
|
+
|
2026
|
+
response = blockchyp.unlinkToken(request)
|
2027
|
+
|
2028
|
+
puts "Response: #{response.inspect}"
|
2029
|
+
|
2030
|
+
|
1713
2031
|
```
|
1714
2032
|
|
1715
2033
|
## Running Integration Tests
|
data/lib/blockchyp/version.rb
CHANGED
data/lib/blockchyp.rb
CHANGED
@@ -139,7 +139,22 @@ module BlockChyp
|
|
139
139
|
def text_prompt(request)
|
140
140
|
route_terminal_request('POST', '/api/text-prompt', '/api/text-prompt', request)
|
141
141
|
end
|
142
|
+
|
143
|
+
# Returns a list of queued transactions on a terminal.
|
144
|
+
def list_queued_transactions(request)
|
145
|
+
route_terminal_request('POST', '/api/queue/list', '/api/queue/list', request)
|
146
|
+
end
|
147
|
+
|
148
|
+
# Deletes a queued transaction from the terminal.
|
149
|
+
def delete_queued_transaction(request)
|
150
|
+
route_terminal_request('POST', '/api/queue/delete', '/api/queue/delete', request)
|
151
|
+
end
|
142
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
|
+
|
143
158
|
# Captures a preauthorization.
|
144
159
|
def capture(request)
|
145
160
|
gateway_request('POST', '/api/capture', request)
|
@@ -174,6 +189,11 @@ module BlockChyp
|
|
174
189
|
gateway_request('POST', '/api/send-payment-link', request)
|
175
190
|
end
|
176
191
|
|
192
|
+
# Cancels a payment link.
|
193
|
+
def cancel_payment_link(request)
|
194
|
+
gateway_request('POST', '/api/cancel-payment-link', request)
|
195
|
+
end
|
196
|
+
|
177
197
|
# Retrieves the current status of a transaction.
|
178
198
|
def transaction_status(request)
|
179
199
|
gateway_request('POST', '/api/tx-status', request)
|
@@ -219,5 +239,30 @@ module BlockChyp
|
|
219
239
|
gateway_request('POST', '/api/public-merchant-profile', request)
|
220
240
|
end
|
221
241
|
|
242
|
+
# Deletes a customer record.
|
243
|
+
def delete_customer(request)
|
244
|
+
gateway_request('DELETE', '/api/customer/' + request[:customerId], request)
|
245
|
+
end
|
246
|
+
|
247
|
+
# Deletes a payment token.
|
248
|
+
def delete_token(request)
|
249
|
+
gateway_request('DELETE', '/api/token/' + request[:token], request)
|
250
|
+
end
|
251
|
+
|
252
|
+
# Retrieves payment token metadata.
|
253
|
+
def token_metadata(request)
|
254
|
+
gateway_request('GET', '/api/token/' + request[:token], request)
|
255
|
+
end
|
256
|
+
|
257
|
+
# Links a token to a customer record.
|
258
|
+
def link_token(request)
|
259
|
+
gateway_request('POST', '/api/link-token', request)
|
260
|
+
end
|
261
|
+
|
262
|
+
# Removes a link between a customer and a token.
|
263
|
+
def unlink_token(request)
|
264
|
+
gateway_request('POST', '/api/unlink-token', request)
|
265
|
+
end
|
266
|
+
|
222
267
|
end
|
223
268
|
end
|
data/lib/blockchyp_client.rb
CHANGED
data/test/batch_history_test.rb
CHANGED
@@ -21,7 +21,7 @@ module BlockChyp
|
|
21
21
|
blockchyp.gateway_host = config[:gatewayHost]
|
22
22
|
blockchyp.test_gateway_host = config[:testGatewayHost]
|
23
23
|
|
24
|
-
test_delay(blockchyp, 'batch_history_test')
|
24
|
+
test_delay(blockchyp, 'batch_history_test', config[:defaultTerminalName])
|
25
25
|
|
26
26
|
# Set request parameters
|
27
27
|
setup_request = {
|
data/test/boolean_prompt_test.rb
CHANGED
@@ -21,12 +21,12 @@ module BlockChyp
|
|
21
21
|
blockchyp.gateway_host = config[:gatewayHost]
|
22
22
|
blockchyp.test_gateway_host = config[:testGatewayHost]
|
23
23
|
|
24
|
-
test_delay(blockchyp, 'boolean_prompt_test')
|
24
|
+
test_delay(blockchyp, 'boolean_prompt_test', config[:defaultTerminalName])
|
25
25
|
|
26
26
|
# Set request parameters
|
27
27
|
request = {
|
28
28
|
test: true,
|
29
|
-
terminalName:
|
29
|
+
terminalName: config[:defaultTerminalName],
|
30
30
|
prompt: 'Would you like to become a member?',
|
31
31
|
yesCaption: 'Yes',
|
32
32
|
noCaption: 'No'
|
@@ -0,0 +1,68 @@
|
|
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 CancelPaymentLinkTest < TestCase
|
13
|
+
def test_cancel_payment_link
|
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, 'cancel_payment_link_test', config[:defaultTerminalName])
|
25
|
+
|
26
|
+
# Set request parameters
|
27
|
+
setup_request = {
|
28
|
+
amount: '199.99',
|
29
|
+
description: 'Widget',
|
30
|
+
subject: 'Widget invoice',
|
31
|
+
transaction: {
|
32
|
+
subtotal: '195.00',
|
33
|
+
tax: '4.99',
|
34
|
+
total: '199.99',
|
35
|
+
items: [
|
36
|
+
{
|
37
|
+
description: 'Widget',
|
38
|
+
price: '195.00',
|
39
|
+
quantity: 1
|
40
|
+
}
|
41
|
+
]
|
42
|
+
},
|
43
|
+
autoSend: true,
|
44
|
+
customer: {
|
45
|
+
customerRef: 'Customer reference string',
|
46
|
+
firstName: 'FirstName',
|
47
|
+
lastName: 'LastName',
|
48
|
+
companyName: 'Company Name',
|
49
|
+
emailAddress: 'support@blockchyp.com',
|
50
|
+
smsNumber: '(123) 123-1231'
|
51
|
+
}
|
52
|
+
}
|
53
|
+
|
54
|
+
response = blockchyp.send_payment_link(setup_request)
|
55
|
+
|
56
|
+
# Set request parameters
|
57
|
+
request = {
|
58
|
+
linkCode: response[:linkCode]
|
59
|
+
}
|
60
|
+
|
61
|
+
response = blockchyp.cancel_payment_link(request)
|
62
|
+
|
63
|
+
assert_not_nil(response)
|
64
|
+
# response assertions
|
65
|
+
assert(response[:success])
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
@@ -21,11 +21,11 @@ module BlockChyp
|
|
21
21
|
blockchyp.gateway_host = config[:gatewayHost]
|
22
22
|
blockchyp.test_gateway_host = config[:testGatewayHost]
|
23
23
|
|
24
|
-
test_delay(blockchyp, 'capture_signature_test')
|
24
|
+
test_delay(blockchyp, 'capture_signature_test', config[:defaultTerminalName])
|
25
25
|
|
26
26
|
# Set request parameters
|
27
27
|
request = {
|
28
|
-
terminalName:
|
28
|
+
terminalName: config[:defaultTerminalName],
|
29
29
|
sigFormat: SignatureFormat::PNG,
|
30
30
|
sigWidth: 200
|
31
31
|
}
|
@@ -0,0 +1,51 @@
|
|
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 DeleteCustomerTest < TestCase
|
13
|
+
def test_delete_customer
|
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, 'delete_customer_test', config[:defaultTerminalName])
|
25
|
+
|
26
|
+
# Set request parameters
|
27
|
+
setup_request = {
|
28
|
+
customer: {
|
29
|
+
firstName: 'Test',
|
30
|
+
lastName: 'Customer',
|
31
|
+
companyName: 'Test Company',
|
32
|
+
emailAddress: 'support@blockchyp.com',
|
33
|
+
smsNumber: '(123) 123-1234'
|
34
|
+
}
|
35
|
+
}
|
36
|
+
|
37
|
+
response = blockchyp.update_customer(setup_request)
|
38
|
+
|
39
|
+
# Set request parameters
|
40
|
+
request = {
|
41
|
+
customerId: response[:customer][:id]
|
42
|
+
}
|
43
|
+
|
44
|
+
response = blockchyp.delete_customer(request)
|
45
|
+
|
46
|
+
assert_not_nil(response)
|
47
|
+
# response assertions
|
48
|
+
assert(response[:success])
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,51 @@
|
|
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 DeleteTokenTest < TestCase
|
13
|
+
def test_delete_token
|
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, 'delete_token_test', config[:defaultTerminalName])
|
25
|
+
|
26
|
+
# Set request parameters
|
27
|
+
setup_request = {
|
28
|
+
pan: '4111111111111111',
|
29
|
+
test: true,
|
30
|
+
customer: {
|
31
|
+
customerRef: 'TESTCUSTOMER',
|
32
|
+
firstName: 'Test',
|
33
|
+
lastName: 'Customer'
|
34
|
+
}
|
35
|
+
}
|
36
|
+
|
37
|
+
response = blockchyp.enroll(setup_request)
|
38
|
+
|
39
|
+
# Set request parameters
|
40
|
+
request = {
|
41
|
+
token: response[:token]
|
42
|
+
}
|
43
|
+
|
44
|
+
response = blockchyp.delete_token(request)
|
45
|
+
|
46
|
+
assert_not_nil(response)
|
47
|
+
# response assertions
|
48
|
+
assert(response[:success])
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -21,7 +21,7 @@ module BlockChyp
|
|
21
21
|
blockchyp.gateway_host = config[:gatewayHost]
|
22
22
|
blockchyp.test_gateway_host = config[:testGatewayHost]
|
23
23
|
|
24
|
-
test_delay(blockchyp, 'gateway_timeout_test')
|
24
|
+
test_delay(blockchyp, 'gateway_timeout_test', config[:defaultTerminalName])
|
25
25
|
|
26
26
|
# Set request parameters
|
27
27
|
request = {
|
data/test/get_customer_test.rb
CHANGED
@@ -21,7 +21,7 @@ module BlockChyp
|
|
21
21
|
blockchyp.gateway_host = config[:gatewayHost]
|
22
22
|
blockchyp.test_gateway_host = config[:testGatewayHost]
|
23
23
|
|
24
|
-
test_delay(blockchyp, 'get_customer_test')
|
24
|
+
test_delay(blockchyp, 'get_customer_test', config[:defaultTerminalName])
|
25
25
|
|
26
26
|
# Set request parameters
|
27
27
|
setup_request = {
|