VantivCnp 8.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG +139 -0
  3. data/CONTRIBUTORS +2 -0
  4. data/DESCRIPTION +5 -0
  5. data/LICENSE +22 -0
  6. data/README.md +72 -0
  7. data/Rakefile +89 -0
  8. data/SETUP.md +46 -0
  9. data/bin/Setup.rb +124 -0
  10. data/bin/sample_batch_driver.rb +123 -0
  11. data/bin/sample_driver.rb +49 -0
  12. data/lib/Communications.rb +85 -0
  13. data/lib/Configuration.rb +67 -0
  14. data/lib/EnvironmentVariables.rb +22 -0
  15. data/lib/LitleBatchRequest.rb +562 -0
  16. data/lib/LitleListeners.rb +142 -0
  17. data/lib/LitleOnline.rb +62 -0
  18. data/lib/LitleOnlineRequest.rb +297 -0
  19. data/lib/LitleRequest.rb +494 -0
  20. data/lib/LitleTransaction.rb +463 -0
  21. data/lib/LitleXmlMapper.rb +64 -0
  22. data/lib/XMLFields.rb +1869 -0
  23. data/lib/cacert.pem +3331 -0
  24. data/samples/Auth/LitleAuthReversalTransaction.rb +15 -0
  25. data/samples/Auth/LitleAuthorizationTransaction.rb +31 -0
  26. data/samples/Auth/LitlePaymentFullLifeCycle.rb +47 -0
  27. data/samples/Batch/AccountUpdate.rb +64 -0
  28. data/samples/Batch/SampleBatchDriver.rb +94 -0
  29. data/samples/Capture/LitleCaptureGivenAuthTransaction.rb +30 -0
  30. data/samples/Capture/LitleCaptureTransaction.rb +14 -0
  31. data/samples/Capture/LitleForceCaptureTransaction.rb +26 -0
  32. data/samples/Capture/LitlePartialCapture.rb +16 -0
  33. data/samples/Credit/LitleCreditTransaction.rb +16 -0
  34. data/samples/Credit/LitleRefundTransaction.rb +29 -0
  35. data/samples/Other/LitleAvsTransaction.rb +34 -0
  36. data/samples/Other/LitleVoidTransaction.rb +18 -0
  37. data/samples/Paypage/FullPaypageLifeCycle.rb +74 -0
  38. data/samples/Run_all.rb +17 -0
  39. data/samples/Sale/LitleSaleTransaction.rb +29 -0
  40. data/samples/Sale/SampleSaleTransaction.rb +24 -0
  41. data/test/certification/certTest1_base.rb +945 -0
  42. data/test/certification/certTest2_authenhanced.rb +573 -0
  43. data/test/certification/certTest3_authreversal.rb +185 -0
  44. data/test/certification/certTest4_echeck.rb +278 -0
  45. data/test/certification/certTest5_token.rb +204 -0
  46. data/test/certification/certTest_batchAll.rb +337 -0
  47. data/test/certification/ts_all.rb +33 -0
  48. data/test/functional/test_activate.rb +100 -0
  49. data/test/functional/test_activateReversal.rb +56 -0
  50. data/test/functional/test_auth.rb +298 -0
  51. data/test/functional/test_authReversal.rb +69 -0
  52. data/test/functional/test_balanceInquiry.rb +80 -0
  53. data/test/functional/test_batch.rb +164 -0
  54. data/test/functional/test_batchStream.rb +145 -0
  55. data/test/functional/test_cancelSubscription.rb +55 -0
  56. data/test/functional/test_capture.rb +84 -0
  57. data/test/functional/test_captureGivenAuth.rb +235 -0
  58. data/test/functional/test_configuration.rb +89 -0
  59. data/test/functional/test_createPlan.rb +85 -0
  60. data/test/functional/test_credit.rb +174 -0
  61. data/test/functional/test_deactivate.rb +80 -0
  62. data/test/functional/test_deactivateReversal.rb +56 -0
  63. data/test/functional/test_depositReversal.rb +56 -0
  64. data/test/functional/test_echeckCredit.rb +134 -0
  65. data/test/functional/test_echeckRedeposit.rb +88 -0
  66. data/test/functional/test_echeckSale.rb +177 -0
  67. data/test/functional/test_echeckVerification.rb +127 -0
  68. data/test/functional/test_echeckVoid.rb +41 -0
  69. data/test/functional/test_forceCapture.rb +183 -0
  70. data/test/functional/test_litle_requests.rb +356 -0
  71. data/test/functional/test_load.rb +82 -0
  72. data/test/functional/test_loadReversal.rb +56 -0
  73. data/test/functional/test_override.rb +64 -0
  74. data/test/functional/test_refundReversal.rb +56 -0
  75. data/test/functional/test_sale.rb +259 -0
  76. data/test/functional/test_token.rb +115 -0
  77. data/test/functional/test_unload.rb +82 -0
  78. data/test/functional/test_unloadReversal.rb +56 -0
  79. data/test/functional/test_updateCardValidationNumOnToken.rb +43 -0
  80. data/test/functional/test_updatePlan.rb +58 -0
  81. data/test/functional/test_updateSubscription.rb +76 -0
  82. data/test/functional/test_xmlfields.rb +427 -0
  83. data/test/functional/ts_all.rb +66 -0
  84. data/test/unit/test_LitleAUBatch.rb +216 -0
  85. data/test/unit/test_LitleBatchRequest.rb +643 -0
  86. data/test/unit/test_LitleOnlineRequest.rb +295 -0
  87. data/test/unit/test_LitleRequest.rb +316 -0
  88. data/test/unit/test_LitleTransaction.rb +397 -0
  89. data/test/unit/test_activate.rb +92 -0
  90. data/test/unit/test_activateReversal.rb +44 -0
  91. data/test/unit/test_auth.rb +421 -0
  92. data/test/unit/test_authReversal.rb +82 -0
  93. data/test/unit/test_balanceInquiry.rb +52 -0
  94. data/test/unit/test_cancelSubscription.rb +43 -0
  95. data/test/unit/test_capture.rb +73 -0
  96. data/test/unit/test_captureGivenAuth.rb +188 -0
  97. data/test/unit/test_createPlan.rb +52 -0
  98. data/test/unit/test_credit.rb +342 -0
  99. data/test/unit/test_deactivate.rb +52 -0
  100. data/test/unit/test_deactivateReversal.rb +44 -0
  101. data/test/unit/test_depositReversal.rb +44 -0
  102. data/test/unit/test_echeckCredit.rb +71 -0
  103. data/test/unit/test_echeckRedeposit.rb +94 -0
  104. data/test/unit/test_echeckSale.rb +71 -0
  105. data/test/unit/test_echeckVerification.rb +71 -0
  106. data/test/unit/test_echeckVoid.rb +54 -0
  107. data/test/unit/test_forceCapture.rb +145 -0
  108. data/test/unit/test_load.rb +53 -0
  109. data/test/unit/test_loadReversal.rb +44 -0
  110. data/test/unit/test_refundReversal.rb +44 -0
  111. data/test/unit/test_sale.rb +465 -0
  112. data/test/unit/test_token.rb +144 -0
  113. data/test/unit/test_unload.rb +53 -0
  114. data/test/unit/test_unloadReversal.rb +44 -0
  115. data/test/unit/test_updateCardValidationNumOnToken.rb +80 -0
  116. data/test/unit/test_updatePlan.rb +45 -0
  117. data/test/unit/test_updateSubscription.rb +172 -0
  118. data/test/unit/test_xmlfields.rb +2930 -0
  119. data/test/unit/ts_unit.rb +65 -0
  120. metadata +224 -0
