LitleOnline 10.1.1 → 11.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +13 -6
  3. data/DESCRIPTION +2 -2
  4. data/LICENSE +1 -1
  5. data/README.md +8 -8
  6. data/Rakefile +6 -7
  7. data/SETUP.md +4 -4
  8. data/bin/Setup.rb +4 -4
  9. data/bin/sample_batch_driver.rb +1 -1
  10. data/bin/sample_driver.rb +1 -1
  11. data/lib/Communications.rb +5 -5
  12. data/lib/Configuration.rb +1 -1
  13. data/lib/LitleBatchRequest.rb +39 -1
  14. data/lib/LitleListeners.rb +2 -2
  15. data/lib/LitleOnline.rb +1 -1
  16. data/lib/LitleOnlineRequest.rb +22 -3
  17. data/lib/LitleRequest.rb +4 -4
  18. data/lib/LitleTransaction.rb +156 -47
  19. data/lib/LitleXmlMapper.rb +8 -1
  20. data/lib/XMLFields.rb +252 -51
  21. data/temp.xml +21 -0
  22. data/test/certification/certTest1_base.rb +52 -52
  23. data/test/certification/certTest2_authenhanced.rb +20 -20
  24. data/test/certification/certTest3_authreversal.rb +16 -16
  25. data/test/certification/certTest4_echeck.rb +18 -12
  26. data/test/certification/certTest5_token.rb +3 -3
  27. data/test/certification/certTest_batchAll.rb +9 -1
  28. data/test/certification/ts_all.rb +1 -1
  29. data/test/functional/test_activate.rb +34 -5
  30. data/test/functional/test_activateReversal.rb +23 -7
  31. data/test/functional/test_auth.rb +126 -17
  32. data/test/functional/test_authReversal.rb +5 -3
  33. data/test/functional/test_balanceInquiry.rb +30 -5
  34. data/test/functional/test_batch.rb +1 -1
  35. data/test/functional/test_batchStream.rb +1 -1
  36. data/test/functional/test_cancelSubscription.rb +5 -3
  37. data/test/functional/test_capture.rb +37 -2
  38. data/test/functional/test_captureGivenAuth.rb +54 -3
  39. data/test/functional/test_configuration.rb +1 -1
  40. data/test/functional/test_createPlan.rb +5 -3
  41. data/test/functional/test_credit.rb +17 -1
  42. data/test/functional/test_deactivate.rb +28 -5
  43. data/test/functional/test_deactivateReversal.rb +21 -7
  44. data/test/functional/test_depositReversal.rb +30 -18
  45. data/test/functional/test_echeckCredit.rb +29 -5
  46. data/test/functional/test_echeckRedeposit.rb +28 -3
  47. data/test/functional/test_echeckSale.rb +43 -7
  48. data/test/functional/test_echeckVerification.rb +34 -8
  49. data/test/functional/test_echeckVoid.rb +2 -2
  50. data/test/functional/test_forceCapture.rb +36 -8
  51. data/test/functional/test_fraudCheck.rb +12 -14
  52. data/test/functional/test_giftCardAuthReversal.rb +72 -0
  53. data/test/functional/test_giftCardCapture.rb +72 -0
  54. data/test/functional/test_giftCardCredit.rb +69 -0
  55. data/test/functional/test_litle_requests.rb +1 -1
  56. data/test/functional/test_load.rb +29 -5
  57. data/test/functional/test_loadReversal.rb +21 -7
  58. data/test/functional/test_override.rb +4 -3
  59. data/test/functional/test_queryTransaction.rb +24 -18
  60. data/test/functional/test_refundReversal.rb +21 -7
  61. data/test/functional/test_sale.rb +86 -9
  62. data/test/functional/test_token.rb +26 -11
  63. data/test/functional/test_unload.rb +29 -5
  64. data/test/functional/test_unloadReversal.rb +21 -7
  65. data/test/functional/test_updateCardValidationNumOnToken.rb +1 -1
  66. data/test/functional/test_updatePlan.rb +5 -3
  67. data/test/functional/test_updateSubscription.rb +5 -3
  68. data/test/functional/test_wallet.rb +1 -1
  69. data/test/functional/test_xmlfields.rb +9 -5
  70. data/test/functional/ts_all.rb +1 -1
  71. data/test/unit/test_LitleAUBatch.rb +1 -1
  72. data/test/unit/test_LitleBatchRequest.rb +1 -1
  73. data/test/unit/test_LitleOnlineRequest.rb +15 -57
  74. data/test/unit/test_LitleRequest.rb +1 -1
  75. data/test/unit/test_LitleTransaction.rb +3 -3
  76. data/test/unit/test_LitleXmlMapper.rb +139 -0
  77. data/test/unit/test_activate.rb +5 -5
  78. data/test/unit/test_activateReversal.rb +16 -4
  79. data/test/unit/test_auth.rb +50 -9
  80. data/test/unit/test_authReversal.rb +1 -1
  81. data/test/unit/test_balanceInquiry.rb +3 -3
  82. data/test/unit/test_cancelSubscription.rb +1 -1
  83. data/test/unit/test_capture.rb +27 -1
  84. data/test/unit/test_captureGivenAuth.rb +47 -1
  85. data/test/unit/test_createPlan.rb +1 -1
  86. data/test/unit/test_credit.rb +16 -3
  87. data/test/unit/test_deactivate.rb +20 -1
  88. data/test/unit/test_deactivateReversal.rb +16 -4
  89. data/test/unit/test_depositReversal.rb +18 -6
  90. data/test/unit/test_echeckCredit.rb +20 -1
  91. data/test/unit/test_echeckRedeposit.rb +16 -1
  92. data/test/unit/test_echeckSale.rb +20 -1
  93. data/test/unit/test_echeckVerification.rb +7 -4
  94. data/test/unit/test_echeckVoid.rb +1 -1
  95. data/test/unit/test_forceCapture.rb +19 -1
  96. data/test/unit/test_fraudCheck.rb +1 -1
  97. data/test/unit/test_giftCardAuthReversal.rb +58 -0
  98. data/test/unit/test_giftCardCapture.rb +57 -0
  99. data/test/unit/test_giftCardCredit.rb +57 -0
  100. data/test/unit/test_load.rb +3 -3
  101. data/test/unit/test_loadReversal.rb +16 -4
  102. data/test/unit/test_queryTransaction.rb +5 -22
  103. data/test/unit/test_refundReversal.rb +16 -4
  104. data/test/unit/test_sale.rb +90 -5
  105. data/test/unit/test_token.rb +35 -24
  106. data/test/unit/test_unload.rb +3 -3
  107. data/test/unit/test_unloadReversal.rb +16 -4
  108. data/test/unit/test_updateCardValidationNumOnToken.rb +1 -1
  109. data/test/unit/test_updatePlan.rb +1 -1
  110. data/test/unit/test_updateSubscription.rb +1 -1
  111. data/test/unit/test_wallet.rb +1 -1
  112. data/test/unit/test_xmlfields.rb +1 -1
  113. data/test/unit/ts_unit.rb +1 -1
  114. metadata +18 -10
