blockchyp 2.3.5 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +155 -117
  3. data/lib/blockchyp.rb +6 -1
  4. data/lib/blockchyp/version.rb +1 -1
  5. data/lib/blockchyp_client.rb +50 -60
  6. data/test/batch_history_test.rb +11 -11
  7. data/test/boolean_prompt_test.rb +12 -12
  8. data/test/capture_signature_test.rb +9 -9
  9. data/test/gateway_timeout_test.rb +10 -10
  10. data/test/get_customer_test.rb +13 -13
  11. data/test/heartbeat_test.rb +10 -10
  12. data/test/merchant_profile_test.rb +38 -0
  13. data/test/new_transaction_display_test.rb +20 -20
  14. data/test/pan_charge_test.rb +22 -22
  15. data/test/pan_enroll_test.rb +20 -20
  16. data/test/pan_preauth_test.rb +21 -21
  17. data/test/partial_refund_test.rb +51 -0
  18. data/test/search_customer_test.rb +13 -13
  19. data/test/send_payment_link_test.rb +26 -26
  20. data/test/simple_batch_close_test.rb +11 -13
  21. data/test/simple_capture_test.rb +12 -12
  22. data/test/simple_gift_activate_test.rb +11 -11
  23. data/test/simple_message_test.rb +9 -9
  24. data/test/simple_ping_test.rb +8 -8
  25. data/test/simple_refund_test.rb +13 -13
  26. data/test/simple_reversal_test.rb +13 -13
  27. data/test/simple_void_test.rb +13 -13
  28. data/test/terminal_charge_test.rb +20 -20
  29. data/test/terminal_clear_test.rb +8 -8
  30. data/test/terminal_ebt_balance_test.rb +10 -10
  31. data/test/terminal_ebt_charge_test.rb +22 -22
  32. data/test/terminal_enroll_test.rb +19 -19
  33. data/test/terminal_gift_card_balance_test.rb +9 -9
  34. data/test/terminal_keyed_charge_test.rb +21 -21
  35. data/test/terminal_manual_ebt_charge_test.rb +23 -23
  36. data/test/terminal_preauth_test.rb +20 -20
  37. data/test/terminal_status_test.rb +8 -8
  38. data/test/terminal_timeout_test.rb +9 -9
  39. data/test/terms_and_conditions_test.rb +13 -13
  40. data/test/test_helper.rb +7 -6
  41. data/test/text_prompt_test.rb +10 -10
  42. data/test/transaction_history_test.rb +11 -11
  43. data/test/update_customer_test.rb +12 -12
  44. data/test/update_transaction_display_test.rb +20 -20
  45. metadata +4 -2
@@ -14,37 +14,35 @@ module BlockChyp
14
14
  config = load_test_config
15
15
 
16
16
  blockchyp = BlockChyp.new(
17
- config['apiKey'],
18
- config['bearerToken'],
19
- config['signingKey']
17
+ config[:apiKey],
18
+ config[:bearerToken],
19
+ config[:signingKey]
20
20
  )
21
- blockchyp.gateway_host = config['gatewayHost']
22
- blockchyp.test_gateway_host = config['testGatewayHost']
21
+ blockchyp.gateway_host = config[:gatewayHost]
22
+ blockchyp.test_gateway_host = config[:testGatewayHost]
23
23
 
24
24
  test_delay(blockchyp, 'simple_batch_close_test')
25
25
 
26
26
  # Set request parameters
27
27
  setup_request = {
28
- "pan": '4111111111111111',
29
- "amount": '25.55',
30
- "test": true,
31
- "transactionRef": uuid
28
+ pan: '4111111111111111',
29
+ amount: '25.55',
30
+ test: true,
31
+ transactionRef: uuid
32
32
  }
33
33
 
34
34
  response = blockchyp.charge(setup_request)
35
35
 
36
36
  # Set request parameters
37
37
  request = {
38
- "test": true
38
+ test: true
39
39
  }
40
40
 
41
41
  response = blockchyp.close_batch(request)
42
42
 
43
43
  assert_not_nil(response)
44
44
  # response assertions
45
- assert(response['success'])
46
- assert(!response['capturedTotal'].empty?)
47
- assert(!response['openPreauths'].empty?)
45
+ assert(response[:success])
48
46
  end
49
47
  end
50
48
  end
@@ -14,36 +14,36 @@ module BlockChyp
14
14
  config = load_test_config
15
15
 
16
16
  blockchyp = BlockChyp.new(
17
- config['apiKey'],
18
- config['bearerToken'],
19
- config['signingKey']
17
+ config[:apiKey],
18
+ config[:bearerToken],
19
+ config[:signingKey]
20
20
  )
