blockchyp 2.0.0.pre.alpha7 → 2.0.1.pre.rc8

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,40 @@
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 GatewayTimeoutTest < TestCase
13
+ def test_gateway_timeout
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, 'gateway_timeout_test')
25
+
26
+ # setup request object
27
+ request = {}
28
+ request['timeout'] = 1
29
+ request['pan'] = '5555555555554444'
30
+ request['amount'] = '25.55'
31
+ request['test'] = true
32
+ request['transactionRef'] = uuid
33
+
34
+ assert_raise Net::ReadTimeout do
35
+ blockchyp.charge(request)
36
+ end
37
+ end
38
+
39
+ end
40
+ end
@@ -12,8 +12,8 @@ module BlockChyp
12
12
  config['bearerToken'],
13
13
  config['signingKey']
14
14
  )
15
- blockchyp.gatewayHost = config['gatewayHost']
16
- blockchyp.testGatewayHost = config['testGatewayHost']
15
+ blockchyp.gateway_host = config['gatewayHost']
16
+ blockchyp.test_gateway_host = config['testGatewayHost']
17
17
 
18
18
  response = blockchyp.heartbeat(true)
19
19
  assert_not_nil(response)
@@ -1,5 +1,11 @@
1
1
  # frozen_string_literal: true
2
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
+
3
9
  require ::File.expand_path('test_helper', __dir__)
4
10
 
5
11
  module BlockChyp
@@ -15,13 +21,15 @@ module BlockChyp
15
21
  blockchyp.gateway_host = config['gatewayHost']
16
22
  blockchyp.test_gateway_host = config['testGatewayHost']
17
23
 
18
- test_delay(blockchyp, 'NewTransactionDisplayTest')
24
+ test_delay(blockchyp, 'new_transaction_display_test')
25
+
19
26
  # setup request object
20
27
  request = {}
21
28
  request['test'] = true
22
29
  request['terminalName'] = 'Test Terminal'
23
30
  request['transaction'] = new_transaction_display_transaction
24
- response = blockchyp.newTransactionDisplay(request)
31
+
32
+ response = blockchyp.new_transaction_display(request)
25
33
 
26
34
  assert_not_nil(response)
27
35
  # response assertions
@@ -1,5 +1,11 @@
1
1
  # frozen_string_literal: true
2
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
+
3
9
  require ::File.expand_path('test_helper', __dir__)
4
10
 
5
11
  module BlockChyp
@@ -15,17 +21,20 @@ module BlockChyp
15
21
  blockchyp.gateway_host = config['gatewayHost']
16
22
  blockchyp.test_gateway_host = config['testGatewayHost']
17
23
 
18
- test_delay(blockchyp, 'PANChargeTest')
24
+ test_delay(blockchyp, 'pan_charge_test')
25
+
19
26
  # setup request object
20
27
  request = {}
21
28
  request['pan'] = '4111111111111111'
22
29
  request['amount'] = '25.55'
23
30
  request['test'] = true
24
31
  request['transactionRef'] = uuid
32
+
25
33
  response = blockchyp.charge(request)
26
34
 
27
35
  assert_not_nil(response)
28
36
  # response assertions
37
+ assert(response['success'])
29
38
  assert(response['approved'])
30
39
  assert(response['test'])
31
40
  assert_equal(response['authCode'].length, 6)
@@ -1,5 +1,11 @@
1
1
  # frozen_string_literal: true
2
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
+
3
9
  require ::File.expand_path('test_helper', __dir__)
4
10
 
5
11
  module BlockChyp
@@ -15,15 +21,18 @@ module BlockChyp
15
21
  blockchyp.gateway_host = config['gatewayHost']
16
22
  blockchyp.test_gateway_host = config['testGatewayHost']
17
23
 
18
- test_delay(blockchyp, 'PANEnrollTest')
24
+ test_delay(blockchyp, 'pan_enroll_test')
25
+
19
26
  # setup request object
20
27
  request = {}
21
28
  request['pan'] = '4111111111111111'
22
29
  request['test'] = true
30
+
23
31
  response = blockchyp.enroll(request)
24
32
 
25
33
  assert_not_nil(response)
26
34
  # response assertions
35
+ assert(response['success'])
27
36
  assert(response['approved'])
28
37
  assert(response['test'])
29
38
  assert_equal(response['authCode'].length, 6)
@@ -1,5 +1,11 @@
1
1
  # frozen_string_literal: true
2
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
+
3
9
  require ::File.expand_path('test_helper', __dir__)
4
10
 
5
11
  module BlockChyp
@@ -15,16 +21,19 @@ module BlockChyp
15
21
  blockchyp.gateway_host = config['gatewayHost']
16
22
  blockchyp.test_gateway_host = config['testGatewayHost']
17
23
 
