LitleOnline 8.19.0 → 8.25.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +5 -13
  2. data/CHANGELOG +34 -0
  3. data/README.md +1 -1
  4. data/Rakefile +2 -2
  5. data/bin/Setup.rb +16 -6
  6. data/lib/LitleBatchRequest.rb +85 -2
  7. data/lib/LitleOnlineRequest.rb +108 -5
  8. data/lib/LitleRequest.rb +14 -9
  9. data/lib/LitleTransaction.rb +152 -3
  10. data/lib/XMLFields.rb +441 -7
  11. data/test/functional/test_activate.rb +100 -0
  12. data/test/functional/test_activateReversal.rb +56 -0
  13. data/test/functional/test_auth.rb +38 -1
  14. data/test/functional/test_balanceInquiry.rb +80 -0
  15. data/test/functional/test_batchStream.rb +145 -0
  16. data/test/functional/test_cancelSubscription.rb +55 -0
  17. data/test/functional/test_captureGivenAuth.rb +32 -2
  18. data/test/functional/test_createPlan.rb +85 -0
  19. data/test/functional/test_credit.rb +22 -1
  20. data/test/functional/test_deactivate.rb +80 -0
  21. data/test/functional/test_deactivateReversal.rb +56 -0
  22. data/test/functional/test_depositReversal.rb +56 -0
  23. data/test/functional/test_forceCapture.rb +23 -1
  24. data/test/functional/test_litle_requests.rb +3 -2
  25. data/test/functional/test_load.rb +82 -0
  26. data/test/functional/test_loadReversal.rb +56 -0
  27. data/test/functional/test_refundReversal.rb +56 -0
  28. data/test/functional/test_sale.rb +23 -1
  29. data/test/functional/test_unload.rb +82 -0
  30. data/test/functional/test_unloadReversal.rb +56 -0
  31. data/test/functional/test_updatePlan.rb +58 -0
  32. data/test/functional/test_updateSubscription.rb +76 -0
  33. data/test/functional/ts_all.rb +21 -2
  34. data/test/unit/test_LitleBatchRequest.rb +47 -2
  35. data/test/unit/test_LitleOnlineRequest.rb +2 -2
  36. data/test/unit/test_activate.rb +92 -0
  37. data/test/{functional/ts_all.rb~ → unit/test_activateReversal.rb} +17 -17
  38. data/test/unit/test_auth.rb +37 -3
  39. data/test/unit/test_balanceInquiry.rb +52 -0
  40. data/test/unit/test_cancelSubscription.rb +43 -0
  41. data/test/unit/test_captureGivenAuth.rb +44 -2
  42. data/test/unit/test_createPlan.rb +52 -0
  43. data/test/unit/test_credit.rb +3 -2
  44. data/test/unit/test_deactivate.rb +52 -0
  45. data/test/unit/test_deactivateReversal.rb +44 -0
  46. data/test/unit/test_depositReversal.rb +44 -0
  47. data/test/unit/test_load.rb +53 -0
  48. data/test/unit/test_loadReversal.rb +44 -0
  49. data/test/unit/test_refundReversal.rb +44 -0
  50. data/test/unit/test_sale.rb +18 -1
  51. data/test/unit/test_unload.rb +53 -0
  52. data/test/unit/test_unloadReversal.rb +44 -0
  53. data/test/unit/test_updatePlan.rb +45 -0
  54. data/test/unit/test_updateSubscription.rb +172 -0
  55. data/test/unit/test_xmlfields.rb +395 -0
  56. data/test/unit/ts_unit.rb +19 -2
  57. metadata +51 -34
  58. data/CHANGELOG~ +0 -81
  59. data/Rakefile~ +0 -93
  60. data/lib/LitleOnlineRequest.rb~ +0 -198
  61. data/lib/LitleRequest.rb~ +0 -513
  62. data/lib/LitleTransaction.rb~ +0 -297
  63. data/lib/XMLFields.rb~ +0 -1380
  64. data/test/unit/test_LitleOnlineRequest.rb~ +0 -296
  65. data/test/unit/test_sale.rb~ +0 -390
  66. data/test/unit/test_xmlfields.rb~ +0 -2515
