LitleOnline 9.12.0 → 10.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (129) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +7 -16
  3. data/CONTRIBUTORS +0 -0
  4. data/DESCRIPTION +2 -2
  5. data/LICENSE +1 -1
  6. data/README.md +9 -9
  7. data/Rakefile +9 -8
  8. data/SETUP.md +3 -3
  9. data/bin/Setup.rb +4 -4
  10. data/bin/sample_batch_driver.rb +1 -1
  11. data/bin/sample_driver.rb +1 -1
  12. data/lib/Communications.rb +7 -7
  13. data/lib/Configuration.rb +1 -1
  14. data/lib/EnvironmentVariables.rb +0 -0
  15. data/lib/LitleBatchRequest.rb +22 -8
  16. data/lib/LitleListeners.rb +9 -9
  17. data/lib/LitleOnline.rb +2 -2
  18. data/lib/LitleOnlineRequest.rb +16 -10
  19. data/lib/LitleRequest.rb +10 -10
  20. data/lib/LitleTransaction.rb +66 -64
  21. data/lib/LitleXmlMapper.rb +4 -9
  22. data/lib/XMLFields.rb +129 -116
  23. data/lib/cacert.pem +0 -0
  24. data/samples/Auth/LitleAuthReversalTransaction.rb +2 -2
  25. data/samples/Auth/LitleAuthorizationTransaction.rb +1 -0
  26. data/samples/Auth/LitlePaymentFullLifeCycle.rb +12 -6
  27. data/samples/Batch/AccountUpdate.rb +1 -0
  28. data/samples/Batch/SampleBatchDriver.rb +2 -1
  29. data/samples/Capture/LitleCaptureGivenAuthTransaction.rb +2 -1
  30. data/samples/Capture/LitleCaptureTransaction.rb +2 -2
  31. data/samples/Capture/LitleForceCaptureTransaction.rb +2 -1
  32. data/samples/Capture/LitlePartialCapture.rb +3 -3
  33. data/samples/Credit/LitleCreditTransaction.rb +2 -2
  34. data/samples/Credit/LitleRefundTransaction.rb +2 -1
  35. data/samples/Other/LitleAvsTransaction.rb +2 -1
  36. data/samples/Other/LitleVoidTransaction.rb +2 -1
  37. data/samples/Paypage/FullPaypageLifeCycle.rb +7 -2
  38. data/samples/Run_all.rb +0 -0
  39. data/samples/Sale/LitleSaleTransaction.rb +2 -1
  40. data/samples/Sale/SampleSaleTransaction.rb +2 -1
  41. data/test/certification/certTest1_base.rb +53 -52
  42. data/test/certification/certTest2_authenhanced.rb +16 -15
  43. data/test/certification/certTest3_authreversal.rb +16 -15
  44. data/test/certification/certTest4_echeck.rb +11 -10
  45. data/test/certification/certTest5_token.rb +2 -1
  46. data/test/certification/certTest_batchAll.rb +40 -16
  47. data/test/certification/ts_all.rb +1 -1
  48. data/test/functional/test_activate.rb +8 -9
  49. data/test/functional/test_activateReversal.rb +4 -7
  50. data/test/functional/test_auth.rb +50 -113
  51. data/test/functional/test_authReversal.rb +6 -5
  52. data/test/functional/test_balanceInquiry.rb +5 -5
  53. data/test/functional/test_batch.rb +1 -1
  54. data/test/functional/test_batchStream.rb +3 -5
  55. data/test/functional/test_cancelSubscription.rb +3 -5
  56. data/test/functional/test_capture.rb +6 -34
  57. data/test/functional/test_captureGivenAuth.rb +13 -55
  58. data/test/functional/test_configuration.rb +1 -1
  59. data/test/functional/test_createPlan.rb +3 -5
  60. data/test/functional/test_credit.rb +10 -17
  61. data/test/functional/test_deactivate.rb +5 -5
  62. data/test/functional/test_deactivateReversal.rb +4 -5
  63. data/test/functional/test_depositReversal.rb +5 -5
  64. data/test/functional/test_echeckCredit.rb +17 -13
  65. data/test/functional/test_echeckRedeposit.rb +7 -5
  66. data/test/functional/test_echeckSale.rb +42 -21
  67. data/test/functional/test_echeckVerification.rb +19 -20
  68. data/test/functional/test_echeckVoid.rb +3 -2
  69. data/test/functional/test_forceCapture.rb +16 -30
  70. data/test/functional/test_litle_requests.rb +5 -9
  71. data/test/functional/test_load.rb +5 -5
  72. data/test/functional/test_loadReversal.rb +4 -5
  73. data/test/functional/test_override.rb +3 -0
  74. data/test/functional/test_queryTransaction.rb +146 -0
  75. data/test/functional/test_refundReversal.rb +4 -5
  76. data/test/functional/test_sale.rb +94 -170
  77. data/test/functional/test_token.rb +9 -18
  78. data/test/functional/test_unload.rb +5 -5
  79. data/test/functional/test_unloadReversal.rb +5 -6
  80. data/test/functional/test_updateCardValidationNumOnToken.rb +2 -1
  81. data/test/functional/test_updatePlan.rb +4 -5
  82. data/test/functional/test_updateSubscription.rb +5 -5
  83. data/test/functional/test_wallet.rb +74 -0
  84. data/test/functional/test_xmlfields.rb +25 -10
  85. data/test/functional/ts_all.rb +4 -2
  86. data/test/unit/test_LitleAUBatch.rb +1 -1
  87. data/test/unit/test_LitleBatchRequest.rb +4 -4
  88. data/test/unit/test_LitleOnlineRequest.rb +54 -37
  89. data/test/unit/test_LitleRequest.rb +3 -4
  90. data/test/unit/test_LitleTransaction.rb +35 -6
  91. data/test/unit/test_activate.rb +21 -1
  92. data/test/unit/test_activateReversal.rb +1 -1
  93. data/test/unit/test_auth.rb +16 -55
  94. data/test/unit/test_authReversal.rb +1 -1
  95. data/test/unit/test_balanceInquiry.rb +1 -1
  96. data/test/unit/test_cancelSubscription.rb +1 -1
  97. data/test/unit/test_capture.rb +1 -27
  98. data/test/unit/test_captureGivenAuth.rb +18 -44
  99. data/test/unit/test_createPlan.rb +1 -1
  100. data/test/unit/test_credit.rb +3 -16
  101. data/test/unit/test_deactivate.rb +1 -1
  102. data/test/unit/test_deactivateReversal.rb +1 -1
  103. data/test/unit/test_depositReversal.rb +1 -1
  104. data/test/unit/test_echeckCredit.rb +1 -1
  105. data/test/unit/test_echeckRedeposit.rb +1 -1
  106. data/test/unit/test_echeckSale.rb +2 -2
  107. data/test/unit/test_echeckVerification.rb +1 -1
  108. data/test/unit/test_echeckVoid.rb +1 -1
  109. data/test/unit/test_forceCapture.rb +2 -20
  110. data/test/unit/test_load.rb +1 -1
  111. data/test/unit/test_loadReversal.rb +1 -1
  112. data/test/unit/test_queryTransaction.rb +122 -0
  113. data/test/unit/test_refundReversal.rb +1 -1
  114. data/test/unit/test_sale.rb +8 -73
  115. data/test/unit/test_token.rb +8 -15
  116. data/test/unit/test_unload.rb +1 -1
  117. data/test/unit/test_unloadReversal.rb +1 -1
  118. data/test/unit/test_updateCardValidationNumOnToken.rb +1 -1
  119. data/test/unit/test_updatePlan.rb +1 -1
  120. data/test/unit/test_updateSubscription.rb +1 -1
  121. data/test/unit/test_wallet.rb +262 -0
  122. data/test/unit/test_xmlfields.rb +1 -1
  123. data/test/unit/ts_unit.rb +3 -3
  124. metadata +15 -16
  125. data/temp.xml +0 -21
  126. data/test/functional/test_fraudCheck.rb +0 -77
  127. data/test/functional/test_utf8.rb +0 -44
  128. data/test/unit/test_LitleXmlMapper.rb +0 -136
  129. data/test/unit/test_fraudCheck.rb +0 -45
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2017 Vantiv eCommerce
2
+ Copyright (c) 2012 Litle & Co.
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
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2017 Vantiv eCommerce
2
+ Copyright (c) 2012 Litle & Co.
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
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2017 Vantiv eCommerce
2
+ Copyright (c) 2012 Litle & Co.
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
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2017 Vantiv eCommerce
2
+ Copyright (c) 2012 Litle & Co.
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
@@ -68,32 +68,6 @@ module LitleOnline
68
68
  LitleXmlMapper.expects(:request).with(regexp_matches(/.*<amount>2<\/amount><payPalNotes>note<\/payPalNotes>.*/m), is_a(Hash))