@@ -0,0 +1,72 @@
1
+ =begin
2
+ Copyright (c) 2017 Vantiv eCommerce
3
+
4
+ Permission is hereby granted, free of charge, to any person
5
+ obtaining a copy of this software and associated documentation
6
+ files (the "Software"), to deal in the Software without
7
+ restriction, including without limitation the rights to use,
8
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the
10
+ Software is furnished to do so, subject to the following
11
+ conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
18
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
21
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23
+ OTHER DEALINGS IN THE SOFTWARE.
24
+ =end
25
+ require File.expand_path("../../../lib/LitleOnline",__FILE__)
26
+ require 'test/unit'
27
+
28
+ #test GiftCardCapture Transaction
29
+ module LitleOnline
30
+ class TestGiftCardCapture < Test::Unit::TestCase
31
+ def test_giftCardCapture
32
+ hash = {
33
+ 'captureAmount'=>'1000',
34
+ 'merchantId' => '101',
35
+ 'version'=>'8.8',
36
+ 'id'=>'test',
37
+ 'reportGroup'=>'Planets',
38
+ 'litleTxnId' =>'5000',
39
+ 'card'=>{
40
+ 'type'=>'GC',
41
+ 'number' =>'400000000000000',
42
+ 'expDate' =>'0150',
43
+ 'pin' => '1234',
44
+ 'cardValidationNum' => '411'
45
+ },
46
+ 'originalRefCode' => '101',
47
+ 'originalAmount' => '34561',
48
+ 'originalTxnTime' => '2017-01-24T09:00:00',
49
+
50
+ }
51
+
52
+ response= LitleOnlineRequest.new.giftCardCapture(hash)
53
+ assert_equal('000', response.giftCardCaptureResponse.response)
54
+ assert_equal('0', response.giftCardCaptureResponse.giftCardResponse.systemTraceId)
55
+ end
56
+
57
+ def test_simple_error
58
+ hash = {
59
+ 'merchantId' => '101',
60
+ 'version'=>'8.8',
61
+ 'id'=>'test',
62
+ 'reportGroup'=>'Planets',
63
+ }
64
+
65
+ #Get exceptions
66
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.giftCardCapture(hash)}
67
+ #Test
68
+ assert(exception.message =~ /Error validating xml data against the schema/)
69
+ end
70
+
71
+ end
72
+ end
@@ -0,0 +1,69 @@
1
+ =begin
2
+ Copyright (c) 2017 Vantiv eCommerce
3
+
4
+ Permission is hereby granted, free of charge, to any person
5
+ obtaining a copy of this software and associated documentation
6
+ files (the "Software"), to deal in the Software without
7
+ restriction, including without limitation the rights to use,
8
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the
10
+ Software is furnished to do so, subject to the following
11
+ conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
18
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
21
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23
+ OTHER DEALINGS IN THE SOFTWARE.
24
+ =end
25
+ require File.expand_path("../../../lib/LitleOnline",__FILE__)
26
+ require 'test/unit'
27
+
28
+ #test GiftCardCapture Transaction
29
+ module LitleOnline
30
+ class TestGiftCardCredit < Test::Unit::TestCase
31
+ def test_giftCardCredit
32
+ hash = {
33
+ 'id'=>'test',
34
+ 'merchantId' => '101',
35
+ 'version'=>'8.8',
36
+ 'litleTxnId' => '5000',
37
+ 'creditAmount' =>'1000',
38
+ #'orderId' =>'1230',
39
+ 'card'=>{
40
+ 'type'=>'GC',
41
+ 'number' =>'400000000000000',
42
+ 'expDate' =>'0150',
43
+ 'pin' => '1234',
44
+ 'cardValidationNum' => '411'
45
+ },
46
+ 'reportGroup'=>'Planets',
47
+ }
48
+
49
+ response= LitleOnlineRequest.new.giftCardCredit(hash)
50
+ assert_equal('000', response.giftCardCreditResponse.response)
51
+ assert_equal('0', response.giftCardCreditResponse.giftCardResponse.systemTraceId)
52
+ end
53
+
54
+ def test_simple_error
55
+ hash = {
56
+ 'merchantId' => '101',
57
+ 'version'=>'8.8',
58
+ 'id'=>'test',
59
+ 'reportGroup'=>'Planets',
60
+ }
61
+
62
+ #Get exceptions
63
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.giftCardCredit(hash)}
64
+ #Test
65
+ assert(exception.message =~ /Error validating xml data against the schema/)
66
+ end
67
+
68
+ end
69
+ end
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2012 Litle & Co.
2
+ Copyright (c) 2017 Vantiv eCommerce
3
3
  Permission is hereby granted, free of charge, to any person