@@ -0,0 +1,56 @@
1
+ =begin
2
+ Copyright (c) 2012 Litle & Co.
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 'lib/LitleOnline'
26
+ require 'test/unit'
27
+
28
+ #test loadReversal Transaction
29
+ module LitleOnline
30
+ class TestLoadReversal < Test::Unit::TestCase
31
+
32
+ def test_simple
33
+ hash = {
34
+ 'merchantId' => '101',
35
+ 'version'=>'8.8',
36
+ 'reportGroup'=>'Planets',
37
+ 'litleTxnId' =>'5000'
38
+ }
39
+
40
+ response= LitleOnlineRequest.new.load_reversal(hash)
41
+ assert_equal('Valid Format', response.message)
42
+ end
43
+
44
+
45
+ def test_simple_error
46
+ hash = {
47
+ 'merchantId' => '101',
48
+ 'version'=>'8.8',
49
+ 'reportGroup'=>'Planets',
50
+ }
51
+
52
+ response= LitleOnlineRequest.new.load_reversal(hash)
53
+ assert(response.message =~ /Error validating xml data against the schema/)
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,56 @@
1
+ =begin
2
+ Copyright (c) 2012 Litle & Co.
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 'lib/LitleOnline'
26
+ require 'test/unit'
27
+
28
+ #test RefundReversal Transaction
29
+ module LitleOnline
30
+ class TestRefundReversal < Test::Unit::TestCase
31
+
32
+ def test_simple
33
+ hash = {
34
+ 'merchantId' => '101',
35
+ 'version'=>'8.8',
36
+ 'reportGroup'=>'Planets',
37
+ 'litleTxnId' =>'5000'
38
+ }
39
+
40
+ response= LitleOnlineRequest.new.refund_reversal(hash)
41
+ assert_equal('Valid Format', response.message)
42
+ end
43
+
44
+
45
+ def test_simple_error
46
+ hash = {
47
+ 'merchantId' => '101',
48
+ 'version'=>'8.8',
49
+ 'reportGroup'=>'Planets',
50
+ }
51
+
52
+ response= LitleOnlineRequest.new.refund_reversal(hash)
53
+ assert(response.message =~ /Error validating xml data against the schema/)
54
+ end
55
+ end
56
+ end
@@ -206,7 +206,29 @@ module LitleOnline
206
206
  response= LitleOnlineRequest.new.sale(hash)
207
207
  assert(response.message =~ /Error validating xml data against the schema/)
208
208
  end
209
+
210
+ def test_simple_sale_with_mpos
211
+ hash = {
212
+ 'merchantId' => '101',
213
+ 'version'=>'8.8',
214
+ 'reportGroup'=>'Planets',
215
+ 'litleTxnId'=>'123456',
216
+ 'orderId'=>'12344',
217
+ 'amount'=>'106',
218
+ 'orderSource'=>'ecommerce',
219
+ 'mpos'=>
220
+ {
221
+ 'ksn'=>'ksnString',
222
+ 'formatId'=>'30',
223
+ 'encryptedTrack'=>'encryptedTrackString',
224
+ 'track1Status'=>'0',
225
+ 'track2Status'=>'0'
226
+ }
227
+ }
228
+ response= LitleOnlineRequest.new.sale(hash)
229
+ assert_equal('000', response.saleResponse.response)
230
+ end
209
231
 
210
232
  end
211
233
 
