blockchyp 2.3.5 → 2.6.0

Sign up to get free protection for your applications and to get access to all the features.
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,28 +14,28 @@ 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_ebt_balance_test')
25
25
 
26
26
  # Set request parameters
27
27
  request = {
28
- "test": true,
29
- "terminalName": 'Test Terminal',
30
- "cardType": CardType::EBT
28
+ test: true,
29
+ terminalName: 'Test Terminal',
30
+ cardType: CardType::EBT
31
31
  }
32
32
 
33
33
  response = blockchyp.balance(request)
34
34
 
35
35
  assert_not_nil(response)
36
36
  # response assertions
37
- assert(response['success'])
38
- assert(!response['remainingBalance'].empty?)
37
+ assert(response[:success])
38
+ assert(!response[:remainingBalance].empty?)
39
39
  end
40
40
  end
41
41
  end
@@ -14,40 +14,40 @@ 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_ebt_charge_test')
25
25
 
26
26
  # Set request parameters
27
27
  request = {
28
- "terminalName": 'Test Terminal',
29
- "amount": '25.00',
30
- "test": true,
31
- "cardType": CardType::EBT
28
+ terminalName: 'Test Terminal',
29
+ amount: '25.00',
30
+ test: true,
31
+ cardType: CardType::EBT
32
32
  }
33
33
 
34
34
  response = blockchyp.charge(request)
35
35
 
36
36
  assert_not_nil(response)
37
37
  # response assertions
38
- assert(response['success'])
39
- assert(response['approved'])
40
- assert(response['test'])
41
- assert_equal(response['authCode'].length, 6)
42
- assert(!response['transactionId'].empty?)
43
- assert(!response['timestamp'].empty?)
44
- assert(!response['tickBlock'].empty?)
45
- assert_equal('approved', response['responseDescription'])
46
- assert(!response['paymentType'].empty?)
47
- assert(!response['maskedPan'].empty?)
48
- assert(!response['entryMethod'].empty?)
49
- assert_equal('25.00', response['authorizedAmount'])
50
- assert_equal('75.00', response['remainingBalance'])
38
+ assert(response[:success])
39
+ assert(response[:approved])
40
+ assert(response[:test])
41
+ assert_equal(response[:authCode].length, 6)
42
+ assert(!response[:transactionId].empty?)
43
+ assert(!response[:timestamp].empty?)
44
+ assert(!response[:tickBlock].empty?)
45
+ assert_equal('approved', response[:responseDescription])
46
+ assert(!response[:paymentType].empty?)
47
+ assert(!response[:maskedPan].empty?)
48
+ assert(!response[:entryMethod].empty?)
49
+ assert_equal('25.00', response[:authorizedAmount])
50
+ assert_equal('75.00', response[:remainingBalance])
51
51
  end
52
52
  end
53
53
  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, 'terminal_enroll_test')
25
25
 
26
26
  # Set request parameters
27
27
  request = {
28
- "terminalName": 'Test Terminal',
29
- "test": true
28
+ terminalName: 'Test Terminal',
29
+ test: true
30
30
  }
31
31
 
32
32
  response = blockchyp.enroll(request)
33
33
 
34
34
  assert_not_nil(response)
35
35
  # response assertions
36
- assert(response['success'])
37
- assert(response['approved'])
38
- assert(response['test'])
39
- assert_equal(response['authCode'].length, 6)
40
- assert(!response['transactionId'].empty?)
41
- assert(!response['timestamp'].empty?)
42
- assert(!response['tickBlock'].empty?)
43
- assert_equal('approved', response['responseDescription'])
44
- assert(!response['paymentType'].empty?)
45
- assert(!response['maskedPan'].empty?)
46
- assert(!response['entryMethod'].empty?)
47
- assert(!response['token'].empty?)
36
+ assert(response[:success])
37
+ assert(response[:approved])
38
+ assert(response[:test])
39
+ assert_equal(response[:authCode].length, 6)
40
+ assert(!response[:transactionId].empty?)
41
+ assert(!response[:timestamp].empty?)
42
+ assert(!response[:tickBlock].empty?)
43
+ assert_equal('approved', response[:responseDescription])
44
+ assert(!response[:paymentType].empty?)
45
+ assert(!response[:maskedPan].empty?)
46
+ assert(!response[:entryMethod].empty?)
47
+ assert(!response[:token].empty?)
48
48
  end
49
49
  end
50
50
  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, 'terminal_gift_card_balance_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.balance(request)
33
33
 
34
34
  assert_not_nil(response)
35
35
  # response assertions
36
- assert(response['success'])
37
- assert(!response['remainingBalance'].empty?)
36
+ assert(response[:success])
37
+ assert(!response[:remainingBalance].empty?)
38
38
  end
39
39
  end
40
40
  end
@@ -14,39 +14,39 @@ 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_keyed_charge_test')
25
25
 
26
26
  # Set request parameters
