blockchyp 2.10.0 → 2.11.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bfa58d2ca1b9dced275caf2d275cc8365c01253ae9da66a98f69674c3eac94c9
4
- data.tar.gz: a73a9b7015fac83379021f425c57802c4f078575116311ceff795d1352e985fd
3
+ metadata.gz: '0386059a39ae5610e197ad1ec670c6dff70341d7cc2a5a0dab7331f76cecb2e2'
4
+ data.tar.gz: fdcfaed2c9345ccba05aac145fec1d4ed67e11094548f2239daa30e35a318fd8
5
5
  SHA512:
6
- metadata.gz: cc39925a046375cee1ddfb9bca6dce5584085a272ae2d8998c0af52fce2aa6fa70ae3d5b158c4c2acc1d7bdc1fa8a1ab30504cbaa2a1cd91c84d678fe2523f07
7
- data.tar.gz: 3851804bdd7ba2c9525bdc678d546e098869da2ccc76857b3425bc1ebbd785e810514aa5b61dc5f239635162442e294f2881b025ed3177f5aa1b371436689247
6
+ metadata.gz: bc35d1405ca25dfb34c72e1ad3af2bed582d1fa8f18c8f20c64f5fb394a241f2914d820f6bd1ee751fbe5322c9654f6ce115021745ee71de7ae89e09bdd09923
7
+ data.tar.gz: d8882653dfd8cc174adcab2148fe2d3e5ec0ac45128bdccff26ec1b021482a06b472160277820d7d8b54d5f818411e489dd5d640e9c0d223c0a00d9a9972e636
data/README.md CHANGED
@@ -1685,6 +1685,15 @@ None of the above filters are mutually exclusive. You can combine any of the
1685
1685
  above properties in a single request to restrict transaction results to a
1686
1686
  narrower set of results.
1687
1687
 
1688
+ **Searching Transaction History**
1689
+
1690
+ You can search transaction history by passing in search criteria with the
1691
+ `query` option. The search system will match on amount (requested and authorized),
1692
+ last four of the card number, cardholder name, and the auth code.
1693
+
1694
+ Note that when search queries are used, terminalName or
1695
+ batch id filters are not supported.
1696
+
1688
1697
 
1689
1698
 
1690
1699
 
@@ -1875,6 +1884,114 @@ response = blockchyp.deleteToken(request)
1875
1884
  puts "Response: #{response.inspect}"
1876
1885
 
1877
1886
 
1887
+ ```
1888
+
1889
+ #### Token Metadata
1890
+
1891
+
1892
+
1893
+ Retrieves status and metadata information about a token,
1894
+ including any links to customer records.
1895
+
1896
+ This will also return any customer records related to the card
1897
+ behind the token. If the underlying card has been tokenized
1898
+ multiple times, all customers related to the card will be returned,
1899
+ even if those customer associations are related to other tokens.
1900
+
1901
+
1902
+
1903
+
1904
+ ```ruby
1905
+ # frozen_string_literal: true
1906
+
1907
+ require 'blockchyp'
1908
+
1909
+ blockchyp = BlockChyp::BlockChyp.new(
1910
+ ENV['BC_API_KEY'],
1911
+ ENV['BC_BEARER_TOKEN'],
1912
+ ENV['BC_SIGNING_KEY']
1913
+ )
1914
+
1915
+ # Set request parameters
1916
+ request = {
1917
+ token: 'Token to retrieve'
1918
+ }
1919
+
1920
+ response = blockchyp.tokenMetadata(request)
1921
+
1922
+ puts "Response: #{response.inspect}"
1923
+
1924
+
1925
+ ```
1926
+
1927
+ #### Link Token
1928
+
1929
+
1930
+
1931
+ Links a payment token with a customer record. Usually this would only be used
1932
+ to reverse a previous unlink operation.
1933
+
1934
+
1935
+
1936
+
1937
+ ```ruby
1938
+ # frozen_string_literal: true
1939
+
1940
+ require 'blockchyp'
1941
+
1942
+ blockchyp = BlockChyp::BlockChyp.new(
1943
+ ENV['BC_API_KEY'],
1944
+ ENV['BC_BEARER_TOKEN'],
1945
+ ENV['BC_SIGNING_KEY']
1946
+ )
1947
+
1948
+ # Set request parameters
1949
+ request = {
1950
+ token: 'Token to link',
1951
+ customerId: 'Customer to link'
1952
+ }
1953
+
1954
+ response = blockchyp.linkToken(request)
1955
+
1956
+ puts "Response: #{response.inspect}"
1957
+
1958
+
1959
+ ```
1960
+
1961
+ #### Unlink Token
1962
+
1963
+
1964
+
1965
+ Removes a payment token link from a customer record.
1966
+
1967
+ This will remove links between the customer record and all tokens
1968
+ for the same underlying card.
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 unlink',
1987
+ customerId: 'Customer to unlink'
1988
+ }
1989
+
1990
+ response = blockchyp.unlinkToken(request)
1991
+
1992
+ puts "Response: #{response.inspect}"
1993
+
1994
+
1878
1995
  ```
1879
1996
 
1880
1997
  ## Running Integration Tests
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BlockChyp
4
- VERSION = '2.10.0'
4
+ VERSION = '2.11.0'
5
5
  end
data/lib/blockchyp.rb CHANGED
@@ -244,5 +244,20 @@ module BlockChyp
244
244
  gateway_request('DELETE', '/api/token/' + request[:token], request)
245
245
  end
246
246
 
247
+ # Retrieves payment token metadata.
248
+ def token_metadata(request)
249
+ gateway_request('GET', '/api/token/' + request[:token], request)
250
+ end
251
+
252
+ # Links a token to a customer record.
253
+ def link_token(request)
254
+ gateway_request('POST', '/api/link-token', request)
255
+ end
256
+
257
+ # Removes a link between a customer and a token.
258
+ def unlink_token(request)
259
+ gateway_request('POST', '/api/unlink-token', request)
260
+ end
261
+
247
262
  end
248
263
  end
@@ -26,7 +26,12 @@ module BlockChyp
26
26
  # Set request parameters
27
27
  setup_request = {
28
28
  pan: '4111111111111111',
29
- test: true
29
+ test: true,
30
+ customer: {
31
+ customerRef: 'TESTCUSTOMER',
32
+ firstName: 'Test',
33
+ lastName: 'Customer'
34
+ }
30
35
  }
31
36
 
32
37
  response = blockchyp.enroll(setup_request)
@@ -0,0 +1,52 @@
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 LinkTokenTest < TestCase
13
+ def test_link_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, 'link_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
+ customerId: response[:customer][:id]
43
+ }
44
+
45
+ response = blockchyp.link_token(request)
46
+
47
+ assert_not_nil(response)
48
+ # response assertions
49
+ assert(response[:success])
50
+ end
51
+ end
52
+ end
@@ -26,7 +26,12 @@ module BlockChyp
26
26
  # Set request parameters
27
27
  request = {
28
28
  pan: '4111111111111111',
29
- test: true
29
+ test: true,
30
+ customer: {
31
+ customerRef: 'TESTCUSTOMER',
32
+ firstName: 'Test',
33
+ lastName: 'Customer'
34
+ }
30
35
  }
31
36
 
32
37
  response = blockchyp.enroll(request)
@@ -26,7 +26,7 @@ module BlockChyp
26
26
  # Set request parameters
27
27
  request = {
28
28
  test: true,
29
- terminalName: '$testTerminal'
29
+ terminalName: config[:defaultTerminalName]
30
30
  }
31
31
 
32
32
  response = blockchyp.ping(request)
@@ -25,7 +25,7 @@ module BlockChyp
25
25
 
26
26
  # Set request parameters
27
27
  request = {
28
- terminalName: '$testTerminal',
28
+ terminalName: config[:defaultTerminalName],
29
29
  amount: '25.15',
30
30
  test: true
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 TokenMetadataTest < TestCase
13
+ def test_token_metadata
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, 'token_metadata_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.token_metadata(request)
45
+
46
+ assert_not_nil(response)
47
+ # response assertions
48
+ assert(response[:success])
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,52 @@
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 UnlinkTokenTest < TestCase
13
+ def test_unlink_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, 'unlink_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
+ customerId: response[:customer][:id]
43
+ }
44
+
45
+ response = blockchyp.unlink_token(request)
46
+
47
+ assert_not_nil(response)
48
+ # response assertions
49
+ assert(response[:success])
50
+ end
51
+ end
52
+ 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.10.0
4
+ version: 2.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - BlockChyp
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-15 00:00:00.000000000 Z
11
+ date: 2021-10-08 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email:
@@ -32,6 +32,7 @@ files:
32
32
  - test/gateway_timeout_test.rb
33
33
  - test/get_customer_test.rb
34
34
  - test/heartbeat_test.rb
35
+ - test/link_token_test.rb
35
36
  - test/merchant_profile_test.rb
36
37
  - test/new_transaction_display_test.rb
37
38
  - test/pan_charge_test.rb
@@ -62,7 +63,9 @@ files:
62
63
  - test/terms_and_conditions_test.rb
63
64
  - test/test_helper.rb
64
65
  - test/text_prompt_test.rb
66
+ - test/token_metadata_test.rb
65
67
  - test/transaction_history_test.rb
68
+ - test/unlink_token_test.rb
66
69
  - test/update_customer_test.rb
67
70
  - test/update_transaction_display_test.rb
68
71
  homepage: https://github.com/blockchyp/blockchyp-ruby