4
4
  obtaining a copy of this software and associated documentation
5
5
  files (the "Software"), to deal in the Software without
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2012 Litle & Co.
2
+ Copyright (c) 2017 Vantiv eCommerce
3
3
 
4
4
  Permission is hereby granted, free of charge, to any person
5
5
  obtaining a copy of this software and associated documentation
@@ -39,7 +39,7 @@ def test_simple_happy
39
39
  'amount' =>'500',
40
40
  'orderSource' =>'ecommerce',
41
41
  'card'=>{
42
- 'type'=>'VI',
42
+ 'type'=>'GC',
43
43
  'number' =>'4100000000000001',
44
44
  'expDate' =>'1210'
45
45
  }
@@ -59,7 +59,7 @@ def test_simple_happy
59
59
  'orderId' =>'1001',
60
60
  'orderSource' =>'ecommerce',
61
61
  'card'=>{
62
- 'type'=>'VI',
62
+ 'type'=>'GC',
63
63
  'number' =>'4100000000000001',
64
64
  'expDate' =>'1210'
65
65
  }
@@ -77,8 +77,32 @@ def test_simple_happy
77
77
  'amount' =>'500',
78
78
  }
79
79
 
80
- response= LitleOnlineRequest.new.load_request(hash)
81
- assert(response.message =~ /Error validating xml data against the schema/)
80
+ #Get exceptions
81
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.load_request(hash)}
82
+ #Test
83
+ assert(exception.message =~ /Error validating xml data against the schema/)
84
+ end
85
+
86
+ def test_GiftCardCardType_NotPresent
87
+ hash = {
88
+ 'merchantId' => '101',
89
+ 'version'=>'8.8',
90
+ 'id' =>'test',
91
+ 'reportGroup'=>'Planets',
92
+ 'amount' =>'500',
93
+ 'orderId' =>'1001',
94
+ 'orderSource' =>'ecommerce',
95
+ 'card'=>{
96
+ 'type'=>'VI',
97
+ 'number' =>'4100000000000001',
98
+ 'expDate' =>'1210'
99
+ }
100
+ }
101
+
102
+ #Get exceptions
103
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.load_request(hash)}
104
+ #Test
105
+ assert(exception.message =~ /Error validating xml data against the schema/)
82
106
  end