69
69
  LitleOnlineRequest.new.capture(hash)
70
70
  end
71
-
72
- def test_pin
73
- hash = {
74
- 'litleTxnId' => '123456000',
75
- 'amount' => '2',
76
- 'payPalNotes' => 'note',
77
- 'pin' => '1234'
78
- }
79
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<pin>1234<\/pin>.*/m), is_a(Hash))
80
- LitleOnlineRequest.new.capture(hash)
81
- end
82
-
83
- def test_custom_billing
84
- hash = {
85
- 'payPalNotes'=>'Notes',
86
- 'litleTxnId'=>'123456000',
87
- 'amount'=>'106',
88
- 'customBilling'=>{
89
- 'city' =>'boston',
90
- 'descriptor' => 'card was present',
91
- }
92
- }
93
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<customBilling><city>boston<\/city><descriptor>card was present<\/descriptor><\/customBilling>.*/m), is_a(Hash))
94
- LitleOnlineRequest.new.capture(hash)
95
- end
96
-
97
71
  end
98
72
  end
99
73
 
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2017 Vantiv eCommerce
2
+ Copyright (c) 2012 Litle & Co.
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
@@ -154,61 +154,35 @@ module LitleOnline
154
154
  'fraudResult' => {
155
155
  'advancedFraudResults' =>
156
156
  {'deviceReviewStatus' => 'deviceReviewStatusString',
157
- 'deviceReputationScore' => '100',
158
- 'triggeredRule' => ['rule1','rule2']
157
+ 'deviceReputationScore' => '100'
159
158
  }
160
159
  }
161
160
  }
162
161
  }
163
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<advancedFraudResults><deviceReviewStatus>deviceReviewStatusString<\/deviceReviewStatus><deviceReputationScore>100<\/deviceReputationScore><triggeredRule>rule1<\/triggeredRule><triggeredRule>rule2<\/triggeredRule><\/advancedFraudResults>.*/m), is_a(Hash))
162
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<advancedFraudResults><deviceReviewStatus>deviceReviewStatusString<\/deviceReviewStatus><deviceReputationScore>100<\/deviceReputationScore><\/advancedFraudResults>.*/m), is_a(Hash))
164
163
  LitleOnlineRequest.new.capture_given_auth(hash)
165
164
  end
166
-
167
- def test_processingType
168
- hash = {
169
- 'merchantId' => '101',
170
- 'version'=>'8.8',
171
- 'reportGroup'=>'Planets',
172
- 'orderId'=>'12344',
173
- 'amount'=>'106',
174
- 'orderSource'=>'ecommerce',
175
- 'authInformation' => {
176
- 'authDate'=>'2002-10-09','authCode'=>'543216',
177
- 'authAmount'=>'12345'
178
- },
179
- 'processingType'=>'initialRecurring',
180
- 'card'=>{
181
- 'type'=>'VI',
182
- 'number' =>'4100000000000001',
183
- 'expDate' =>'1210'
184
- }}
185
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<processingType>initialRecurring<\/processingType>.*/m), is_a(Hash))
186
- LitleOnlineRequest.new.capture_given_auth(hash)
187
- end
188
165
 
189
- def test_originalNetworkTransactionId_originalTransactionAmount
166
+ def test_fraudResult1
190
167
  hash = {
191
- 'merchantId' => '101',
192
- 'version'=>'8.8',
193
- 'reportGroup'=>'Planets',
194
- 'orderId'=>'12344',
195
- 'amount'=>'106',
196
- 'orderSource'=>'ecommerce',
168
+ 'amount' => '2',
169
+ 'orderSource' => 'ecommerce',
170
+ 'reportGroup' => 'Planets',
197
171
  'authInformation' => {
198
172
  'authDate'=>'2002-10-09','authCode'=>'543216',
199
- 'authAmount'=>'12345'
200
- },
201
- 'card'=>{
202
- 'type'=>'VI',
203
- 'number' =>'4100000000000001',
204
- 'expDate' =>'1210'
205
- },
206
- 'originalNetworkTransactionId'=>'987654321098765432109876543210',
207
- 'originalTransactionAmount'=>'10661'
173
+ 'authAmount'=>'12345',
174
+ 'fraudResult' => {
175
+ 'advancedFraudResults' =>
176
+ {'deviceReviewStatus' => 'deviceReviewStatusString',
177
+ 'deviceReputationScore' => '100',
178
+ 'triggeredRule' => ['rule1','rule2']
208
179
  }
209
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<originalNetworkTransactionId>987654321098765432109876543210<\/originalNetworkTransactionId><originalTransactionAmount>10661<\/originalTransactionAmount>.*/m), is_a(Hash))
180
+ }
181
+ }
182
+ }
183
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<advancedFraudResults><deviceReviewStatus>deviceReviewStatusString<\/deviceReviewStatus><deviceReputationScore>100<\/deviceReputationScore><triggeredRule>rule1<\/triggeredRule><triggeredRule>rule2<\/triggeredRule><\/advancedFraudResults>.*/m), is_a(Hash))
210
184
  LitleOnlineRequest.new.capture_given_auth(hash)