@@ -0,0 +1,85 @@
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 File.expand_path("../../../lib/LitleOnline",__FILE__)
26
+ require 'test/unit'
27
+
28
+ #test Activate Transaction
29
+ module LitleOnline
30
+ class TestCreatePlan < 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
+ 'name'=>'nameString',
39
+ 'description'=>'descriptionString',
40
+ 'intervalType'=>'ANNUAL',
41
+ 'amount'=>'500',
42
+ 'numberOfPayments'=>'2',
43
+ 'trialNumberOfIntervals'=>'1',
44
+ 'trialIntervalType'=>'MONTH',
45
+ 'active'=>'true'
46
+ }
47
+
48
+ response= LitleOnlineRequest.new.create_plan(hash)
49
+ assert_equal('Valid Format', response.message)
50
+ end
51
+
52
+ def test_simple_out_of_order
53
+ hash ={
54
+ 'merchantId' => '101',
55
+ 'version'=>'8.8',
56
+ 'reportGroup'=>'Planets',
57
+ 'planCode'=>'planCodeString',
58
+ 'name'=>'nameString',
59
+ 'intervalType'=>'ANNUAL',
60
+ 'description'=>'descriptionString',
61
+ 'amount'=>'500',
62
+ 'numberOfPayments'=>'2',
63
+ 'trialNumberOfIntervals'=>'1',
64
+ 'trialIntervalType'=>'MONTH',
65
+ 'active'=>'true'
66
+ }
67
+
68
+ response= LitleOnlineRequest.new.create_plan(hash)
69
+ assert_equal('Valid Format', response.message)
70
+ end
71
+
72
+ def test_simple_error
73
+ hash = {
74
+ 'merchantId' => '101',
75
+ 'version'=>'8.8',
76
+ 'reportGroup'=>'Planets',
77
+ 'amount' =>'500',
78
+ 'intervalType'=>'ANNUAL',
79
+ }
80
+
81
+ response= LitleOnlineRequest.new.create_plan(hash)
82
+ assert(response.message =~ /Error validating xml data against the schema/)
83
+ end
84
+ end
85
+ end
@@ -0,0 +1,174 @@
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 File.expand_path("../../../lib/LitleOnline",__FILE__)
26
+ require 'test/unit'
27
+
28
+ module LitleOnline
29
+ class TestCredit < Test::Unit::TestCase
30
+ def test_simple_credit_with_card
31
+ hash = {
32
+ 'merchantId' => '101',
33
+ 'version'=>'8.8',
34
+ 'reportGroup'=>'Planets',
35
+ 'orderId'=>'12344',
36
+ 'amount'=>'106',
37
+ 'orderSource'=>'ecommerce',
38
+ 'card'=>{
39
+ 'type'=>'VI',
40
+ 'number' =>'4100000000000001',
41
+ 'expDate' =>'1210'
42
+ }}
43
+ response= LitleOnlineRequest.new.credit(hash)
44
+ assert_equal('Valid Format', response.message)
45
+ end
46
+
47
+ def test_simple_credit_with_paypal
48
+ hash = {
49
+ 'merchantId' => '101',
50
+ 'version'=>'8.8',
51
+ 'reportGroup'=>'Planets',
52
+ 'amount'=>'106',
53
+ 'orderId'=>'123456',
54
+ 'orderSource'=>'ecommerce',
55
+ 'paypal'=>{
56
+ 'payerId'=>'1234',
57
+ 'transactionId'=>'1234',
58
+ }}
59
+ response= LitleOnlineRequest.new.credit(hash)
60
+ assert_equal('Valid Format', response.message)
61
+ end
62
+
63
+ def test_simple_credit_with_secondaryAmount
64
+ hash = {
65
+ 'merchantId' => '101',
66
+ 'version'=>'8.8',
67
+ 'reportGroup'=>'Planets',
68
+ 'amount'=>'106',
69
+ 'secondaryAmount'=>'50',
70
+ 'orderId'=>'123456',
71
+ 'orderSource'=>'ecommerce',
72
+ 'paypal'=>{
73
+ 'payerId'=>'1234',
74
+ 'transactionId'=>'1234',
75
+ }}
76
+ response= LitleOnlineRequest.new.credit(hash)
77
+ assert_equal('Valid Format', response.message)
78
+ end
79
+
80
+ def test_fields_out_of_order
81
+ hash = {
82
+ 'merchantId' => '101',
83
+ 'version'=>'8.8',
84
+ 'reportGroup'=>'Planets',
85
+ 'orderId'=>'12344',
86
+ 'card'=>{
87
+ 'type'=>'VI',
88
+ 'number' =>'4100000000000001',
89
+ 'expDate' =>'1210'
90
+ },
91
+ 'orderSource'=>'ecommerce',
92
+ 'amount'=>'106'
93
+ }
94
+ response= LitleOnlineRequest.new.credit(hash)
95
+ assert_equal('Valid Format', response.message)
96
+ end
97
+
98
+ def test_invalid_field
99
+ hash = {
100
+ 'merchantId' => '101',
101
+ 'version'=>'8.8',
102
+ 'reportGroup'=>'Planets',
103
+ 'orderId'=>'12344',
104
+ 'amount'=>'106',
105
+ 'orderSource'=>'ecommerce',
106
+ 'card'=>{
107
+ 'NOexistantField' => 'ShouldNotCauseError',
108
+ 'type'=>'VI',
109
+ 'number' =>'4100000000000001',
110
+ 'expDate' =>'1210'
111
+ }}
112
+ response= LitleOnlineRequest.new.credit(hash)
113
+ assert_equal('Valid Format', response.message)
114
+ end
115
+
116
+ def test_pay_pal_notes
117
+ hash = {
118
+ 'merchantId' => '101',
119
+ 'version'=>'8.8',
120
+ 'reportGroup'=>'Planets',
121
+ 'orderId'=>'12344',
122
+ 'amount'=>'106',
123
+ 'payPalNotes'=>'Hello',
124
+ 'orderSource'=>'ecommerce',
125
+ 'card'=>{
126
+ 'type'=>'VI',
127
+ 'number' =>'4100000000000001',
128
+ 'expDate' =>'1210'
129
+ }}
130
+ response= LitleOnlineRequest.new.credit(hash)
131
+ assert_equal('Valid Format', response.message)
132
+ end
133
+
134
+ def test_processing_instructions_and_amex_data
135
+ hash = {
136
+ 'merchantId' => '101',
137
+ 'version'=>'8.8',
138
+ 'reportGroup'=>'Planets',
139
+ 'amount'=>'2000',
140
+ 'orderId'=>'12344',
141
+ 'orderSource'=>'ecommerce',
142
+ 'processingInstuctions'=>{'bypassVelocityCheck'=>'yes'},
143
+ 'card'=>{
144
+ 'type'=>'VI',
145
+ 'number' =>'4100000000000001',
146
+ 'expDate' =>'1210'},
147
+ 'amexAggregatorData'=>{'sellerMerchantCategoryCode'=>'1234','sellerId'=>'1234Id'}
148
+ }
149
+ response= LitleOnlineRequest.new.credit(hash)
150
+ assert_equal('Valid Format', response.message)
151
+ end
152
+
153
+ def test_simple_credit_with_mpos
154
+ hash = {
155
+ 'merchantId' => '101',
156
+ 'version'=>'8.8',
157
+ 'reportGroup'=>'Planets',
158
+ 'orderId'=>'12344',
159
+ 'amount'=>'106',
160
+ 'orderSource'=>'ecommerce',
161
+ 'mpos'=>
162
+ {
163
+ 'ksn'=>'ksnString',
164
+ 'formatId'=>'30',
165
+ 'encryptedTrack'=>'encryptedTrackString',
166
+ 'track1Status'=>'0',
167
+ 'track2Status'=>'0'
168
+ }
169
+ }
170
+ response= LitleOnlineRequest.new.credit(hash)
171
+ assert_equal('Valid Format', response.message)
172
+ end
173
+ end
174
+ end
@@ -0,0 +1,80 @@
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 File.expand_path("../../../lib/LitleOnline",__FILE__)
26
+ require 'test/unit'
27
+
28
+ #test Deactivate Transaction
29
+ module LitleOnline
30
+ class TestDeactivate < 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
+ 'orderSource' =>'ecommerce',
39
+ 'card'=>{
40
+ 'type'=>'VI',
41
+ 'number' =>'4100000000000001',
42
+ 'expDate' =>'1210'
43
+ }
44
+ }
45
+
46
+ response= LitleOnlineRequest.new.deactivate(hash)
47
+ assert_equal('Valid Format', response.message)
48
+ end
49
+
50
+ def test_simple_out_of_order
51
+ hash = {
52
+ 'merchantId' => '101',
53
+ 'version'=>'8.8',
54
+ 'reportGroup'=>'Planets',
55
+ 'orderSource' =>'ecommerce',
56
+ 'orderId' =>'1001',
57
+ 'card'=>{
58
+ 'type'=>'VI',
59
+ 'number' =>'4100000000000001',
60
+ 'expDate' =>'1210'
61
+ }
62
+ }
63
+
64
+ response= LitleOnlineRequest.new.deactivate(hash)
65
+ assert_equal('Valid Format', response.message)
66
+ end
67
+
68
+ def test_simple_error
69
+ hash = {
70
+ 'merchantId' => '101',
71
+ 'version'=>'8.8',
72
+ 'reportGroup'=>'Planets',
73
+ 'amount' =>'500',
74
+ }
75
+
76
+ response= LitleOnlineRequest.new.deactivate(hash)
77
+ assert(response.message =~ /Error validating xml data against the schema/)
78
+ end
79
+ end
80
+ 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 File.expand_path("../../../lib/LitleOnline",__FILE__)
26
+ require 'test/unit'
27
+
28
+ #test DeactivateReversal Transaction
29
+ module LitleOnline
30
+ class TestDectivateReversal < 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.deactivate_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.deactivate_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 File.expand_path("../../../lib/LitleOnline",__FILE__)
26
+ require 'test/unit'
27
+
28
+ #test DepositReversal Transaction
29
+ module LitleOnline
30
+ class TestDepositReversal < 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.deposit_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.deposit_reversal(hash)
53
+ assert(response.message =~ /Error validating xml data against the schema/)
54
+ end
55
+ end
56
+ end