212
- end
234
+ end
@@ -0,0 +1,82 @@
1
+ =begin
2
+ Copyright (c) 2012 Litle & Co.
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 'lib/LitleOnline'
26
+ require 'test/unit'
27
+
28
+ #test Unload Transaction
29
+ module LitleOnline
30
+ class TestUnload < Test::Unit::TestCase
31
+
32
+ def test_simple_happy
33
+ hash = {
34
+ 'merchantId' => '101',
35
+ 'version'=>'8.8',
36
+ 'reportGroup'=>'Planets',
37
+ 'orderId' =>'1001',
38
+ 'amount' =>'500',
39
+ 'orderSource' =>'ecommerce',
40
+ 'card'=>{
41
+ 'type'=>'VI',
42
+ 'number' =>'4100000000000001',
43
+ 'expDate' =>'1210'
44
+ }
45
+ }
46
+
47
+ response= LitleOnlineRequest.new.unload_request(hash)
48
+ assert_equal('Valid Format', response.message)
49
+ end
50
+
51
+ def test_simple_out_of_order
52
+ hash = {
53
+ 'merchantId' => '101',
54
+ 'version'=>'8.8',
55
+ 'reportGroup'=>'Planets',
56
+ 'amount' =>'500',
57
+ 'orderId' =>'1001',
58
+ 'orderSource' =>'ecommerce',
59
+ 'card'=>{
60
+ 'type'=>'VI',
61
+ 'number' =>'4100000000000001',
62
+ 'expDate' =>'1210'
63
+ }
64
+ }
65
+
66
+ response= LitleOnlineRequest.new.unload_request(hash)
67
+ assert_equal('Valid Format', response.message)
68
+ end
69
+
70
+ def test_simple_error
71
+ hash = {
72
+ 'merchantId' => '101',
73
+ 'version'=>'8.8',
74
+ 'reportGroup'=>'Planets',
75
+ 'amount' =>'500',
76
+ }
77
+
78
+ response= LitleOnlineRequest.new.unload_request(hash)
79
+ assert(response.message =~ /Error validating xml data against the schema/)
80
+ end
81
+ end
82
+ end
@@ -0,0 +1,56 @@
1
+ =begin
2
+ Copyright (c) 2012 Litle & Co.
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 'lib/LitleOnline'
26
+ require 'test/unit'
27
+
28
+ #test unloadReversal Transaction
29
+ module LitleOnline
30
+ class TestUnloadReversal < Test::Unit::TestCase
31
+
32
+ def test_simple
33
+ hash = {
34
+ 'merchantId' => '101',
35
+ 'version'=>'8.8',
36
+ 'reportGroup'=>'Planets',
37
+ 'litleTxnId' =>'5000'
38
+ }
39
+
40
+ response= LitleOnlineRequest.new.unload_reversal(hash)
41
+ assert_equal('Valid Format', response.message)
42
+ end
43
+
44
+
45
+ def test_simple_error
46
+ hash = {
47
+ 'merchantId' => '101',
48
+ 'version'=>'8.8',
49
+ 'reportGroup'=>'Planets',
50
+ }
51
+
52
+ response= LitleOnlineRequest.new.unload_reversal(hash)
53
+ assert(response.message =~ /Error validating xml data against the schema/)
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,58 @@
1
+ =begin
2
+ Copyright (c) 2012 Litle & Co.
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 'lib/LitleOnline'
26
+ require 'test/unit'
27
+
28
+ #test UpdatePlan Transaction
29
+ module LitleOnline
30
+ class TestUpdatePlan < Test::Unit::TestCase
31
+
32
+ def test_simple_happy
33
+ hash ={
34
+ 'merchantId' => '101',
35
+ 'version'=>'8.8',
36
+ 'reportGroup'=>'Planets',
37
+ 'planCode'=>'planCodeString',
38
+ 'active'=>'true'
39
+ }
40
+
41
+ response= LitleOnlineRequest.new.update_plan(hash)
42
+ assert_equal('Valid Format', response.message)
43
+ end
44
+
45
+
46
+ def test_simple_error
47
+ hash = {
48
+ 'merchantId' => '101',
49
+ 'version'=>'8.8',
50
+ 'reportGroup'=>'Planets',
51
+ 'planCode'=>'planCodeString',
52
+ }
53
+
54
+ response= LitleOnlineRequest.new.update_plan(hash)
55
+ assert(response.message =~ /Error validating xml data against the schema/)
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,76 @@
1
+ =begin
2
+ Copyright (c) 2012 Litle & Co.
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 'lib/LitleOnline'
26
+ require 'test/unit'
27
+
28
+ #test Authorization Transaction
29
+ module LitleOnline
30
+ class TestUpdateSubscription < Test::Unit::TestCase
31
+
32
+ def test_simple_happy
33
+ hash = {
34
+ 'merchantId' => '101',
35
+ 'version'=>'8.8',
36
+ 'reportGroup'=>'Planets',
37
+ 'subscriptionId' =>'1001'
38
+ }
39
+
40
+ response= LitleOnlineRequest.new.update_subscription(hash)
41
+ assert_equal('Valid Format', response.message)
42
+ end
43
+
44
+ def test_simple_out_of_order
45
+ hash = {
46
+ 'merchantId' => '101',
47
+ 'version'=>'8.8',
48
+ 'reportGroup'=>'Planets',
49
+ 'subscriptionId' =>'1001',
50
+ 'billingDate'=>'2014-03-11',
51
+ 'planCode'=>'planCodeString',
52
+ 'deleteDiscount'=>[{'discountCode'=>'discCode3'},{'discountCode'=>'discCode33'}],
53
+ 'updateAddOn'=>[
54
+ {
55
+ 'addOnCode'=>'addOnCode2',
56
+ }],
57
+ 'deleteAddOn'=>[{'addOnCode'=>'addOnCode3'}]
58
+
59
+ }
60
+
61
+ response= LitleOnlineRequest.new.update_subscription(hash)
62
+ assert_equal('Valid Format', response.message)
63
+ end
64
+
65
+ def test_simple_error
66
+ hash = {
67
+ 'merchantId' => '101',
68
+ 'version'=>'8.8',
69
+ 'reportGroup'=>'Planets',
70
+ }
71
+
72
+ response= LitleOnlineRequest.new.update_subscription(hash)
73
+ assert(response.message =~ /Error validating xml data against the schema/)
74
+ end
75
+ end
76
+ end
@@ -25,16 +25,19 @@ OTHER DEALINGS IN THE SOFTWARE.
25
25
 