211
- end
185
+ end
212
186
 
213
187
  end
214
188
  end
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2017 Vantiv eCommerce
2
+ Copyright (c) 2012 Litle & Co.
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
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2017 Vantiv eCommerce
2
+ Copyright (c) 2012 Litle & Co.
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
@@ -129,7 +129,8 @@ module LitleOnline
129
129
  'reportGroup'=>'Planets',
130
130
  'actionReason'=> 'SUSPECT_FRAUD'
131
131
  }
132
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<actionReason>SUSPECT_FRAUD<\/actionReason>.*/m), is_a(Hash))
132
+ XMLObject.expects(:new)
133
+ Communications.expects(:http_post).with(regexp_matches(/.*<actionReason>SUSPECT_FRAUD<\/actionReason>.*/m),kind_of(Hash))
133
134
  LitleOnlineRequest.new.credit(hash)
134
135
  end
135
136
 
@@ -337,19 +338,5 @@ module LitleOnline
337
338
  LitleOnlineRequest.new.credit(hash)
338
339
  end
339
340
 
340
- def test_pin
341
- hash = {
342
- 'merchantId' => '101',
343
- 'version'=>'8.8',
344
- 'reportGroup'=>'Planets',
345
- 'amount'=>'106',
346
- 'secondaryAmount'=>'20',
347
- 'litleTxnId'=>'1234',
348
- 'pin'=>'3333'
349
- }
350
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<pin>3333<\/pin>.*/m), is_a(Hash))
351
- LitleOnlineRequest.new.credit(hash)
352
- end
353
-
354
341
  end
355
342
  end
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2017 Vantiv eCommerce
2
+ Copyright (c) 2012 Litle & Co.
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
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2017 Vantiv eCommerce
2
+ Copyright (c) 2012 Litle & Co.
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
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2017 Vantiv eCommerce
2
+ Copyright (c) 2012 Litle & Co.
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
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2017 Vantiv eCommerce
2
+ Copyright (c) 2012 Litle & Co.
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
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2017 Vantiv eCommerce
2
+ Copyright (c) 2012 Litle & Co.
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
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2017 Vantiv eCommerce
2
+ Copyright (c) 2012 Litle & Co.
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
@@ -78,7 +78,7 @@ module LitleOnline
78
78
  'orderId'=>'12345',
79
79
  'orderSource'=>'ecommerce',
80
80
  'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455','ccdPaymentInformation'=>'12345678901234567890123456789012345678901234567890123456789012345678901234567890'},
81
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'}
81
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
82
82
  }
83
83
  LitleXmlMapper.expects(:request).with(regexp_matches(/.*<amount>123<\/amount><secondaryAmount>1<\/secondaryAmount>.*?<echeck>.*?<ccdPaymentInformation>.*<\/ccdPaymentInformation><\/echeck>.*/m), is_a(Hash))
84
84
  LitleOnlineRequest.new.echeck_sale(hash)
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2017 Vantiv eCommerce
2
+ Copyright (c) 2012 Litle & Co.
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
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2017 Vantiv eCommerce
2
+ Copyright (c) 2012 Litle & Co.
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
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2017 Vantiv eCommerce
2
+ Copyright (c) 2012 Litle & Co.
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
@@ -108,7 +108,7 @@ module LitleOnline
108
108
  LitleOnlineRequest.new.force_capture(hash)
109
109
  end
110
110
 
111
- def test_secondary_amount
111
+ def test_secondary_amount
112
112
  hash = {
113
113
  'amount' => '2',
114
114
  'secondaryAmount' => '1',
@@ -140,24 +140,6 @@ module LitleOnline
140
140
  LitleOnlineRequest.new.force_capture(hash)
141
141
  end
142
142
 
143
- def test_processing_type
144
- hash = {
145
- 'merchantId' => '101',
146
- 'version'=>'8.8',
147
- 'reportGroup'=>'Planets',
148
- 'orderId'=>'12344',
149
- 'amount'=>'106',
150
- 'orderSource'=>'ecommerce',
151
- 'processingType'=>'accountFunding',
152
- 'card'=>{
153
- 'type'=>'VI',
154
- 'number' =>'4100000000000001',
155
- 'expDate' =>'1210'
156
- }}
157
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<processingType>accountFunding<\/processingType>.*/m), is_a(Hash))
158
- LitleOnlineRequest.new.force_capture(hash)
159
- end
160
-
161
143
  end