18
- test_delay(blockchyp, 'PANPreauthTest')
24
+ test_delay(blockchyp, 'pan_preauth_test')
25
+
19
26
  # setup request object
20
27
  request = {}
21
28
  request['pan'] = '4111111111111111'
22
29
  request['amount'] = '25.55'
23
30
  request['test'] = true
31
+
24
32
  response = blockchyp.preauth(request)
25
33
 
26
34
  assert_not_nil(response)
27
35
  # response assertions
36
+ assert(response['success'])
28
37
  assert(response['approved'])
29
38
  assert(response['test'])
30
39
  assert_equal(response['authCode'].length, 6)
@@ -1,5 +1,11 @@
1
1
  # frozen_string_literal: true
2
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
+
3
9
  require ::File.expand_path('test_helper', __dir__)
4
10
 
5
11
  module BlockChyp
@@ -15,7 +21,7 @@ module BlockChyp
15
21
  blockchyp.gateway_host = config['gatewayHost']
16
22
  blockchyp.test_gateway_host = config['testGatewayHost']
17
23
 
18
- test_delay(blockchyp, 'SimpleBatchCloseTest')
24
+ test_delay(blockchyp, 'simple_batch_close_test')
19
25
  # setup request object
20
26
  request = {}
21
27
  request['pan'] = '4111111111111111'
@@ -24,10 +30,12 @@ module BlockChyp
24
30
  request['transactionRef'] = uuid
25
31
  response = blockchyp.charge(request)
26
32
 
33
+
27
34
  # setup request object
28
35
  request = {}
29
36
  request['test'] = true
30
- response = blockchyp.closeBatch(request)
37
+
38
+ response = blockchyp.close_batch(request)
31
39
 
32
40
  assert_not_nil(response)
33
41
  # response assertions
@@ -1,5 +1,11 @@
1
1
  # frozen_string_literal: true
2
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
+
3
9
  require ::File.expand_path('test_helper', __dir__)
4
10
 
5
11
  module BlockChyp
@@ -15,7 +21,7 @@ module BlockChyp
15
21
  blockchyp.gateway_host = config['gatewayHost']
16
22
  blockchyp.test_gateway_host = config['testGatewayHost']
17
23
 
18
- test_delay(blockchyp, 'SimpleCaptureTest')
24
+ test_delay(blockchyp, 'simple_capture_test')
19
25
  # setup request object
20
26
  request = {}
21
27
  request['pan'] = '4111111111111111'
@@ -23,14 +29,17 @@ module BlockChyp
23
29
  request['test'] = true
24
30
  response = blockchyp.preauth(request)
25
31
 
32
+
26
33
  # setup request object
27
34
  request = {}
28
35
  request['transactionId'] = response['transactionId']
29
36
  request['test'] = true
37
+
30
38
  response = blockchyp.capture(request)
31
39
 
32
40
  assert_not_nil(response)
33
41
  # response assertions
42
+ assert(response['success'])
34
43
  assert(response['approved'])
35
44
  end
36
45
 
@@ -1,5 +1,11 @@
1
1
  # frozen_string_literal: true
2
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
+
3
9
  require ::File.expand_path('test_helper', __dir__)
4
10
 
5
11
  module BlockChyp
@@ -15,16 +21,19 @@ module BlockChyp
15
21
  blockchyp.gateway_host = config['gatewayHost']
16
22
  blockchyp.test_gateway_host = config['testGatewayHost']
17
23
 
18
- test_delay(blockchyp, 'SimpleGiftActivateTest')
24
+ test_delay(blockchyp, 'simple_gift_activate_test')
25
+
19
26
  # setup request object
20
27
  request = {}
21
28
  request['test'] = true
22
29
  request['terminalName'] = 'Test Terminal'
23
30
  request['amount'] = '50.00'
24
- response = blockchyp.giftActivate(request)
31
+
32
+ response = blockchyp.gift_activate(request)
25
33
 
26
34
  assert_not_nil(response)
27
35
  # response assertions
36
+ assert(response['success'])
28
37
  assert(response['approved'])
29
38
  assert(!response['publicKey'].empty?)
30
39
  end
@@ -1,5 +1,11 @@
1
1
  # frozen_string_literal: true
2
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
+
3
9
  require ::File.expand_path('test_helper', __dir__)
4
10
 
5
11
  module BlockChyp
@@ -15,12 +21,14 @@ module BlockChyp
15
21
  blockchyp.gateway_host = config['gatewayHost']
16
22
  blockchyp.test_gateway_host = config['testGatewayHost']
17
23
 
18
- test_delay(blockchyp, 'SimpleMessageTest')
24
+ test_delay(blockchyp, 'simple_message_test')
25
+
19
26
  # setup request object
20
27
  request = {}
21
28
  request['test'] = true
