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
@@ -296,13 +296,14 @@ module LitleOnline
296
296
  'capability' => 'magstripe',
297
297
  'entryMode' => 'keyed',
298
298
  'cardholderId' => 'nopin',
299
+ 'catLevel' => 'self service'
299
300
  },
300
301
  'litleTxnId' => '3',
301
302
  'reportGroup' => 'Planets',
302
303
  'orderSource' => 'ecommerce',
303
304
  'payPalNotes' => 'notes'
304
305
  }
305
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<litleTxnId>3<\/litleTxnId><amount>2<\/amount><pos><capability>magstripe<\/capability><entryMode>keyed<\/entryMode><cardholderId>nopin<\/cardholderId><terminalId>abc123<\/terminalId><\/pos><payPalNotes>.*/m), is_a(Hash))
306
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<litleTxnId>3<\/litleTxnId><amount>2<\/amount><pos><capability>magstripe<\/capability><entryMode>keyed<\/entryMode><cardholderId>nopin<\/cardholderId><terminalId>abc123<\/terminalId><catLevel>self service<\/catLevel><\/pos><payPalNotes>.*/m), is_a(Hash))
306
307
  LitleOnlineRequest.new.credit(hash)
307
308
  end
308
309
 
@@ -316,4 +317,4 @@ module LitleOnline
316
317
  end
317
318
 
318
319
  end
319
- end
320
+ end
@@ -0,0 +1,52 @@
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
+ module LitleOnline
29
+ class TestDeactivate < Test::Unit::TestCase
30
+
31
+ def test_simple
32
+ hash = {
33
+ 'merchantId' => '101',
34
+ 'version'=>'8.8',
35
+ 'reportGroup'=>'Planets',
36
+ 'orderId' => '11',
37
+ 'orderSource'=>'ecommerce',
38
+ 'card'=>
39
+ {
40
+ 'type'=>'VI',
41
+ 'number' =>'4100000000000001',
42
+ 'expDate' =>'1210'
43
+ }
44
+ }
45
+
46
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<deactivate reportGroup="Planets"><orderId>11<\/orderId><orderSource>ecommerce<\/orderSource><card><type>VI<\/type><number>4100000000000001<\/number><expDate>1210<\/expDate><\/card><\/deactivate>.*/m), is_a(Hash))
47
+ LitleOnlineRequest.new.deactivate(hash)
48
+ end
49
+
50
+ end
51
+
52
+ end
@@ -0,0 +1,44 @@
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
+ module LitleOnline
29
+ class TestDeactivateReversal < Test::Unit::TestCase
30
+
31
+ def test_simple
32
+ hash = {
33
+ 'merchantId' => '101',
34
+ 'version'=>'8.8',
35
+ 'reportGroup'=>'Planets',
36
+ 'litleTxnId' => '5000'
37
+ }
38
+
39
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<deactivateReversal reportGroup="Planets"><litleTxnId>5000<\/litleTxnId><\/deactivateReversal>.*/m), is_a(Hash))
40
+ LitleOnlineRequest.new.deactivate_reversal(hash)
41
+ end
42
+ end
43
+
44
+ end
@@ -0,0 +1,44 @@
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
+ module LitleOnline
29
+ class TestDepositReversal < Test::Unit::TestCase
30
+
31
+ def test_simple
32
+ hash = {
33
+ 'merchantId' => '101',
34
+ 'version'=>'8.8',
35
+ 'reportGroup'=>'Planets',
36
+ 'litleTxnId' => '5000'
37
+ }
38
+
39
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<depositReversal reportGroup="Planets"><litleTxnId>5000<\/litleTxnId><\/depositReversal>.*/m), is_a(Hash))
40
+ LitleOnlineRequest.new.deposit_reversal(hash)
41
+ end
42
+ end
43
+
44
+ end
@@ -0,0 +1,53 @@
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
+ module LitleOnline
29
+ class TestLoad < Test::Unit::TestCase
30
+
31
+ def test_simple
32
+ hash = {
33
+ 'merchantId' => '101',
34
+ 'version'=>'8.8',
35
+ 'reportGroup'=>'Planets',
36
+ 'orderId' => '11',
37
+ 'amount' => '500',
38
+ 'orderSource'=>'ecommerce',
39
+ 'card'=>
40
+ {
41
+ 'type'=>'VI',
42
+ 'number' =>'4100000000000001',
43
+ 'expDate' =>'1210'
44
+ }
45
+ }
46
+
47
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<load reportGroup="Planets"><orderId>11<\/orderId><amount>500<\/amount><orderSource>ecommerce<\/orderSource><card><type>VI<\/type><number>4100000000000001<\/number><expDate>1210<\/expDate><\/card><\/load>.*/m), is_a(Hash))
48
+ LitleOnlineRequest.new.load_request(hash)
49
+ end
50
+
51
+ end
52
+
53
+ end
@@ -0,0 +1,44 @@
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
+ module LitleOnline
29
+ class TestLoadReversal < Test::Unit::TestCase
30
+
31
+ def test_simple
32
+ hash = {
33
+ 'merchantId' => '101',
34
+ 'version'=>'8.8',
35
+ 'reportGroup'=>'Planets',
36
+ 'litleTxnId' => '5000'
37
+ }
38
+
39
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<loadReversal reportGroup="Planets"><litleTxnId>5000<\/litleTxnId><\/loadReversal>.*/m), is_a(Hash))
40
+ LitleOnlineRequest.new.load_reversal(hash)
41
+ end
42
+ end
43
+
44
+ end
@@ -0,0 +1,44 @@
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
+ module LitleOnline
29
+ class TestRefundReversal < Test::Unit::TestCase
30
+
31
+ def test_simple
32
+ hash = {
33
+ 'merchantId' => '101',
34
+ 'version'=>'8.8',
35
+ 'reportGroup'=>'Planets',
36
+ 'litleTxnId' => '5000'
37
+ }
38
+
39
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<refundReversal reportGroup="Planets"><litleTxnId>5000<\/litleTxnId><\/refundReversal>.*/m), is_a(Hash))
40
+ LitleOnlineRequest.new.refund_reversal(hash)
41
+ end
42
+ end
43
+
44
+ end
@@ -364,9 +364,10 @@ module LitleOnline
364
364
  'litleInternalRecurringRequest'=>{
365
365
  'subscriptionId'=>'1234567890123456789',
366
366
  'recurringTxnId'=>'1234567890123456789',
367
+ 'finalPayment'=>'false'
367
368
  },