162
144
 
163
145
  end
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2017 Vantiv eCommerce
2
+ Copyright (c) 2012 Litle & Co.
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
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2017 Vantiv eCommerce
2
+ Copyright (c) 2012 Litle & Co.
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
@@ -0,0 +1,122 @@
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
+
26
+
27
+ require File.expand_path("../../../lib/LitleOnline",__FILE__)
28
+ require 'test/unit'
29
+ require 'mocha/setup'
30
+
31
+ # TESTING THE QUERY TRANSACTION FEATURE
32
+
33
+
34
+ module LitleOnline
35
+ =begin
36
+ Definition: Class Definition for the Testing Class TestQueryTransaction
37
+ Created on: 01-29-2016
38
+ Reason: To test the incorporation new features developed in Ruby SDK as per XML 10.1 schema.
39
+ =end
40
+
41
+ class TestQueryTransaction < Test::Unit::TestCase
42
+
43
+ =begin
44
+ Name - test_queryTransaction
45
+ Description - To validate request by providing valid query transaction fields
46
+ Expected Response - Success
47
+ =end
48
+ def test_queryTransaction
49
+ hash =
50
+ {
51
+ 'merchantId' => '101',
52
+ 'id' => 'test',
53
+ 'version'=>'10.0',
54
+ 'reportGroup'=>'Some RG',
55
+ 'customerId' => '038945',
56
+ 'origId' => '834262',
57
+ 'origActionType' => 'A',
58
+ 'transactionId'=>'123456',
59
+ 'orderId'=>'65347567',
60
+ 'origAccountNumber' => '4000000000000001'
61
+ }
62
+
63
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*?<litleOnlineRequest.*?<queryTransaction.*?<origId>834262<\/origId><origActionType>A<\/origActionType>.*?<\/queryTransaction>.*?/m), is_a(Hash))
64
+ LitleOnlineRequest.new.query_Transaction(hash)
65
+ end
66
+
67
+ =begin
68
+ Name - test_queryTransaction_no_optional_fields
69
+ Description - To validate request by providing valid query transaction without providing optional fields
70
+ Expected Response - Success
71
+ =end
72
+ def test_queryTransaction_no_optional_fields
73
+ hash =
74
+ {
75
+ 'merchantId' => '101',
76
+ 'id' => 'test',
77
+ 'version'=>'10.0',
78
+ 'reportGroup'=>'Some RG',
79
+ 'customerId' => '038945',
80
+ 'origId' => '834262',
81
+ 'origActionType' => 'A',
82
+ 'transactionId'=>'123456'
83
+ }
84
+
85
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*?<litleOnlineRequest.*?<queryTransaction.*?<origId>834262<\/origId><origActionType>A<\/origActionType>.*?<\/queryTransaction>.*?/m), is_a(Hash))
86
+ LitleOnlineRequest.new.query_Transaction(hash)
87
+ end
88
+
89
+
90
+ def test_queryTransaction_no_origId
91
+ hash =
92
+ {
93
+ 'merchantId' => '101',
94
+ 'id' => 'test',
95
+ 'version'=>'10.0',
96
+ 'reportGroup'=>'Some RG',
97
+ 'customerId' => '038945',
98
+ 'origActionType' => 'A',
99
+ 'transactionId'=>'123456'
100
+ }
101
+
102
+ response= LitleOnlineRequest.new.query_Transaction(hash)
103
+ assert(response.message =~ /Error validating xml data against the schema/)
104
+ end
105
+
106
+ def test_queryTransaction_no_origId1
107
+ hash =
108
+ {
109
+ 'merchantId' => '101',
110
+ 'id' => 'test',
111
+ 'version'=>'10.0',
112
+ 'reportGroup'=>'Some RG',
113
+ 'customerId' => '038945',
114
+ 'origActionType' => 'AAA',
115
+ 'transactionId'=>'123456'
116
+ }
117
+
118
+ response= LitleOnlineRequest.new.query_Transaction(hash)
119
+ assert(response.message =~ /Error validating xml data against the schema/)
120
+ end
121
+ end
122
+ end
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2017 Vantiv eCommerce
2
+ Copyright (c) 2012 Litle & Co.
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