83
107
  end
84
108
  end
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2012 Litle & Co.
2
+ Copyright (c) 2017 Vantiv eCommerce
3
3
 
4
4
  Permission is hereby granted, free of charge, to any person
5
5
  obtaining a copy of this software and associated documentation
@@ -35,11 +35,23 @@ def test_simple
35
35
  'version'=>'8.8',
36
36
  'id'=>'test',
37
37
  'reportGroup'=>'Planets',
38
- 'litleTxnId' =>'5000'
39
- }
38
+ 'litleTxnId' =>'5000',
39
+ 'card'=>{
40
+ 'type'=>'GC',
41
+ 'number' =>'400000000000001',
42
+ 'expDate' =>'0150',
43
+ 'pin' => '1234',
44
+ 'cardValidationNum' => '411'
45
+ },
46
+ 'originalRefCode' => '101',
47
+ 'originalAmount' => '34561',
48
+ 'originalTxnTime' => '2017-01-24T09:00:00',
49
+ 'originalSystemTraceId' => '33',
50
+ 'originalSequenceNumber' => '111111',
51
+ }
40
52
 
41
- response= LitleOnlineRequest.new.load_reversal(hash)
42
- assert_equal('Valid Format', response.message)
53
+ response= LitleOnlineRequest.new.deposit_reversal(hash)
54
+ assert_equal('000', response.depositReversalResponse.response)
43
55
  end
44
56
 
45
57
 
@@ -50,8 +62,10 @@ def test_simple
50
62
  'reportGroup'=>'Planets',
51
63
  }
52
64
 
53
- response= LitleOnlineRequest.new.load_reversal(hash)
54
- assert(response.message =~ /Error validating xml data against the schema/)
65
+ #Get exceptions
66
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.load_reversal(hash)}
67
+ #Test
68
+ assert(exception.message =~ /Error validating xml data against the schema/)
55
69
  end
56
70
  end
57
71
  end
@@ -13,7 +13,7 @@ module LitleOnline
13
13
  'amount' =>'500',
14
14
  'orderSource' =>'ecommerce',
15
15
  'card'=>{
16
- 'type'=>'VI',
16
+ 'type'=>'GC',
17
17
  'number' =>'4100000000000001',
18
18
  'expDate' =>'1210'
19
19
  }
@@ -21,6 +21,7 @@ module LitleOnline
21
21
  response= LitleOnlineRequest.new.activate(hash)
22
22
  assert_equal('Default Report Group', response.activateResponse.reportGroup)
23
23
  end
24
+
24
25
  def test_override_withoutLocal
