blockchyp 2.3.7 → 2.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +118 -113
  3. data/lib/blockchyp.rb +1 -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 +7 -7
  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/search_customer_test.rb +13 -13
  18. data/test/send_payment_link_test.rb +26 -26
  19. data/test/simple_batch_close_test.rb +11 -11
  20. data/test/simple_capture_test.rb +12 -12
  21. data/test/simple_gift_activate_test.rb +11 -11
  22. data/test/simple_message_test.rb +9 -9
  23. data/test/simple_ping_test.rb +8 -8
  24. data/test/simple_refund_test.rb +13 -13
  25. data/test/simple_reversal_test.rb +13 -13
  26. data/test/simple_void_test.rb +13 -13
  27. data/test/terminal_charge_test.rb +20 -20
  28. data/test/terminal_clear_test.rb +8 -8
  29. data/test/terminal_ebt_balance_test.rb +10 -10
  30. data/test/terminal_ebt_charge_test.rb +22 -22
  31. data/test/terminal_enroll_test.rb +19 -19
  32. data/test/terminal_gift_card_balance_test.rb +9 -9
  33. data/test/terminal_keyed_charge_test.rb +21 -21
  34. data/test/terminal_manual_ebt_charge_test.rb +23 -23
  35. data/test/terminal_preauth_test.rb +20 -20
  36. data/test/terminal_status_test.rb +8 -8
  37. data/test/terminal_timeout_test.rb +9 -9
  38. data/test/terms_and_conditions_test.rb +13 -13
  39. data/test/test_helper.rb +7 -6
  40. data/test/text_prompt_test.rb +10 -10
  41. data/test/transaction_history_test.rb +11 -11
  42. data/test/update_customer_test.rb +12 -12
  43. data/test/update_transaction_display_test.rb +20 -20
  44. metadata +2 -2
@@ -31,7 +31,7 @@ module BlockChyp
31
31
  config_file = File.open(file_name)
32
32
  content = config_file.read
33
33
 
34
- JSON.parse(content)
34
+ JSON.parse(content, symbolize_names: true)
35
35
  end
36
36
 
37
37
  def test_delay(client, test_name)
@@ -40,15 +40,16 @@ module BlockChyp
40
40
  if test_delay
41
41
  test_delay_int = Integer(test_delay)
42
42
  if test_delay_int.positive?
43
- request = {}
44
- request['test'] = true
45
- request['terminalName'] = 'Test Terminal'
46
- request['message'] = "Running #{test_name} in #{test_delay} seconds.."
43
+ request = {
44
+ test: true,
45
+ terminalName: 'Test Terminal',
46
+ message: "Running #{test_name} in #{test_delay} seconds.."
47
+ }
47
48
  response = client.message(request)
48
49
 
49
50
  assert_not_nil(response)
50
51
  # response assertions
51
- assert(response['success'])
52
+ assert(response[:success])
52
53
  sleep test_delay_int
53
54
  end
54
55
  end
@@ -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, 'text_prompt_test')
25
25
 
26
26
  # Set request parameters
27
27
  request = {
28
- "test": true,
29
- "terminalName": 'Test Terminal',
30
- "promptType": PromptType::EMAIL
28
+ test: true,
29
+ terminalName: 'Test Terminal',
30
+ promptType: PromptType::EMAIL
31
31
  }
32
32
 
33
33
  response = blockchyp.text_prompt(request)
34
34
 
35
35
  assert_not_nil(response)
36
36
  # response assertions
37
- assert(response['success'])
38
- assert(!response['response'].empty?)
37
+ assert(response[:success])
38
+ assert(!response[:response].empty?)
39
39
  end
40
40
  end
41
41
  end
@@ -14,35 +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, 'transaction_history_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
- "maxResults": 10
38
+ maxResults: 10
39
39
  }
40
40
 
41
41
  response = blockchyp.transaction_history(request)
42
42
 
43
43
  assert_not_nil(response)
44
44
  # response assertions
45
- assert(response['success'])
45
+ assert(response[:success])
46
46
  end
47
47
  end
48
48
  end
@@ -14,23 +14,23 @@ 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, 'update_customer_test')
25
25
 
26
26
  # Set request parameters
27
27
  request = {
28
- "customer": {
29
- "firstName": 'Test',
30
- "lastName": 'Customer',
31
- "companyName": 'Test Company',
32
- "emailAddress": 'support@blockchyp.com',
33
- "smsNumber": '(123) 123-1234'
28
+ customer: {
29
+ firstName: 'Test',
30
+ lastName: 'Customer',
31
+ companyName: 'Test Company',
32
+ emailAddress: 'support@blockchyp.com',
33
+ smsNumber: '(123) 123-1234'
34
34
  }
35
35
  }
36
36
 
@@ -38,7 +38,7 @@ module BlockChyp
38
38
 
39
39
  assert_not_nil(response)
40
40
  # response assertions
41
- assert(response['success'])
41
+ assert(response[:success])
42
42
  end
43
43
  end
44
44
  end
@@ -14,33 +14,33 @@ 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, 'update_transaction_display_test')
25
25
 
26
26
  # Set request parameters
27
27
  request = {
28
- "test": true,
29
- "terminalName": 'Test Terminal',
30
- "transaction": {
31
- "subtotal": '35.00',
32
- "tax": '5.00',
33
- "total": '70.00',
34
- "items": [
28
+ test: true,
29
+ terminalName: 'Test Terminal',
30
+ transaction: {
31
+ subtotal: '35.00',
32
+ tax: '5.00',
33
+ total: '70.00',
34
+ items: [
35
35
  {
36
- "description": 'Leki Trekking Poles',
37
- "price": '35.00',
38
- "quantity": 2,
39
- "extended": '70.00',
40
- "discounts": [
36
+ description: 'Leki Trekking Poles',
37
+ price: '35.00',
38
+ quantity: 2,
39
+ extended: '70.00',
40
+ discounts: [
41
41
  {
42
- "description": 'memberDiscount',
43
- "amount": '10.00'
42
+ description: 'memberDiscount',
43
+ amount: '10.00'
44
44
  }
45
45
  ]
46
46
  }
@@ -52,7 +52,7 @@ module BlockChyp
52
52
 
53
53
  assert_not_nil(response)
54
54
  # response assertions
55
- assert(response['success'])
55
+ assert(response[:success])
56
56
  end
57
57
  end
58
58
  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.3.7
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - BlockChyp
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-02 00:00:00.000000000 Z
11
+ date: 2020-08-13 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: