CnpOnline 8.31.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) 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/Rakefile~ +89 -0
  9. data/SETUP.md +46 -0
  10. data/bin/Setup.rb +124 -0
  11. data/bin/sample_batch_driver.rb +123 -0
  12. data/bin/sample_driver.rb +49 -0
  13. data/lib/Communications.rb +85 -0
  14. data/lib/Configuration.rb +67 -0
  15. data/lib/EnvironmentVariables.rb +22 -0
  16. data/lib/LitleBatchRequest.rb +562 -0
  17. data/lib/LitleListeners.rb +142 -0
  18. data/lib/LitleOnline.rb +62 -0
  19. data/lib/LitleOnlineRequest.rb +297 -0
  20. data/lib/LitleRequest.rb +494 -0
  21. data/lib/LitleTransaction.rb +463 -0
  22. data/lib/LitleXmlMapper.rb +64 -0
  23. data/lib/XMLFields.rb +1869 -0
  24. data/lib/cacert.pem +3331 -0
  25. data/samples/Auth/LitleAuthReversalTransaction.rb +15 -0
  26. data/samples/Auth/LitleAuthorizationTransaction.rb +31 -0
  27. data/samples/Auth/LitlePaymentFullLifeCycle.rb +47 -0
  28. data/samples/Batch/AccountUpdate.rb +64 -0
  29. data/samples/Batch/SampleBatchDriver.rb +94 -0
  30. data/samples/Capture/LitleCaptureGivenAuthTransaction.rb +30 -0
  31. data/samples/Capture/LitleCaptureTransaction.rb +14 -0
  32. data/samples/Capture/LitleForceCaptureTransaction.rb +26 -0
  33. data/samples/Capture/LitlePartialCapture.rb +16 -0
  34. data/samples/Credit/LitleCreditTransaction.rb +16 -0
  35. data/samples/Credit/LitleRefundTransaction.rb +29 -0
  36. data/samples/Other/LitleAvsTransaction.rb +34 -0
  37. data/samples/Other/LitleVoidTransaction.rb +18 -0
  38. data/samples/Paypage/FullPaypageLifeCycle.rb +74 -0
  39. data/samples/Run_all.rb +17 -0
  40. data/samples/Sale/LitleSaleTransaction.rb +29 -0
  41. data/samples/Sale/SampleSaleTransaction.rb +24 -0
  42. data/test/certification/certTest1_base.rb +945 -0
  43. data/test/certification/certTest2_authenhanced.rb +573 -0
  44. data/test/certification/certTest3_authreversal.rb +185 -0
  45. data/test/certification/certTest4_echeck.rb +278 -0
  46. data/test/certification/certTest5_token.rb +204 -0
  47. data/test/certification/certTest_batchAll.rb +337 -0
  48. data/test/certification/ts_all.rb +33 -0
  49. data/test/functional/test_activate.rb +100 -0
  50. data/test/functional/test_activateReversal.rb +56 -0
  51. data/test/functional/test_auth.rb +298 -0
  52. data/test/functional/test_authReversal.rb +69 -0
  53. data/test/functional/test_balanceInquiry.rb +80 -0
  54. data/test/functional/test_batch.rb +164 -0
  55. data/test/functional/test_batchStream.rb +145 -0
  56. data/test/functional/test_cancelSubscription.rb +55 -0
  57. data/test/functional/test_capture.rb +84 -0
  58. data/test/functional/test_captureGivenAuth.rb +235 -0
  59. data/test/functional/test_configuration.rb +89 -0
  60. data/test/functional/test_createPlan.rb +85 -0
  61. data/test/functional/test_credit.rb +174 -0
  62. data/test/functional/test_deactivate.rb +80 -0
  63. data/test/functional/test_deactivateReversal.rb +56 -0
  64. data/test/functional/test_depositReversal.rb +56 -0
  65. data/test/functional/test_echeckCredit.rb +134 -0
  66. data/test/functional/test_echeckRedeposit.rb +88 -0
  67. data/test/functional/test_echeckSale.rb +177 -0
  68. data/test/functional/test_echeckVerification.rb +127 -0
  69. data/test/functional/test_echeckVoid.rb +41 -0
  70. data/test/functional/test_forceCapture.rb +183 -0
  71. data/test/functional/test_litle_requests.rb +356 -0
  72. data/test/functional/test_load.rb +82 -0
  73. data/test/functional/test_loadReversal.rb +56 -0
  74. data/test/functional/test_override.rb +64 -0
  75. data/test/functional/test_refundReversal.rb +56 -0
  76. data/test/functional/test_sale.rb +259 -0
  77. data/test/functional/test_token.rb +115 -0
  78. data/test/functional/test_unload.rb +82 -0
  79. data/test/functional/test_unloadReversal.rb +56 -0
  80. data/test/functional/test_updateCardValidationNumOnToken.rb +43 -0
  81. data/test/functional/test_updatePlan.rb +58 -0
  82. data/test/functional/test_updateSubscription.rb +76 -0
  83. data/test/functional/test_xmlfields.rb +427 -0
  84. data/test/functional/ts_all.rb +66 -0
  85. data/test/unit/test_LitleAUBatch.rb +216 -0
  86. data/test/unit/test_LitleBatchRequest.rb +643 -0
  87. data/test/unit/test_LitleOnlineRequest.rb +295 -0
  88. data/test/unit/test_LitleRequest.rb +316 -0
  89. data/test/unit/test_LitleTransaction.rb +397 -0
  90. data/test/unit/test_activate.rb +92 -0
  91. data/test/unit/test_activateReversal.rb +44 -0
  92. data/test/unit/test_auth.rb +421 -0
  93. data/test/unit/test_authReversal.rb +82 -0
  94. data/test/unit/test_balanceInquiry.rb +52 -0
  95. data/test/unit/test_cancelSubscription.rb +43 -0
  96. data/test/unit/test_capture.rb +73 -0
  97. data/test/unit/test_captureGivenAuth.rb +188 -0
  98. data/test/unit/test_createPlan.rb +52 -0
  99. data/test/unit/test_credit.rb +342 -0
  100. data/test/unit/test_deactivate.rb +52 -0
  101. data/test/unit/test_deactivateReversal.rb +44 -0
  102. data/test/unit/test_depositReversal.rb +44 -0
  103. data/test/unit/test_echeckCredit.rb +71 -0
  104. data/test/unit/test_echeckRedeposit.rb +94 -0
  105. data/test/unit/test_echeckSale.rb +71 -0
  106. data/test/unit/test_echeckVerification.rb +71 -0
  107. data/test/unit/test_echeckVoid.rb +54 -0
  108. data/test/unit/test_forceCapture.rb +145 -0
  109. data/test/unit/test_load.rb +53 -0
  110. data/test/unit/test_loadReversal.rb +44 -0
  111. data/test/unit/test_refundReversal.rb +44 -0
  112. data/test/unit/test_sale.rb +465 -0
  113. data/test/unit/test_token.rb +144 -0
  114. data/test/unit/test_unload.rb +53 -0
  115. data/test/unit/test_unloadReversal.rb +44 -0
  116. data/test/unit/test_updateCardValidationNumOnToken.rb +80 -0
  117. data/test/unit/test_updatePlan.rb +45 -0
  118. data/test/unit/test_updateSubscription.rb +172 -0
  119. data/test/unit/test_xmlfields.rb +2930 -0
  120. data/test/unit/ts_unit.rb +65 -0
  121. metadata +255 -0
@@ -0,0 +1,185 @@
1
+ require File.expand_path("../../../lib/LitleOnline",__FILE__)
2
+ require 'test/unit'
3
+
4
+ module LitleOnline
5
+ class Litle_certTest3 < Test::Unit::TestCase
6
+ #test auth reversal
7
+ @@merchant_hash = {'reportGroup'=>'Planets','id'=>'321','customerId'=>'123',
8
+ 'merchantId'=>'101'
9
+ }
10
+
11
+ def test_32
12
+ customer_hash = {
13
+ 'orderId' => '32',
14
+ 'amount' => '10010',
15
+ 'orderSource'=>'ecommerce',
16
+ 'billToAddress'=>{
17
+ 'name' => 'John Smith',
18
+ 'addressLine1' => '1 Main St.',
19
+ 'city' => 'Burlington',
20
+ 'state' => 'MA',
21
+ 'zip' => '01803-3747',
22
+ 'country' => 'US'},
23
+ 'card'=>{
24
+ 'number' =>'4457010000000009',
25
+ 'expDate' => '0112',
26
+ 'cardValidationNum' => '349',
27
+ 'type' => 'VI'}
28
+ }
29
+ hash = customer_hash.merge(@@merchant_hash)
30
+ auth_response = LitleOnlineRequest.new.authorization(hash)
31
+ assert_equal('000', auth_response.authorizationResponse.response)
32
+ assert_equal('Approved', auth_response.authorizationResponse.message)
33
+ assert_equal('11111 ', auth_response.authorizationResponse.authCode)
34
+ assert_equal('01', auth_response.authorizationResponse.fraudResult.avsResult)
35
+ assert_equal('M', auth_response.authorizationResponse.fraudResult.cardValidationResult)
36
+
37
+ #test 32A
38
+ capture_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId, 'amount' => '5005'}
39
+ hash1a = capture_hash.merge(@@merchant_hash)
40
+ capture_response = LitleOnlineRequest.new.capture(hash1a)
41
+ assert_equal('000', capture_response.captureResponse.response)
42
+ assert_equal('Approved', capture_response.captureResponse.message)
43
+
44
+ #test 32B
45
+ auth_r_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId }
46
+ hash1b = auth_r_hash.merge(@@merchant_hash)
47
+ auth_r_response = LitleOnlineRequest.new.auth_reversal(hash1b)
48
+ assert_equal('111', auth_r_response.authReversalResponse.response)
49
+ assert_equal('Authorization amount has already been depleted', auth_r_response.authReversalResponse.message)
50
+ end
51
+
52
+ def test_33
53
+ customer_hash = {
54
+ 'orderId' => '33',
55
+ 'amount' => '20020',
56
+ 'orderSource'=>'ecommerce',
57
+ 'billToAddress'=>{
58
+ 'name' => 'Mike J. Hammer',
59
+ 'addressLine1' => '2 Main St.',
60
+ 'addressLine2' => 'Apt. 222',
61
+ 'city' => 'Riverside',
62
+ 'state' => 'RI',
63
+ 'zip' => '02915',
64
+ 'country' => 'US'},
65
+ 'card'=>{
66
+ 'number' =>'5112010000000003',
67
+ 'expDate' => '0212',
68
+ 'cardValidationNum' => '261',
69
+ 'type' => 'MC'},
70
+ 'cardholderAuthentication' => {'authenticationValue'=> 'BwABBJQ1AgAAAAAgJDUCAAAAAAA=' }
71
+ }
72
+ hash = customer_hash.merge(@@merchant_hash)
73
+ auth_response = LitleOnlineRequest.new.authorization(hash)
74
+ assert_equal('000', auth_response.authorizationResponse.response)
75
+ assert_equal('Approved', auth_response.authorizationResponse.message)
76
+ assert_equal('22222', auth_response.authorizationResponse.authCode)
77
+ assert_equal('10', auth_response.authorizationResponse.fraudResult.avsResult)
78
+ assert_equal('M', auth_response.authorizationResponse.fraudResult.cardValidationResult)
79
+
80
+ #test 33A
81
+ auth_reversal_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId}
82
+ hash1a = auth_reversal_hash.merge(@@merchant_hash)
83
+ auth_reversal_response = LitleOnlineRequest.new.auth_reversal(hash1a)
84
+ assert_equal('000', auth_reversal_response.authReversalResponse.response)
85
+ assert_equal('Approved', auth_reversal_response.authReversalResponse.message)
86
+ end
87
+
88
+ def test_34
89
+ customer_hash = {
90
+ 'orderId' => '34',
91
+ 'amount' => '30030',
92
+ 'orderSource'=>'ecommerce',
93
+ 'billToAddress'=>{
94
+ 'name' => 'Eileen Jones',
95
+ 'addressLine1' => '3 Main St.',
96
+ 'city' => 'Bloomfield',
97
+ 'state' => 'CT',
98
+ 'zip' => '06002',
99
+ 'country' => 'US'},
100
+ 'card'=>{
101
+ 'number' =>'6011010000000003',
102
+ 'expDate' => '0312',
103
+ 'cardValidationNum' => '758',
104
+ 'type' => 'DI'}
105
+ }
106
+ hash = customer_hash.merge(@@merchant_hash)
107
+ auth_response = LitleOnlineRequest.new.authorization(hash)
108
+ assert_equal('000', auth_response.authorizationResponse.response)
109
+ assert_equal('Approved', auth_response.authorizationResponse.message)
110
+ assert_equal('33333', auth_response.authorizationResponse.authCode)
111
+ assert_equal('10', auth_response.authorizationResponse.fraudResult.avsResult)
112
+ assert_equal('M', auth_response.authorizationResponse.fraudResult.cardValidationResult)
113
+
114
+ #test 34A
115
+ auth_reversal_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId}
116
+ hash1a = auth_reversal_hash.merge(@@merchant_hash)
117
+ auth_reversal_response = LitleOnlineRequest.new.auth_reversal(hash1a)
118
+ assert_equal('000', auth_reversal_response.authReversalResponse.response)
119
+ assert_equal('Approved', auth_reversal_response.authReversalResponse.message)
120
+ end
121
+
122
+ def test_35
123
+ customer_hash = {
124
+ 'orderId' => '35',
125
+ 'amount' => '40040',
126
+ 'orderSource'=>'ecommerce',
127
+ 'billToAddress'=>{
128
+ 'name' => 'Bob Black',
129
+ 'addressLine1' => '4 Main St.',
130
+ 'city' => 'Laurel',
131
+ 'state' => 'MD',
132
+ 'zip' => '20708',
133
+ 'country' => 'US'},
134
+ 'card'=>{
135
+ 'number' =>'375001000000005',
136
+ 'expDate' => '0412',
137
+ 'type' => 'AX'}
138
+ }
139
+ hash = customer_hash.merge(@@merchant_hash)
140
+ auth_response = LitleOnlineRequest.new.authorization(hash)
141
+ assert_equal('000', auth_response.authorizationResponse.response)
142
+ assert_equal('Approved', auth_response.authorizationResponse.message)
143
+ assert_equal('44444', auth_response.authorizationResponse.authCode)
144
+ assert_equal('12', auth_response.authorizationResponse.fraudResult.avsResult)
145
+
146
+ # #test 35A
147
+ capture_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId, 'amount' => '20020'}
148
+ hash1a = capture_hash.merge(@@merchant_hash)
149
+ capture_response = LitleOnlineRequest.new.capture(hash1a)
150
+ assert_equal('000', capture_response.captureResponse.response)
151
+ assert_equal('Approved', capture_response.captureResponse.message)
152
+
153
+ # #test 35B
154
+ auth_reversal_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId, 'amount' => '20020'}
155
+ hash2a = auth_reversal_hash.merge(@@merchant_hash)
156
+ auth_reversal_response = LitleOnlineRequest.new.auth_reversal(hash2a)
157
+ assert_equal('000', auth_reversal_response.authReversalResponse.response)
158
+ assert_equal('Approved', auth_reversal_response.authReversalResponse.message)
159
+ end
160
+
161
+ def test_36
162
+ customer_hash = {
163
+ 'orderId' => '36',
164
+ 'amount' => '20500',
165
+ 'orderSource'=>'ecommerce',
166
+ 'card'=>{
167
+ 'number' =>'375000026600004',
168
+ 'expDate' => '0512',
169
+ 'type' => 'AX'}
170
+ }
171
+ hash = customer_hash.merge(@@merchant_hash)
172
+ auth_response = LitleOnlineRequest.new.authorization(hash)
173
+ assert_equal('000', auth_response.authorizationResponse.response)
174
+ assert_equal('Approved', auth_response.authorizationResponse.message)
175
+
176
+ #test 36A
177
+ auth_reversal_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId, 'amount' => '10000'}
178
+ hash1a = auth_reversal_hash.merge(@@merchant_hash)
179
+ auth_reversal_response = LitleOnlineRequest.new.auth_reversal(hash1a)
180
+ assert_equal('336', auth_reversal_response.authReversalResponse.response)
181
+ assert_equal('Reversal Amount does not match Authorization amount', auth_reversal_response.authReversalResponse.message)
182
+ end
183
+
184
+ end
185
+ end
@@ -0,0 +1,278 @@
1
+ require File.expand_path("../../../lib/LitleOnline",__FILE__)
2
+ require 'test/unit'
3
+
4
+ module LitleOnline
5
+ class Litle_certTest4 < Test::Unit::TestCase
6
+ # test echeck
7
+ @@merchant_hash = {'reportGroup'=>'Planets',
8
+ 'merchantId'=>'101'
9
+ }
10
+
11
+ # test 37-49 merchant authorizate to do echeck using 087901 with same username IMPTEST, password cert3d6Z
12
+ # test 37-40 echeckVerification
13
+ def test_37
14
+ customer_hash = {
15
+ 'orderId' => '37',
16
+ 'amount' => '3001',
17
+ 'orderSource'=>'telephone',
18
+ 'billToAddress'=>{
19
+ 'firstName' => 'Tom',
20
+ 'lastName' => 'Black'},
21
+
22
+ 'echeck'=>{
23
+ 'accNum' =>'10@BC99999',
24
+ 'accType' => 'Checking',
25
+ 'routingNum' => '053100300'}
26
+ }
27
+ hash = customer_hash.merge(@@merchant_hash)
28
+ echeck_response = LitleOnlineRequest.new.echeck_verification(hash)
29
+ assert_equal('301', echeck_response.echeckVerificationResponse.response)
30
+ assert_equal('Invalid Account Number', echeck_response.echeckVerificationResponse.message)
31
+ end
32
+
33
+ def test_38
34
+ customer_hash = {
35
+ 'orderId' => '38',
36
+ 'amount' => '3002',
37
+ 'orderSource'=>'telephone',
38
+ 'billToAddress'=>{
39
+ 'firstName' => 'John',
40
+ 'lastName' => 'Smith',
41
+ 'phone' => '999-999-9999'
42
+ },
43
+
44
+ 'echeck'=>{
45
+ 'accNum' =>'1099999999',
46
+ 'accType' => 'Checking',
47
+ 'routingNum' => '053000219'}
48
+ }
49
+ hash = customer_hash.merge(@@merchant_hash)
50
+ echeck_response = LitleOnlineRequest.new.echeck_verification(hash)
51
+ assert_equal('000', echeck_response.echeckVerificationResponse.response)
52
+ assert_equal('Approved', echeck_response.echeckVerificationResponse.message)
53
+ end
54
+
55
+ def test_39
56
+ customer_hash = {
57
+ 'orderId' => '39',
58
+ 'amount' => '3003',
59
+ 'orderSource'=>'telephone',
60
+ 'billToAddress'=>{
61
+ 'firstName' => 'Robert',
62
+ 'lastName' => 'Jones',
63
+ 'companyName' => 'Good Goods Inc',
64
+ 'phone' => '9999999999'
65
+ },
66
+
67
+ 'echeck'=>{
68
+ 'accNum' =>'3099999999',
69
+ 'accType' => 'Corporate',
70
+ 'routingNum' => '053100300'}
71
+ }
72
+ hash = customer_hash.merge(@@merchant_hash)
73
+ echeck_response = LitleOnlineRequest.new.echeck_verification(hash)
74
+ assert_equal('950', echeck_response.echeckVerificationResponse.response)
75
+ assert_equal('Declined - Negative Information on File', echeck_response.echeckVerificationResponse.message)
76
+ end
77
+
78
+ def test_40
79
+ customer_hash = {
80
+ 'orderId' => '40',
81
+ 'amount' => '3004',
82
+ 'orderSource'=>'telephone',
83
+ 'billToAddress'=>{
84
+ 'firstName' => 'Peter',
85
+ 'lastName' => 'Green',
86
+ 'companyName' => 'Green Co',
87
+ 'phone' => '9999999999'
88
+ },
89
+
90
+ 'echeck'=>{
91
+ 'accNum' =>'8099999999',
92
+ 'accType' => 'Corporate',
93
+ 'routingNum' => '063102152'}
94
+ }
95
+ hash = customer_hash.merge(@@merchant_hash)
96
+ echeck_response = LitleOnlineRequest.new.echeck_verification(hash)
97
+ assert_equal('951', echeck_response.echeckVerificationResponse.response)
98
+ assert_equal('Absolute Decline', echeck_response.echeckVerificationResponse.message)
99
+ end
100
+
101
+ # #test 41-44 echeckSales
102
+ def test_41
103
+ customer_hash = {
104
+ 'orderId' => '41',
105
+ 'amount' => '2008',
106
+ 'orderSource'=>'telephone',
107
+ 'billToAddress'=>{
108
+ 'firstName' => 'Mike',
109
+ 'middleInitial' => 'J',
110
+ 'lastName' => 'Hammer'
111
+ },
112
+ 'echeck'=>{
113
+ 'accNum' =>'10@BC99999',
114
+ 'accType' => 'Checking',
115
+ 'routingNum' => '053100300'}
116
+ }
117
+ hash = customer_hash.merge(@@merchant_hash)
118
+ echeck_response = LitleOnlineRequest.new.echeck_sale(hash)
119
+
120
+ assert_equal('301', echeck_response.echeckSalesResponse.response)
121
+ assert_equal('Invalid Account Number', echeck_response.echeckSalesResponse.message)
122
+ end
123
+
124
+ def test_42
125
+ customer_hash = {
126
+ 'orderId' => '42',
127
+ 'amount' => '2004',
128
+ 'orderSource'=>'telephone',
129
+ 'billToAddress'=>{
130
+ 'firstName' => 'Tom',
131
+ 'lastName' => 'Black'
132
+ },
133
+ 'echeck'=>{
134
+ 'accNum' =>'4099999992',
135
+ 'accType' => 'Checking',
136
+ 'routingNum' => '211370545'}
137
+ }
138
+ hash = customer_hash.merge(@@merchant_hash)
139
+ echeck_response = LitleOnlineRequest.new.echeck_sale(hash)
140
+
141
+ assert_equal('000', echeck_response.echeckSalesResponse.response)
142
+ assert_equal('Approved', echeck_response.echeckSalesResponse.message)
143
+ end
144
+
145
+ def test_43
146
+ customer_hash = {
147
+ 'orderId' => '43',
148
+ 'amount' => '2007',
149
+ 'orderSource'=>'telephone',
150
+ 'billToAddress'=>{
151
+ 'firstName' => 'Peter',
152
+ 'lastName' => 'Green',
153
+ 'companyName' => 'Green Co'
154
+ },
155
+
156
+ 'echeck'=>{
157
+ 'accNum' =>'6099999992',
158
+ 'accType' => 'Corporate',
159
+ 'routingNum' => '211370545'}
160
+ }
161
+ hash = customer_hash.merge(@@merchant_hash)
162
+ echeck_response = LitleOnlineRequest.new.echeck_sale(hash)
163
+
164
+ assert_equal('000', echeck_response.echeckSalesResponse.response)
165
+ assert_equal('Approved', echeck_response.echeckSalesResponse.message)
166
+ end
167
+
168
+ def test_44
169
+ customer_hash = {
170
+ 'orderId' => '44',
171
+ 'amount' => '2009',
172
+ 'orderSource'=>'telephone',
173
+ 'billToAddress'=>{
174
+ 'firstName' => 'Peter',
175
+ 'lastName' => 'Green',
176
+ 'companyName' => 'Green Co'
177
+ },
178
+
179
+ 'echeck'=>{
180
+ 'accNum' =>'9099999992',
181
+ 'accType' => 'Corporate',
182
+ 'routingNum' => '053133052'}
183
+ }
184
+ hash = customer_hash.merge(@@merchant_hash)
185
+ echeck_response = LitleOnlineRequest.new.echeck_sale(hash)
186
+
187
+ assert_equal('900', echeck_response.echeckSalesResponse.response)
188
+ assert_equal('Invalid Bank Routing Number', echeck_response.echeckSalesResponse.message)
189
+ end
190
+
191
+ # #test 45-49 echeckCredit
192
+ def test_45
193
+ customer_hash = {
194
+ 'orderId' => '45',
195
+ 'amount' => '1001',
196
+ 'orderSource'=>'telephone',
197
+ 'billToAddress'=>{
198
+ 'firstName' => 'John',
199
+ 'lastName' => 'Smith'
200
+ },
201
+ 'echeck'=>{
202
+ 'accNum' =>'10@BC99999',
203
+ 'accType' => 'Checking',
204
+ 'routingNum' => '053100300'}
205
+ }
206
+ hash = customer_hash.merge(@@merchant_hash)
207
+ echeck_response = LitleOnlineRequest.new.echeck_credit(hash)
208
+
209
+ assert_equal('301', echeck_response.echeckCreditResponse.response)
210
+ end
211
+
212
+ def test_46
213
+ customer_hash = {
214
+ 'orderId' => '46',
215
+ 'amount' => '1003',
216
+ 'orderSource'=>'telephone',
217
+ 'billToAddress'=>{
218
+ 'firstName' => 'Robert',
219
+ 'lastName' => 'Jones',
220
+ 'companyName' => 'Widget Inc'
221
+ },
222
+ 'echeck'=>{
223
+ 'accNum' =>'3099999999',
224
+ 'accType' => 'Corporate',
225
+ 'routingNum' => '063102152'}
226
+ }
227
+ hash = customer_hash.merge(@@merchant_hash)
228
+ echeck_response = LitleOnlineRequest.new.echeck_credit(hash)
229
+
230
+ assert_equal('000', echeck_response.echeckCreditResponse.response)
231
+ assert_equal('Approved', echeck_response.echeckCreditResponse.message)
232
+ end
233
+
234
+ def test_47
235
+ customer_hash = {
236
+ 'orderId' => '47',
237
+ 'amount' => '1007',
238
+ 'orderSource'=>'telephone',
239
+ 'billToAddress'=>{
240
+ 'firstName' => 'Peter',
241
+ 'lastName' => 'Green',
242
+ 'companyName' => 'Green Co'
243
+ },
244
+ 'echeck'=>{
245
+ 'accNum' =>'6099999993',
246
+ 'accType' => 'Corporate',
247
+ 'routingNum' => '211370545'}
248
+ }
249
+ hash = customer_hash.merge(@@merchant_hash)
250
+ echeck_response = LitleOnlineRequest.new.echeck_credit(hash)
251
+
252
+ assert_equal('000', echeck_response.echeckCreditResponse.response)
253
+ assert_equal('Approved', echeck_response.echeckCreditResponse.message)
254
+ end
255
+
256
+ def test_48
257
+ customer_hash = {
258
+ 'litleTxnId' => '430000000000000001'
259
+ }
260
+ hash = customer_hash.merge(@@merchant_hash)
261
+ echeck_response = LitleOnlineRequest.new.echeck_credit(hash)
262
+
263
+ assert_equal('000', echeck_response.echeckCreditResponse.response)
264
+ assert_equal('Approved', echeck_response.echeckCreditResponse.message)
265
+ end
266
+
267
+ def test_49
268
+ customer_hash = {
269
+ 'litleTxnId' => '2'
270
+ }
271
+ hash = customer_hash.merge(@@merchant_hash)
272
+ echeck_response = LitleOnlineRequest.new.echeck_credit(hash)
273
+
274
+ assert_equal('360', echeck_response.echeckCreditResponse.response)
275
+ assert_equal('No transaction found with specified litleTxnId', echeck_response.echeckCreditResponse.message)
276
+ end
277
+ end
278
+ end