26
26
  require 'lib/LitleOnline'
27
27
 
28
+
28
29
  #test driver for running all tests
30
+ require_relative 'test_updateSubscription'
31
+ require_relative 'test_captureGivenAuth'
29
32
  require_relative 'test_xmlfields'
30
33
  require_relative 'test_sale'
31
- require_relative 'test_auth'
34
+ require_relative 'test_captureGivenAuth'
32
35
  require_relative 'test_authReversal'
33
36
  require_relative 'test_credit'
37
+ require_relative 'test_auth'
34
38
  require_relative 'test_token'
35
39
  require_relative 'test_forceCapture'
36
40
  require_relative 'test_capture'
37
- require_relative 'test_captureGivenAuth'
38
41
  require_relative 'test_echeckRedeposit'
39
42
  require_relative 'test_echeckSale'
40
43
  require_relative 'test_echeckCredit'
@@ -43,3 +46,19 @@ require_relative 'test_echeckVoid'
43
46
  require_relative 'test_updateCardValidationNumOnToken'
44
47
  require_relative 'test_litle_requests'
45
48
  require_relative 'test_batch'
49
+ require_relative 'test_cancelSubscription'
50
+ require_relative 'test_updateSubscription'
51
+ require_relative 'test_deactivate'
52
+ require_relative 'test_load'
53
+ require_relative 'test_unload'
54
+ require_relative 'test_balanceInquiry'
55
+ require_relative 'test_createPlan'
56
+ require_relative 'test_updatePlan'
57
+ require_relative 'test_batchStream'
58
+ require_relative 'test_activate'
59
+ require_relative 'test_activateReversal'
60
+ require_relative 'test_depositReversal'
61
+ require_relative 'test_refundReversal'
62
+ require_relative 'test_loadReversal'
63
+ require_relative 'test_unloadReversal'
64
+ require_relative 'test_deactivateReversal'