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,31 +14,31 @@ 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, 'terms_and_conditions_test')
25
25
 
26
26
  # Set request parameters
27
27
  request = {
28
- "test": true,
29
- "terminalName": 'Test Terminal',
30
- "tcName": 'HIPPA Disclosure',
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
- "sigFormat": SignatureFormat::PNG,
33
- "sigWidth": 200,
34
- "sigRequired": true
28
+ test: true,
29
+ terminalName: 'Test Terminal',
30
+ tcName: 'HIPPA Disclosure',
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
+ sigFormat: SignatureFormat::PNG,
33
+ sigWidth: 200,
34
+ sigRequired: true
35
35
  }
36
36
 
37
37
  response = blockchyp.terms_and_conditions(request)
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
@@ -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.5
4
+ version: 2.6.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-05-13 00:00:00.000000000 Z
11
+ date: 2020-10-28 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email:
@@ -29,10 +29,12 @@ files:
29
29
  - test/gateway_timeout_test.rb
30
30
  - test/get_customer_test.rb
31
31
  - test/heartbeat_test.rb
32
+ - test/merchant_profile_test.rb
32
33
  - test/new_transaction_display_test.rb
33
34
  - test/pan_charge_test.rb
34
35
  - test/pan_enroll_test.rb
35
36
  - test/pan_preauth_test.rb
37
+ - test/partial_refund_test.rb
36
38
  - test/search_customer_test.rb
37
39
  - test/send_payment_link_test.rb
38
40
  - test/simple_batch_close_test.rb