blockchyp 2.9.3 → 2.12.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +318 -0
  3. data/lib/blockchyp/version.rb +1 -1
  4. data/lib/blockchyp.rb +45 -0
  5. data/lib/blockchyp_client.rb +2 -0
  6. data/test/batch_history_test.rb +1 -1
  7. data/test/boolean_prompt_test.rb +2 -2
  8. data/test/cancel_payment_link_test.rb +68 -0
  9. data/test/capture_signature_test.rb +2 -2
  10. data/test/delete_customer_test.rb +51 -0
  11. data/test/delete_token_test.rb +51 -0
  12. data/test/gateway_timeout_test.rb +1 -1
  13. data/test/get_customer_test.rb +1 -1
  14. data/test/link_token_test.rb +52 -0
  15. data/test/merchant_profile_test.rb +1 -1
  16. data/test/new_transaction_display_test.rb +2 -2
  17. data/test/pan_charge_test.rb +1 -1
  18. data/test/pan_enroll_test.rb +7 -2
  19. data/test/pan_preauth_test.rb +1 -1
  20. data/test/partial_refund_test.rb +1 -1
  21. data/test/search_customer_test.rb +1 -1
  22. data/test/send_payment_link_test.rb +1 -1
  23. data/test/simple_batch_close_test.rb +1 -1
  24. data/test/simple_capture_test.rb +1 -1
  25. data/test/simple_gift_activate_test.rb +2 -2
  26. data/test/simple_locate_test.rb +39 -0
  27. data/test/simple_message_test.rb +2 -2
  28. data/test/simple_ping_test.rb +2 -2
  29. data/test/simple_refund_test.rb +1 -1
  30. data/test/simple_reversal_test.rb +1 -1
  31. data/test/simple_void_test.rb +1 -1
  32. data/test/terminal_charge_test.rb +2 -2
  33. data/test/terminal_clear_test.rb +2 -2
  34. data/test/terminal_ebt_balance_test.rb +2 -2
  35. data/test/terminal_ebt_charge_test.rb +2 -2
  36. data/test/terminal_enroll_test.rb +2 -2
  37. data/test/terminal_gift_card_balance_test.rb +2 -2
  38. data/test/terminal_keyed_charge_test.rb +2 -2
  39. data/test/terminal_manual_ebt_charge_test.rb +2 -2
  40. data/test/terminal_preauth_test.rb +2 -2
  41. data/test/terminal_status_test.rb +2 -2
  42. data/test/terminal_timeout_test.rb +2 -2
  43. data/test/terms_and_conditions_test.rb +2 -2
  44. data/test/test_helper.rb +2 -2
  45. data/test/text_prompt_test.rb +2 -2
  46. data/test/token_metadata_test.rb +51 -0
  47. data/test/transaction_history_test.rb +1 -1
  48. data/test/unlink_token_test.rb +52 -0
  49. data/test/update_customer_test.rb +1 -1
  50. data/test/update_transaction_display_test.rb +2 -2
  51. metadata +9 -2
@@ -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
@@ -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, 'merchant_profile_test')
24
+ test_delay(blockchyp, 'merchant_profile_test', config[:defaultTerminalName])
25
25
 
26
26
  # Set request parameters
27
27
  request = {
@@ -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, 'new_transaction_display_test')
24
+ test_delay(blockchyp, 'new_transaction_display_test', config[:defaultTerminalName])
25
25
 
26
26
  # Set request parameters
27
27
  request = {
28
28
  test: true,
29
- terminalName: 'Test Terminal',
29
+ terminalName: config[:defaultTerminalName],
30
30
  transaction: {
31
31
  subtotal: '35.00',
32
32
  tax: '5.00',
@@ -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, 'pan_charge_test')
24
+ test_delay(blockchyp, 'pan_charge_test', config[:defaultTerminalName])
25
25
 
26
26
  # Set request parameters
27
27
  request = {
@@ -21,12 +21,17 @@ module BlockChyp
21
21
  blockchyp.gateway_host = config[:gatewayHost]
22
22
  blockchyp.test_gateway_host = config[:testGatewayHost]
23
23
 
24
- test_delay(blockchyp, 'pan_enroll_test')
24
+ test_delay(blockchyp, 'pan_enroll_test', config[:defaultTerminalName])
25
25
 
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)
@@ -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, 'pan_preauth_test')
24
+ test_delay(blockchyp, 'pan_preauth_test', config[:defaultTerminalName])
25
25
 
26
26
  # Set request parameters
27
27
  request = {
@@ -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, 'partial_refund_test')
24
+ test_delay(blockchyp, 'partial_refund_test', config[:defaultTerminalName])
25
25
 
26
26
  # Set request parameters
27
27
  setup_request = {
@@ -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, 'search_customer_test')
24
+ test_delay(blockchyp, 'search_customer_test', config[:defaultTerminalName])
25
25
 
26
26
  # Set request parameters
27
27
  setup_request = {
@@ -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, 'send_payment_link_test')
24
+ test_delay(blockchyp, 'send_payment_link_test', config[:defaultTerminalName])
25
25
 
26
26
  # Set request parameters