21
- blockchyp.gateway_host = config['gatewayHost']
22
- blockchyp.test_gateway_host = config['testGatewayHost']
21
+ blockchyp.gateway_host = config[:gatewayHost]
22
+ blockchyp.test_gateway_host = config[:testGatewayHost]
23
23
 
24
24
  test_delay(blockchyp, 'simple_capture_test')
25
25
 
26
26
  # Set request parameters
27
27
  setup_request = {
28
- "pan": '4111111111111111',
29
- "amount": '25.55',
30
- "test": true
28
+ pan: '4111111111111111',
29
+ amount: '25.55',
30
+ test: true
31
31
  }
32
32
 
33
33
  response = blockchyp.preauth(setup_request)
34
34
 
35
35
  # Set request parameters
36
36
  request = {
37
- "transactionId": response['transactionId'],
38
- "test": true
37
+ transactionId: response[:transactionId],
38
+ test: true
39
39
  }
40
40
 
41
41
  response = blockchyp.capture(request)
42
42
 
43
43
  assert_not_nil(response)
44
44
  # response assertions
45
- assert(response['success'])
46
- assert(response['approved'])
45
+ assert(response[:success])
46
+ assert(response[:approved])
47
47
  end
48
48
  end
49
49
  end
@@ -14,29 +14,29 @@ module BlockChyp
14
14
  config = load_test_config
15
15
 
16
16
  blockchyp = BlockChyp.new(
17
- config['apiKey'],
18
- config['bearerToken'],
19
- config['signingKey']
17
+ config[:apiKey],
18
+ config[:bearerToken],
19
+ config[:signingKey]
20
20
  )
21
- blockchyp.gateway_host = config['gatewayHost']
22
- blockchyp.test_gateway_host = config['testGatewayHost']
21
+ blockchyp.gateway_host = config[:gatewayHost]
22
+ blockchyp.test_gateway_host = config[:testGatewayHost]
23
23
 
24
24
  test_delay(blockchyp, 'simple_gift_activate_test')
25
25
 
26
26
  # Set request parameters
27
27
  request = {
28
- "test": true,
29
- "terminalName": 'Test Terminal',
30
- "amount": '50.00'
28
+ test: true,
29
+ terminalName: 'Test Terminal',
30
+ amount: '50.00'
31
31
  }
32
32
 
33
33
  response = blockchyp.gift_activate(request)
34
34
 
35
35
  assert_not_nil(response)
36
36
  # response assertions
37
- assert(response['success'])
38
- assert(response['approved'])
39
- assert(!response['publicKey'].empty?)
37
+ assert(response[:success])
38
+ assert(response[:approved])
39
+ assert(!response[:publicKey].empty?)
40
40
  end
41
41
  end
42
42
  end
@@ -14,27 +14,27 @@ module BlockChyp
14
14
  config = load_test_config
15
15
 
16
16
  blockchyp = BlockChyp.new(
17
- config['apiKey'],
18
- config['bearerToken'],
19
- config['signingKey']
17
+ config[:apiKey],
18
+ config[:bearerToken],
19
+ config[:signingKey]
20
20
  )
21
- blockchyp.gateway_host = config['gatewayHost']
22
- blockchyp.test_gateway_host = config['testGatewayHost']
21
+ blockchyp.gateway_host = config[:gatewayHost]
22
+ blockchyp.test_gateway_host = config[:testGatewayHost]
23
23
 
24
24
  test_delay(blockchyp, 'simple_message_test')
25
25
 
26
26
  # Set request parameters
27
27
  request = {
28
- "test": true,
29
- "terminalName": 'Test Terminal',
30
- "message": 'Thank You For Your Business'
28
+ test: true,
29
+ terminalName: 'Test Terminal',
30
+ message: 'Thank You For Your Business'
31
31
  }
32
32
 
33
33
  response = blockchyp.message(request)
34
34
 
35
35
  assert_not_nil(response)
36
36
  # response assertions
37
- assert(response['success'])
37
+ assert(response[:success])
38
38
  end
39
39
  end
40
40
  end
@@ -14,26 +14,26 @@ module BlockChyp
14
14
  config = load_test_config
15
15
 
16
16
  blockchyp = BlockChyp.new(
17
- config['apiKey'],
18
- config['bearerToken'],
19
- config['signingKey']
17
+ config[:apiKey],
18
+ config[:bearerToken],
19
+ config[:signingKey]
20
20
  )
21
- blockchyp.gateway_host = config['gatewayHost']
22
- blockchyp.test_gateway_host = config['testGatewayHost']
21
+ blockchyp.gateway_host = config[:gatewayHost]
22
+ blockchyp.test_gateway_host = config[:testGatewayHost]
23
23
 