22
29
  request['terminalName'] = 'Test Terminal'
23
30
  request['message'] = 'Thank You For Your Business'
31
+
24
32
  response = blockchyp.message(request)
25
33
 
26
34
  assert_not_nil(response)
@@ -1,5 +1,11 @@
1
1
  # frozen_string_literal: true
2
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
+
3
9
  require ::File.expand_path('test_helper', __dir__)
4
10
 
5
11
  module BlockChyp
@@ -15,11 +21,13 @@ module BlockChyp
15
21
  blockchyp.gateway_host = config['gatewayHost']
16
22
  blockchyp.test_gateway_host = config['testGatewayHost']
17
23
 
18
- test_delay(blockchyp, 'SimplePingTest')
24
+ test_delay(blockchyp, 'simple_ping_test')
25
+
19
26
  # setup request object
20
27
  request = {}
21
28
  request['test'] = true
22
29
  request['terminalName'] = 'Test Terminal'
30
+
23
31
  response = blockchyp.ping(request)
24
32
 
25
33
  assert_not_nil(response)
@@ -1,5 +1,11 @@
1
1
  # frozen_string_literal: true
2
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
+
3
9
  require ::File.expand_path('test_helper', __dir__)
4
10
 
5
11
  module BlockChyp
@@ -15,7 +21,7 @@ module BlockChyp
15
21
  blockchyp.gateway_host = config['gatewayHost']
16
22
  blockchyp.test_gateway_host = config['testGatewayHost']
17
23
 
18
- test_delay(blockchyp, 'SimpleRefundTest')
24
+ test_delay(blockchyp, 'simple_refund_test')
19
25
  # setup request object
20
26
  request = {}
21
27
  request['pan'] = '4111111111111111'
@@ -24,14 +30,17 @@ module BlockChyp
24
30
  request['transactionRef'] = uuid
25
31
  response = blockchyp.charge(request)
26
32
 
33
+
27
34
  # setup request object
28
35
  request = {}
29
36
  request['transactionId'] = response['transactionId']
30
37
  request['test'] = true
38
+
31
39
  response = blockchyp.refund(request)
32
40
 
33
41
  assert_not_nil(response)
34
42
  # response assertions
43
+ assert(response['success'])
35
44
  assert(response['approved'])
36
45
  end
37
46
 
@@ -1,5 +1,11 @@
1
1
  # frozen_string_literal: true
2
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
+
3
9
  require ::File.expand_path('test_helper', __dir__)
4
10
 
5
11
  module BlockChyp
@@ -15,7 +21,7 @@ module BlockChyp
15
21
  blockchyp.gateway_host = config['gatewayHost']
16
22
  blockchyp.test_gateway_host = config['testGatewayHost']
17
23
 
18
- test_delay(blockchyp, 'SimpleReversalTest')
24
+ test_delay(blockchyp, 'simple_reversal_test')
19
25
  # setup request object
20
26
  request = {}
21
27
  request['pan'] = '4111111111111111'
@@ -24,14 +30,17 @@ module BlockChyp
24
30
  request['transactionRef'] = uuid
25
31
  response = blockchyp.charge(request)
26
32
 
33
+
27
34
  # setup request object
28
35
  request = {}
29
36
  request['transactionRef'] = response['transactionRef']
30
37
  request['test'] = true
38
+
31
39
  response = blockchyp.reverse(request)
32
40
 
33
41
  assert_not_nil(response)
34
42
  # response assertions
43
+ assert(response['success'])
35
44
  assert(response['approved'])
36
45
  end
37
46
 
@@ -1,5 +1,11 @@
1
1
  # frozen_string_literal: true
2
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
+
3
9
  require ::File.expand_path('test_helper', __dir__)
4
10
 
5
11
  module BlockChyp
@@ -15,7 +21,7 @@ module BlockChyp
15
21
  blockchyp.gateway_host = config['gatewayHost']
16
22
  blockchyp.test_gateway_host = config['testGatewayHost']
17
23
 
18
- test_delay(blockchyp, 'SimpleVoidTest')
24
+ test_delay(blockchyp, 'simple_void_test')
19
25
  # setup request object
20
26
  request = {}
21
27
  request['pan'] = '4111111111111111'
@@ -24,14 +30,17 @@ module BlockChyp
24
30
  request['transactionRef'] = uuid
25
31
  response = blockchyp.charge(request)
26
32
 
33
+
27
34
  # setup request object
28
35
  request = {}
29
36
  request['transactionId'] = response['transactionId']
30
37
  request['test'] = true
38
+
31
39
  response = blockchyp.void(request)
32
40
 
33
41
  assert_not_nil(response)
34
42
  # response assertions
43
+ assert(response['success'])
35
44
  assert(response['approved'])
36
45
  end
37
46