25
26
  hash = {
26
27
  'merchantId' => '101',
@@ -30,7 +31,7 @@ module LitleOnline
30
31
  'amount' =>'500',
31
32
  'orderSource' =>'ecommerce',
32
33
  'card'=>{
33
- 'type'=>'VI',
34
+ 'type'=>'GC',
34
35
  'number' =>'4100000000000001',
35
36
  'expDate' =>'1210'
36
37
  }
@@ -51,7 +52,7 @@ module LitleOnline
51
52
  'amount' =>'500',
52
53
  'orderSource' =>'ecommerce',
53
54
  'card'=>{
54
- 'type'=>'VI',
55
+ 'type'=>'GC',
55
56
  'number' =>'4100000000000001',
56
57
  'expDate' =>'1210'
57
58
  }
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2012 Litle & Co.
2
+ Copyright (c) 2017 Vantiv eCommerce
3
3
 
4
4
  Permission is hereby granted, free of charge, to any person
5
5
  obtaining a copy of this software and associated documentation
@@ -38,7 +38,7 @@ module LitleOnline
38
38
  'origActionType' => 'A',
39
39
  'transactionId'=>'123456',
40
40
  'orderId'=>'65347567',
41
- 'origAccountNumber' => '4000000000000001'
41
+ #'origAccountNumber' => '4000000000000001'
42
42
  }
43
43
  response= LitleOnlineRequest.new.query_Transaction(hash)
44
44
  assert_equal('000', response.queryTransactionResponse.response)
@@ -52,11 +52,10 @@ module LitleOnline
52
52
  'reportGroup'=>'Some RG',
53
53
  'customerId' => '038945',
54
54
  'origId' => '834262',
55
- 'origId' => '834262',
56
55
  'origActionType' => '',
57
56
  'transactionId'=>'123456',
58
57
  'orderId'=>'65347567',
59
- 'origAccountNumber' => '4000000000000001'
58
+ #'origAccountNumber' => '4000000000000001'
60
59
  }
61
60
  response= LitleOnlineRequest.new.query_Transaction(hash)
62
61
  assert('000', response.queryTransactionResponse.response)
@@ -72,10 +71,12 @@ module LitleOnline
72
71
  'origActionType' => 'A',
73
72
  'transactionId'=>'123456',
74
73
  'orderId'=>'65347567',
75
- 'origAccountNumber' => '4000000000000001'
74
+ #'origAccountNumber' => '4000000000000001'
76
75
  }
77
- response= LitleOnlineRequest.new.query_Transaction(hash)
78
- assert(response.message =~ /Error validating xml data against the schema/)
76
+ #Get exceptions
77
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.query_Transaction(hash)}
78
+ #Test
79
+ assert(exception.message =~ /Error validating xml data against the schema/)
79
80
  end
80
81
 
81
82
  def test_queryTransaction_no_accttype
@@ -88,10 +89,12 @@ module LitleOnline
88
89
  'origId' => '834262',
89
90
  'transactionId'=>'123456',
90
91
  'orderId'=>'65347567',
91
- 'origAccountNumber' => '4000000000000001'
92
+ #'origAccountNumber' => '4000000000000001'
92
93
  }
93
- response= LitleOnlineRequest.new.query_Transaction(hash)
94
- assert(response.message =~ /Error validating xml data against the schema/)
94
+ #Get exceptions
95
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.query_Transaction(hash)}
96
+ #Test
97
+ assert(exception.message =~ /Error validating xml data against the schema/)
95
98
  end
96
99
 
97
100
  def test_queryTransaction_invalid_values
@@ -102,14 +105,15 @@ module LitleOnline
102
105
  'reportGroup'=>'Some RG',
103
106
  'customerId' => '038945',
104
107
  'origId' => '834262',
105
- 'origId' => '834262',
106
108
  'origActionType' => 'AAA',
107
109
  'transactionId'=>'123456',
108
110
  'orderId'=>'65347567',
109
- 'origAccountNumber' => '4000000000000001'
111
+ #'origAccountNumber' => '4000000000000001'
110
112
  }
111
- response= LitleOnlineRequest.new.query_Transaction(hash)
112
- assert(response.message =~ /Error validating xml data against the schema/)
113
+ #Get exceptions
114
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.query_Transaction(hash)}
115
+ #Test
116
+ assert(exception.message =~ /Error validating xml data against the schema/)
113
117
  end
114
118
 
115
119
  def test_queryTransaction_missing_attributes
@@ -120,10 +124,12 @@ module LitleOnline
120
124
  'customerId' => '038945',
121
125
  'origActionType' => 'A',
122
126
  'transactionId'=>'123456',