24
24
  test_delay(blockchyp, 'simple_ping_test')
25
25
 
26
26
  # Set request parameters
27
27
  request = {
28
- "test": true,
29
- "terminalName": 'Test Terminal'
28
+ test: true,
29
+ terminalName: 'Test Terminal'
30
30
  }
31
31
 
32
32
  response = blockchyp.ping(request)
33
33
 
34
34
  assert_not_nil(response)
35
35
  # response assertions
36
- assert(response['success'])
36
+ assert(response[:success])
37
37
  end
38
38
  end
39
39
  end
@@ -14,37 +14,37 @@ module BlockChyp
14
14
  config = load_test_config
15
15
 
16
16
  blockchyp = BlockChyp.new(
17
- config['apiKey'],
18
- config['bearerToken'],
19
- config['signingKey']
17
+ config[:apiKey],
18
+ config[:bearerToken],
19
+ config[:signingKey]
20
20
  )
21
- blockchyp.gateway_host = config['gatewayHost']
22
- blockchyp.test_gateway_host = config['testGatewayHost']
21
+ blockchyp.gateway_host = config[:gatewayHost]
22
+ blockchyp.test_gateway_host = config[:testGatewayHost]
23
23
 
24
24
  test_delay(blockchyp, 'simple_refund_test')
25
25
 
26
26
  # Set request parameters
27
27
  setup_request = {
28
- "pan": '4111111111111111',
29
- "amount": '25.55',
30
- "test": true,
31
- "transactionRef": uuid
28
+ pan: '4111111111111111',
29
+ amount: '25.55',
30
+ test: true,
31
+ transactionRef: uuid
32
32
  }
33
33
 
34
34
  response = blockchyp.charge(setup_request)
35
35
 
36
36
  # Set request parameters
37
37
  request = {
38
- "transactionId": response['transactionId'],
39
- "test": true
38
+ transactionId: response[:transactionId],
39
+ test: true
40
40
  }
41
41
 
42
42
  response = blockchyp.refund(request)
43
43
 
44
44
  assert_not_nil(response)
45
45
  # response assertions
46
- assert(response['success'])
47
- assert(response['approved'])
46
+ assert(response[:success])
47
+ assert(response[:approved])
48
48
  end
49
49
  end
50
50
  end
@@ -14,37 +14,37 @@ module BlockChyp
14
14
  config = load_test_config
15
15
 
16
16
  blockchyp = BlockChyp.new(
17
- config['apiKey'],
18
- config['bearerToken'],
19
- config['signingKey']
17
+ config[:apiKey],
18
+ config[:bearerToken],
19
+ config[:signingKey]
20
20
  )
21
- blockchyp.gateway_host = config['gatewayHost']
22
- blockchyp.test_gateway_host = config['testGatewayHost']
21
+ blockchyp.gateway_host = config[:gatewayHost]
22
+ blockchyp.test_gateway_host = config[:testGatewayHost]
23
23
 
24
24
  test_delay(blockchyp, 'simple_reversal_test')
25
25
 
26
26
  # Set request parameters
27
27
  setup_request = {
28
- "pan": '4111111111111111',
29
- "amount": '25.55',
30
- "test": true,
31
- "transactionRef": uuid
28
+ pan: '4111111111111111',
29
+ amount: '25.55',
30
+ test: true,
31
+ transactionRef: uuid
32
32
  }
33
33
 
34
34
  response = blockchyp.charge(setup_request)
35
35
 
36
36
  # Set request parameters
37
37
  request = {
38
- "transactionRef": response['transactionRef'],
39
- "test": true
38
+ transactionRef: response[:transactionRef],
39
+ test: true
40
40
  }
41
41
 
42
42
  response = blockchyp.reverse(request)
43
43
 
44
44
  assert_not_nil(response)
45
45
  # response assertions
46
- assert(response['success'])
47
- assert(response['approved'])
46
+ assert(response[:success])
47
+ assert(response[:approved])
48
48
  end
49
49
  end
50
50
  end
@@ -14,37 +14,37 @@ module BlockChyp
14
14
  config = load_test_config
15
15
 
16
16
  blockchyp = BlockChyp.new(
17
- config['apiKey'],
18
- config['bearerToken'],
19
- config['signingKey']
17
+ config[:apiKey],
18
+ config[:bearerToken],
19
+ config[:signingKey]
20
20
  )
21
- blockchyp.gateway_host = config['gatewayHost']
22
- blockchyp.test_gateway_host = config['testGatewayHost']
21
+ blockchyp.gateway_host = config[:gatewayHost]
22
+ blockchyp.test_gateway_host = config[:testGatewayHost]
23
23
 
24
24
  test_delay(blockchyp, 'simple_void_test')
25
25
 
26
26
  # Set request parameters
27
27
  setup_request = {
28
- "pan": '4111111111111111',
29
- "amount": '25.55',
30
- "test": true,
31
- "transactionRef": uuid
28
+ pan: '4111111111111111',
29
+ amount: '25.55',
30
+ test: true,
31
+ transactionRef: uuid
32
32
  }
33
33
 
34
34
  response = blockchyp.charge(setup_request)
35
35
 
36
36
  # Set request parameters
37
37
  request = {
38
- "transactionId": response['transactionId'],
39
- "test": true
38
+ transactionId: response[:transactionId],
39
+ test: true
40
40
  }
41
41
 
42
42
  response = blockchyp.void(request)
43
43
 
44
44
  assert_not_nil(response)
45
45
  # response assertions
46
- assert(response['success'])
47
- assert(response['approved'])
46
+ assert(response[:success])
47
+ assert(response[:approved])
48
48
  end
49
49
  end
50
50
  end
@@ -14,38 +14,38 @@ module BlockChyp
14
14
  config = load_test_config
15
15
 
16
16
  blockchyp = BlockChyp.new(
17
- config['apiKey'],
18
- config['bearerToken'],
19
- config['signingKey']
17
+ config[:apiKey],
18
+ config[:bearerToken],
19
+ config[:signingKey]
20
20
  )
21
- blockchyp.gateway_host = config['gatewayHost']
22
- blockchyp.test_gateway_host = config['testGatewayHost']
21
+ blockchyp.gateway_host = config[:gatewayHost]
22
+ blockchyp.test_gateway_host = config[:testGatewayHost]
23
23
 
24
24
  test_delay(blockchyp, 'terminal_charge_test')
25
25
 
26
26
  # Set request parameters
27
27
  request = {
28
- "terminalName": 'Test Terminal',
29
- "amount": '25.15',
30
- "test": true
28
+ terminalName: 'Test Terminal',
29
+ amount: '25.15',
30
+ test: true
31
31
  }
32
32
 
33
33
  response = blockchyp.charge(request)
34
34
 
35
35
  assert_not_nil(response)
36
36
  # response assertions
37
- assert(response['success'])
38
- assert(response['approved'])
39
- assert(response['test'])
40
- assert_equal(response['authCode'].length, 6)
41
- assert(!response['transactionId'].empty?)
42
- assert(!response['timestamp'].empty?)
43
- assert(!response['tickBlock'].empty?)
44
- assert_equal('approved', response['responseDescription'])
45
- assert(!response['paymentType'].empty?)
46
- assert(!response['maskedPan'].empty?)
47
- assert(!response['entryMethod'].empty?)
48
- assert_equal('25.15', response['authorizedAmount'])
37
+ assert(response[:success])
38
+ assert(response[:approved])
39
+ assert(response[:test])
40
+ assert_equal(response[:authCode].length, 6)
41
+ assert(!response[:transactionId].empty?)
42
+ assert(!response[:timestamp].empty?)
43
+ assert(!response[:tickBlock].empty?)
44
+ assert_equal('approved', response[:responseDescription])
45
+ assert(!response[:paymentType].empty?)
46
+ assert(!response[:maskedPan].empty?)
47
+ assert(!response[:entryMethod].empty?)
48
+ assert_equal('25.15', response[:authorizedAmount])
49
49
  end
50
50
  end
51
51
  end
@@ -14,26 +14,26 @@ module BlockChyp
14
14
  config = load_test_config
15
15
 
16
16
  blockchyp = BlockChyp.new(
17
- config['apiKey'],
18
- config['bearerToken'],
19
- config['signingKey']
17
+ config[:apiKey],
18
+ config[:bearerToken],
19
+ config[:signingKey]
20
20
  )
21
- blockchyp.gateway_host = config['gatewayHost']
22
- blockchyp.test_gateway_host = config['testGatewayHost']
21
+ blockchyp.gateway_host = config[:gatewayHost]
22
+ blockchyp.test_gateway_host = config[:testGatewayHost]
23
23
 
24
24
  test_delay(blockchyp, 'terminal_clear_test')
25
25
 
26
26
  # Set request parameters
27
27
  request = {
28
- "test": true,
29
- "terminalName": 'Test Terminal'
28
+ test: true,
29
+ terminalName: 'Test Terminal'
30
30
  }
31
31
 
32
32
  response = blockchyp.clear(request)
33
33
 
34
34
  assert_not_nil(response)
35
35
  # response assertions
36
- assert(response['success'])
36
+ assert(response[:success])
37
37
  end
38
38
  end
39
39
  end