27
27
  request = {
@@ -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, 'simple_batch_close_test')
24
+ test_delay(blockchyp, 'simple_batch_close_test', config[:defaultTerminalName])
25
25
 
26
26
  # Set request parameters
27
27
  setup_request = {
@@ -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, 'simple_capture_test')
24
+ test_delay(blockchyp, 'simple_capture_test', config[:defaultTerminalName])
25
25
 
26
26
  # Set request parameters
27
27
  setup_request = {
@@ -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, 'simple_gift_activate_test')
24
+ test_delay(blockchyp, 'simple_gift_activate_test', config[:defaultTerminalName])
25
25
 
26
26
  # Set request parameters
27
27
  request = {
28
28
  test: true,
29
- terminalName: 'Test Terminal',
29
+ terminalName: config[:defaultTerminalName],
30
30
  amount: '50.00'
31
31
  }
32
32
 
@@ -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
@@ -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, 'simple_message_test')
24
+ test_delay(blockchyp, 'simple_message_test', config[:defaultTerminalName])
25
25
 
26
26
  # Set request parameters
27
27
  request = {
28
28
  test: true,
29
- terminalName: 'Test Terminal',
29
+ terminalName: config[:defaultTerminalName],
30
30
  message: 'Thank You For Your Business'
31
31
  }
32
32
 
@@ -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, 'simple_ping_test')
24
+ test_delay(blockchyp, 'simple_ping_test', config[:defaultTerminalName])
25
25
 
26
26
  # Set request parameters
27
27
  request = {
28
28
  test: true,
29
- terminalName: 'Test Terminal'
29
+ terminalName: config[:defaultTerminalName]
30
30
  }
31
31
 
32
32
  response = blockchyp.ping(request)
@@ -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, 'simple_refund_test')
24
+ test_delay(blockchyp, 'simple_refund_test', config[:defaultTerminalName])
25
25
 
26
26
  # Set request parameters
27
27
  setup_request = {
@@ -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, 'simple_reversal_test')
24
+ test_delay(blockchyp, 'simple_reversal_test', config[:defaultTerminalName])
25
25
 
26
26
  # Set request parameters
27
27
  setup_request = {
@@ -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, 'simple_void_test')
24
+ test_delay(blockchyp, 'simple_void_test', config[:defaultTerminalName])
25
25
 
26
26
  # Set request parameters
27
27
  setup_request = {
@@ -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, 'terminal_charge_test')
24
+ test_delay(blockchyp, 'terminal_charge_test', config[:defaultTerminalName])
25
25
 
26
26
  # Set request parameters
27
27
  request = {
28
- terminalName: 'Test Terminal',
28
+ terminalName: config[:defaultTerminalName],
29
29
  amount: '25.15',
30
30
  test: true
31
31
  }
@@ -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, 'terminal_clear_test')
24
+ test_delay(blockchyp, 'terminal_clear_test', config[:defaultTerminalName])
25
25
 
26
26
  # Set request parameters
27
27
  request = {
28
28
  test: true,
29
- terminalName: 'Test Terminal'
29
+ terminalName: config[:defaultTerminalName]
30
30
  }
31
31
 
32
32
  response = blockchyp.clear(request)
@@ -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, 'terminal_ebt_balance_test')
24
+ test_delay(blockchyp, 'terminal_ebt_balance_test', config[:defaultTerminalName])
25
25
 
26
26
  # Set request parameters
27
27
  request = {
28
28
  test: true,
29
- terminalName: 'Test Terminal',
29
+ terminalName: config[:defaultTerminalName],
30
30
  cardType: CardType::EBT
31
31
  }
32
32
 
@@ -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, 'terminal_ebt_charge_test')
24
+ test_delay(blockchyp, 'terminal_ebt_charge_test', config[:defaultTerminalName])
25
25
 
26
26
  # Set request parameters
27
27
  request = {
28
- terminalName: 'Test Terminal',
28
+ terminalName: config[:defaultTerminalName],
29
29
  amount: '25.00',
30
30
  test: true,
31
31
  cardType: CardType::EBT
@@ -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, 'terminal_enroll_test')
24
+ test_delay(blockchyp, 'terminal_enroll_test', config[:defaultTerminalName])
25
25
 
26
26
  # Set request parameters
27
27
  request = {
28
- terminalName: 'Test Terminal',
28
+ terminalName: config[:defaultTerminalName],
29
29
  test: true
30
30
  }
31
31
 
@@ -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, 'terminal_gift_card_balance_test')
24
+ test_delay(blockchyp, 'terminal_gift_card_balance_test', config[:defaultTerminalName])
25
25
 
26
26
  # Set request parameters
27
27
  request = {
28
28
  test: true,
29
- terminalName: 'Test Terminal'
29
+ terminalName: config[:defaultTerminalName]
30
30
  }
31
31
 
32
32
  response = blockchyp.balance(request)
@@ -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, 'terminal_keyed_charge_test')
24
+ test_delay(blockchyp, 'terminal_keyed_charge_test', config[:defaultTerminalName])
25
25
 
26
26
  # Set request parameters