123
- 'origAccountNumber' => '4000000000000001'
127
+ #'origAccountNumber' => '4000000000000001'
124
128
  }
125
- response= LitleOnlineRequest.new.query_Transaction(hash)
126
- assert(response.message =~ /Error validating xml data against the schema/)
129
+ #Get exceptions
130
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.query_Transaction(hash)}
131
+ #Test
132
+ assert(exception.message =~ /Error validating xml data against the schema/)
127
133
  end
128
134
 
129
135
  def test_queryTransaction_unavailable_response
@@ -137,7 +143,7 @@ module LitleOnline
137
143
  'origActionType' => 'A',
138
144
  'transactionId'=>'123456',
139
145
  'orderId'=>'65347567',
140
- 'origAccountNumber' => '4000000000000001'
146
+ #'origAccountNumber' => '4000000000000001'
141
147
  }
142
148
  response= LitleOnlineRequest.new.query_Transaction(hash)
143
149
  assert_equal('152', response.queryTransactionUnavailableResponse.response)
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2012 Litle & Co.
2
+ Copyright (c) 2017 Vantiv eCommerce
3
3
 
4
4
  Permission is hereby granted, free of charge, to any person
5
5
  obtaining a copy of this software and associated documentation
@@ -35,11 +35,23 @@ def test_simple
35
35
  'version'=>'8.8',
36
36
  'id'=>'test',
37
37
  'reportGroup'=>'Planets',
38
- 'litleTxnId' =>'5000'
39
- }
38
+ 'litleTxnId' =>'5000',
39
+ 'card'=>{
40
+ 'type'=>'GC',
41
+ 'number' =>'400000000000001',
42
+ 'expDate' =>'0150',
43
+ 'pin' => '1234',
44
+ 'cardValidationNum' => '411'
45
+ },
46
+ 'originalRefCode' => '101',
47
+ 'originalAmount' => '34561',
48
+ 'originalTxnTime' => '2017-01-24T09:00:00',
49
+ 'originalSystemTraceId' => '33',
50
+ 'originalSequenceNumber' => '111111',
51
+ }
40
52
 
41
- response= LitleOnlineRequest.new.refund_reversal(hash)
42
- assert_equal('Valid Format', response.message)
53
+ response= LitleOnlineRequest.new.deposit_reversal(hash)
54
+ assert_equal('000', response.depositReversalResponse.response)
43
55
  end
44
56
 
45
57
 
@@ -50,8 +62,10 @@ def test_simple
50
62
  'reportGroup'=>'Planets',
51
63
  }
52
64
 
53
- response= LitleOnlineRequest.new.refund_reversal(hash)
54
- assert(response.message =~ /Error validating xml data against the schema/)
65
+ #Get exceptions
66
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.refund_reversal(hash)}
67
+ #Test
68
+ assert(exception.message =~ /Error validating xml data against the schema/)
55
69
  end
56
70
  end
57
71
  end
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2012 Litle & Co.
2
+ Copyright (c) 2017 Vantiv eCommerce
3
3
 
4
4
  Permission is hereby granted, free of charge, to any person
5
5
  obtaining a copy of this software and associated documentation
@@ -110,8 +110,10 @@ module LitleOnline
110
110
  'number' =>'4100000000000002',
111
111
  'expDate' =>'1210'
112
112
  }}
113
- response= LitleOnlineRequest.new.sale(hash)
114
- assert(response.message =~ /Error validating xml data against the schema/)
113
+ #Get exceptions
114
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.sale(hash)}
115
+ #Test
116
+ assert(exception.message =~ /Error validating xml data against the schema/)
115
117
  end
116
118
 
117
119
  def test_no_report_group
@@ -206,8 +208,10 @@ module LitleOnline
206
208
  'number' =>'4100000000000002',
207
209
  'expDate' =>'1210'
208
210
  }}
209
- response= LitleOnlineRequest.new.sale(hash)
210
- assert(response.message =~ /Error validating xml data against the schema/)
211
+ #Get exceptions
212
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.sale(hash)}
213
+ #Test
214
+ assert(exception.message =~ /Error validating xml data against the schema/)
211
215
  end
212
216
 
213
217
  def test_no_amount
@@ -224,8 +228,10 @@ module LitleOnline
224
228
  'number' =>'4100000000000002',