27
27
  request = {
28
- "terminalName": 'Test Terminal',
29
- "amount": '11.11',
30
- "manualEntry": true,
31
- "test": true
28
+ terminalName: 'Test Terminal',
29
+ amount: '11.11',
30
+ manualEntry: true,
31
+ test: true
32
32
  }
33
33
 
34
34
  response = blockchyp.charge(request)
35
35
 
36
36
  assert_not_nil(response)
37
37
  # response assertions
38
- assert(response['success'])
39
- assert(response['approved'])
40
- assert(response['test'])
41
- assert_equal(response['authCode'].length, 6)
42
- assert(!response['transactionId'].empty?)
43
- assert(!response['timestamp'].empty?)
44
- assert(!response['tickBlock'].empty?)
45
- assert_equal('approved', response['responseDescription'])
46
- assert(!response['paymentType'].empty?)
47
- assert(!response['maskedPan'].empty?)
48
- assert(!response['entryMethod'].empty?)
49
- assert_equal('11.11', response['authorizedAmount'])
38
+ assert(response[:success])
39
+ assert(response[:approved])
40
+ assert(response[:test])
41
+ assert_equal(response[:authCode].length, 6)
42
+ assert(!response[:transactionId].empty?)
43
+ assert(!response[:timestamp].empty?)
44
+ assert(!response[:tickBlock].empty?)
45
+ assert_equal('approved', response[:responseDescription])
46
+ assert(!response[:paymentType].empty?)
47
+ assert(!response[:maskedPan].empty?)
48
+ assert(!response[:entryMethod].empty?)
49
+ assert_equal('11.11', response[:authorizedAmount])
50
50
  end
51
51
  end
52
52
  end
@@ -14,41 +14,41 @@ 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_manual_ebt_charge_test')
25
25
 
26
26
  # Set request parameters
27
27
  request = {
28
- "terminalName": 'Test Terminal',
29
- "amount": '27.00',
30
- "test": true,
31
- "cardType": CardType::EBT,
32
- "manualEntry": true
28
+ terminalName: 'Test Terminal',
29
+ amount: '27.00',
30
+ test: true,
31
+ cardType: CardType::EBT,
32
+ manualEntry: true
33
33
  }
34
34
 
35
35
  response = blockchyp.charge(request)
36
36
 
37
37
  assert_not_nil(response)
38
38
  # response assertions
39
- assert(response['success'])
40
- assert(response['approved'])
41
- assert(response['test'])
42
- assert_equal(response['authCode'].length, 6)
43
- assert(!response['transactionId'].empty?)
44
- assert(!response['timestamp'].empty?)
45
- assert(!response['tickBlock'].empty?)
46
- assert_equal('approved', response['responseDescription'])
47
- assert(!response['paymentType'].empty?)
48
- assert(!response['maskedPan'].empty?)
49
- assert(!response['entryMethod'].empty?)
50
- assert_equal('27.00', response['authorizedAmount'])
51
- assert_equal('73.00', response['remainingBalance'])
39
+ assert(response[:success])
40
+ assert(response[:approved])
41
+ assert(response[:test])
42
+ assert_equal(response[:authCode].length, 6)
43
+ assert(!response[:transactionId].empty?)
44
+ assert(!response[:timestamp].empty?)
45
+ assert(!response[:tickBlock].empty?)
46
+ assert_equal('approved', response[:responseDescription])
47
+ assert(!response[:paymentType].empty?)
48
+ assert(!response[:maskedPan].empty?)
49
+ assert(!response[:entryMethod].empty?)
50
+ assert_equal('27.00', response[:authorizedAmount])
51
+ assert_equal('73.00', response[:remainingBalance])
52
52
  end
53
53
  end
54
54
  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_preauth_test')
25
25
 
26
26
  # Set request parameters
27
27
  request = {
28
- "terminalName": 'Test Terminal',
29
- "amount": '15.15',
30
- "test": true
28
+ terminalName: 'Test Terminal',
29
+ amount: '15.15',
30
+ test: true
31
31
  }
32
32
 
33
33
  response = blockchyp.preauth(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('15.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('15.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_status_test')
25
25
 
26
26
  # Set request parameters
27
27
  request = {
28
- "terminalName": 'Test Terminal'
28
+ terminalName: 'Test Terminal'
29
29
  }
30
30
 
31
31
  response = blockchyp.terminal_status(request)
32
32
 
33
33
  assert_not_nil(response)
34
34
  # response assertions
35
- assert(response['success'])
36
- assert(response['idle'])
35
+ assert(response[:success])
36
+ assert(response[:idle])
37
37
  end
38
38
  end
39
39
  end
@@ -14,21 +14,21 @@ 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_timeout_test')
25
25
 
26
26
  # Set request parameters
27
27
  request = {
28
- "timeout": 1,
29
- "terminalName": 'Test Terminal',
30
- "amount": '25.15',
31
- "test": true
28
+ timeout: 1,
29
+ terminalName: 'Test Terminal',
30
+ amount: '25.15',
31
+ test: true
32
32
  }
33
33
 
34
34
  assert_raise Net::ReadTimeout do