368
369
  }
369
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<fraudFilterOverride>true<\/fraudFilterOverride><litleInternalRecurringRequest><subscriptionId>1234567890123456789<\/subscriptionId><recurringTxnId>1234567890123456789<\/recurringTxnId><\/litleInternalRecurringRequest>.*/m), is_a(Hash))
370
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<fraudFilterOverride>true<\/fraudFilterOverride><litleInternalRecurringRequest><subscriptionId>1234567890123456789<\/subscriptionId><recurringTxnId>1234567890123456789<\/recurringTxnId><finalPayment>false<\/finalPayment><\/litleInternalRecurringRequest>.*/m), is_a(Hash))
370
371
  LitleOnlineRequest.new.sale(hash)
371
372
  end
372
373
 
@@ -385,6 +386,22 @@ module LitleOnline
385
386
  LitleXmlMapper.expects(:request).with(regexp_matches(/.*<fraudFilterOverride>true<\/fraudFilterOverride><\/sale>.*/m), is_a(Hash))
386
387
  LitleOnlineRequest.new.sale(hash)
387
388
  end
389
+
390
+ def test_advanced_fraud_check
391
+ hash = {
392
+ 'orderId' => '12344',
393
+ 'amount' => '2',
394
+ 'orderSource' => 'ecommerce',
395
+ 'card' => {
396
+ 'number' => '4141000000000000',
397
+ 'expDate' => '1210',
398
+ 'type' => 'GC'
399
+ } ,
400
+ 'advancedFraudChecks' => {'threatMetrixSessionId'=>'1234'}
401
+ }
402
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<advancedFraudChecks><threatMetrixSessionId>1234<\/threatMetrixSessionId><\/advancedFraudChecks>.*/m), is_a(Hash))
403
+ LitleOnlineRequest.new.sale(hash)
404
+ end
388
405
 
389
406
  end
390
407
  end
@@ -0,0 +1,53 @@
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
+ module LitleOnline
29
+ class TestUnload < Test::Unit::TestCase
30
+
31
+ def test_simple
32
+ hash = {
33
+ 'merchantId' => '101',
34
+ 'version'=>'8.8',
35
+ 'reportGroup'=>'Planets',
36
+ 'orderId' => '11',
37
+ 'amount' => '500',
38
+ 'orderSource'=>'ecommerce',
39
+ 'card'=>
40
+ {
41
+ 'type'=>'VI',
42
+ 'number' =>'4100000000000001',
43
+ 'expDate' =>'1210'
44
+ }
45
+ }
46
+
47
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<unload reportGroup="Planets"><orderId>11<\/orderId><amount>500<\/amount><orderSource>ecommerce<\/orderSource><card><type>VI<\/type><number>4100000000000001<\/number><expDate>1210<\/expDate><\/card><\/unload>.*/m), is_a(Hash))
48
+ LitleOnlineRequest.new.unload_request(hash)
49
+ end
50
+
51
+ end
52
+
53
+ end
@@ -0,0 +1,44 @@
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
+ module LitleOnline
29
+ class TestUnloadReversal < Test::Unit::TestCase
30
+
31
+ def test_simple
32
+ hash = {
33
+ 'merchantId' => '101',
34
+ 'version'=>'8.8',
35
+ 'reportGroup'=>'Planets',
36
+ 'litleTxnId' => '5000'
37
+ }
38
+
39
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<unloadReversal reportGroup="Planets"><litleTxnId>5000<\/litleTxnId><\/unloadReversal>.*/m), is_a(Hash))
40
+ LitleOnlineRequest.new.unload_reversal(hash)
41
+ end
42
+ end
43
+
44
+ end