27
27
  request = {
28
- terminalName: 'Test Terminal',
28
+ terminalName: config[:defaultTerminalName],
29
29
  amount: '11.11',
30
30
  manualEntry: true,
31
31
  test: true
@@ -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, 'terminal_manual_ebt_charge_test')
24
+ test_delay(blockchyp, 'terminal_manual_ebt_charge_test', config[:defaultTerminalName])
25
25
 
26
26
  # Set request parameters
27
27
  request = {
28
- terminalName: 'Test Terminal',
28
+ terminalName: config[:defaultTerminalName],
29
29
  amount: '27.00',
30
30
  test: true,
31
31
  cardType: CardType::EBT,
@@ -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, 'terminal_preauth_test')
24
+ test_delay(blockchyp, 'terminal_preauth_test', config[:defaultTerminalName])
25
25
 
26
26
  # Set request parameters
27
27
  request = {
28
- terminalName: 'Test Terminal',
28
+ terminalName: config[:defaultTerminalName],
29
29
  amount: '15.15',
30
30
  test: true
31
31
  }
@@ -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, 'terminal_status_test')
24
+ test_delay(blockchyp, 'terminal_status_test', config[:defaultTerminalName])
25
25
 
26
26
  # Set request parameters
27
27
  request = {
28
- terminalName: 'Test Terminal'
28
+ terminalName: config[:defaultTerminalName]
29
29
  }
30
30
 
31
31
  response = blockchyp.terminal_status(request)
@@ -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, 'terminal_timeout_test')
24
+ test_delay(blockchyp, 'terminal_timeout_test', config[:defaultTerminalName])
25
25
 
26
26
  # Set request parameters
27
27
  request = {
28
28
  timeout: 1,
29
- terminalName: 'Test Terminal',
29
+ terminalName: config[:defaultTerminalName],
30
30
  amount: '25.15',
31
31
  test: true
32
32
  }
@@ -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, 'terms_and_conditions_test')
24
+ test_delay(blockchyp, 'terms_and_conditions_test', config[:defaultTerminalName])
25
25
 
26
26
  # Set request parameters
27
27
  request = {
28
28
  test: true,
29
- terminalName: 'Test Terminal',
29
+ terminalName: config[:defaultTerminalName],
30
30
  tcName: 'HIPPA Disclosure',
31
31
  tcContent: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum ullamcorper id urna quis pulvinar. Pellentesque vestibulum justo ac nulla consectetur tristique. Suspendisse arcu arcu, viverra vel luctus non, dapibus vitae augue. Aenean ac volutpat purus. Curabitur in lacus nisi. Nam vel sagittis eros. Curabitur faucibus ut nisl in pulvinar. Nunc egestas, orci ut porttitor tempus, ante mauris pellentesque ex, nec feugiat purus arcu ac metus. Cras sodales ornare lobortis. Aenean lacinia ultricies purus quis pharetra. Cras vestibulum nulla et magna eleifend eleifend. Nunc nibh dolor, malesuada ut suscipit vitae, bibendum quis dolor. Phasellus ultricies ex vitae dolor malesuada, vel dignissim neque accumsan.',
32
32
  sigFormat: SignatureFormat::PNG,
data/test/test_helper.rb CHANGED
@@ -34,7 +34,7 @@ module BlockChyp
34
34
  JSON.parse(content, symbolize_names: true)
35
35
  end
36
36
 
37
- def test_delay(client, test_name)
37
+ def test_delay(client, test_name, terminal_name)
38
38
  test_delay = ENV['BC_TEST_DELAY']
39
39
 
40
40
  if test_delay
@@ -42,7 +42,7 @@ module BlockChyp
42
42
  if test_delay_int.positive?
43
43
  request = {
44
44
  test: true,
45
- terminalName: 'Test Terminal',
45
+ terminalName: terminal_name,
46
46
  message: "Running #{test_name} in #{test_delay} seconds.."
47
47
  }
48
48
  response = client.message(request)
@@ -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, 'text_prompt_test')
24
+ test_delay(blockchyp, 'text_prompt_test', config[:defaultTerminalName])
25
25
 
26
26
  # Set request parameters
27
27
  request = {
28
28
  test: true,
29
- terminalName: 'Test Terminal',
29
+ terminalName: config[:defaultTerminalName],
30
30
  promptType: PromptType::EMAIL
31
31
  }
32
32
 
@@ -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
@@ -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, 'transaction_history_test')
24
+ test_delay(blockchyp, 'transaction_history_test', config[:defaultTerminalName])
25
25
 
26
26
  # Set request parameters
27
27
  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 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
@@ -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, 'update_customer_test')
24
+ test_delay(blockchyp, 'update_customer_test', config[:defaultTerminalName])
25
25
 
26
26
  # Set request parameters
27
27
  request = {
@@ -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, 'update_transaction_display_test')
24
+ test_delay(blockchyp, 'update_transaction_display_test', config[:defaultTerminalName])
25
25
 
26
26
  # Set request parameters
27
27
  request = {
28
28
  test: true,
29
- terminalName: 'Test Terminal',
29
+ terminalName: config[:defaultTerminalName],
30
30
  transaction: {
31
31
  subtotal: '35.00',
32
32
  tax: '5.00',