225
229
  'expDate' =>'1210'
226
230
  }}
227
- response= LitleOnlineRequest.new.sale(hash)
228
- assert(response.message =~ /Error validating xml data against the schema/)
231
+ #Get exceptions
232
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.sale(hash)}
233
+ #Test
234
+ assert(exception.message =~ /Error validating xml data against the schema/)
229
235
  end
230
236
 
231
237
  def test_no_order_source
@@ -242,8 +248,10 @@ module LitleOnline
242
248
  'number' =>'4100000000000002',
243
249
  'expDate' =>'1210'
244
250
  }}
245
- response= LitleOnlineRequest.new.sale(hash)
246
- assert(response.message =~ /Error validating xml data against the schema/)
251
+ #Get exceptions
252
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.sale(hash)}
253
+ #Test
254
+ assert(exception.message =~ /Error validating xml data against the schema/)
247
255
  end
248
256
 
249
257
  def test_simple_sale_with_mpos
@@ -326,5 +334,74 @@ module LitleOnline
326
334
  response= LitleOnlineRequest.new.sale(hash)
327
335
  assert_equal 'Valid Format', response.message
328
336
  end
337
+
338
+ def test_simple_sale_with_processingType
339
+ hash = {
340
+ 'merchantId' => '101',
341
+ 'id' => 'test',
342
+ 'version'=>'8.8',
343
+ 'reportGroup'=>'Planets',
344
+ 'litleTxnId'=>'123456',
345
+ 'orderId'=>'12344',
346
+ 'amount'=>'106',
347
+ 'orderSource'=>'ecommerce',
348
+ 'processingType'=>'initialInstallment',
349
+ 'card'=>{
350
+ 'type'=>'VI',
351
+ 'number' =>'4100000000000002',
352
+ 'expDate' =>'1210'
353
+ }
354
+ }
355
+ response= LitleOnlineRequest.new.sale(hash)
356
+ assert_equal 'Valid Format', response.message
357
+ end
358
+
359
+ def test_simple_sale_with_originalNetworkTransactionId_originalTransactionAmount
360
+ hash = {
361
+ 'merchantId' => '101',
362
+ 'id' => 'test',
363
+ 'version'=>'8.8',
364
+ 'reportGroup'=>'Planets',
365
+ 'litleTxnId'=>'123456',
366
+ 'orderId'=>'12344',
367
+ 'amount'=>'106',
368
+ 'orderSource'=>'ecommerce',
369
+ 'card'=>{
370
+ 'type'=>'VI',
371
+ 'number' =>'4100000000000002',
372
+ 'expDate' =>'1210'
373
+ },
374
+ 'originalNetworkTransactionId'=>'98765432109876543210',
375
+ 'originalTransactionAmount'=>'7001'
376
+ }
377
+ response= LitleOnlineRequest.new.sale(hash)
378
+ assert_equal 'Valid Format', response.message
379
+ assert_equal('63225578415568556365452427825', response.saleResponse.networkTransactionId)
380
+ end
381
+
382
+ def test_simple_sale_with_sepaDirectDebit
383
+ hash = {
384
+ 'merchantId' => '101',
385
+ 'id' => 'test',
386
+ 'version'=>'8.8',
387
+ 'reportGroup'=>'Planets',
388
+ 'litleTxnId'=>'123456',
389
+ 'orderId'=>'12344',
390
+ 'amount'=>'106',
391
+ 'orderSource'=>'ecommerce',
392
+ 'sepaDirectDebit'=> {
393
+ 'mandateProvider'=>'Merchant',
394
+ 'sequenceType'=>'FirstRecurring',
395
+ 'iban'=>'123456789123456789'
396
+ }}
397
+ response= LitleOnlineRequest.new.sale(hash)
398
+ assert_equal 'Valid Format', response.message
399
+ assert_equal('http://redirect.url.vantiv.com', response.saleResponse.sepaDirectDebitResponse.redirectUrl)
400
+ assert_equal('jj2d1d372osmmt7tb8epm0a99q', response.saleResponse.sepaDirectDebitResponse.redirectToken)
401
+ assert_equal('1BADA58', response.saleResponse.sepaDirectDebitResponse.mandateReference)
402
+ end
403
+
404
+
405
+
329
406
  end
330
407
  end