CnpOnline 9.14.0 → 11.4.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 -7
  2. data/CHANGELOG +23 -17
  3. data/CONTRIBUTORS +0 -0
  4. data/DESCRIPTION +1 -1
  5. data/LICENSE +1 -1
  6. data/README.md +5 -3
  7. data/Rakefile +5 -5
  8. data/Rakefile~ +5 -5
  9. data/SETUP.md +3 -3
  10. data/bin/Setup.rb +59 -41
  11. data/lib/Communications.rb +3 -3
  12. data/lib/Configuration.rb +52 -45
  13. data/lib/EnvironmentVariables.rb +5 -1
  14. data/lib/LitleBatchRequest.rb +72 -7
  15. data/lib/LitleListeners.rb +17 -1
  16. data/lib/LitleOnline.rb +3 -4
  17. data/lib/LitleOnlineRequest.rb +37 -7
  18. data/lib/LitleRequest.rb +315 -186
  19. data/lib/LitleTransaction.rb +212 -85
  20. data/lib/LitleXmlMapper.rb +4 -2
  21. data/lib/XMLFields.rb +384 -171
  22. data/lib/cacert.pem +0 -0
  23. data/samples/Auth/LitleAuthReversalTransaction.rb +2 -2
  24. data/samples/Auth/LitleAuthorizationTransaction.rb +1 -0
  25. data/samples/Auth/LitlePaymentFullLifeCycle.rb +12 -6
  26. data/samples/Batch/AccountUpdate.rb +1 -0
  27. data/samples/Batch/SampleBatchDriver.rb +2 -1
  28. data/samples/Capture/LitleCaptureGivenAuthTransaction.rb +2 -1
  29. data/samples/Capture/LitleCaptureTransaction.rb +2 -2
  30. data/samples/Capture/LitleForceCaptureTransaction.rb +2 -1
  31. data/samples/Capture/LitlePartialCapture.rb +3 -3
  32. data/samples/Credit/LitleCreditTransaction.rb +2 -2
  33. data/samples/Credit/LitleRefundTransaction.rb +2 -1
  34. data/samples/Other/LitleAvsTransaction.rb +2 -1
  35. data/samples/Other/LitleVoidTransaction.rb +2 -1
  36. data/samples/Paypage/FullPaypageLifeCycle.rb +7 -2
  37. data/samples/Run_all.rb +0 -0
  38. data/samples/Sale/LitleSaleTransaction.rb +2 -1
  39. data/samples/Sale/SampleSaleTransaction.rb +2 -1
  40. data/test/certification/certTest1_base.rb +52 -53
  41. data/test/certification/certTest2_authenhanced.rb +24 -25
  42. data/test/certification/certTest3_authreversal.rb +23 -26
  43. data/test/certification/certTest4_echeck.rb +18 -32
  44. data/test/certification/certTest5_token.rb +105 -106
  45. data/test/certification/certTest_batchAll.rb +47 -15
  46. data/test/functional/test_activate.rb +32 -4
  47. data/test/functional/test_activateReversal.rb +18 -5
  48. data/test/functional/test_auth.rb +94 -48
  49. data/test/functional/test_authReversal.rb +4 -1
  50. data/test/functional/test_balanceInquiry.rb +28 -3
  51. data/test/functional/test_batchStream.rb +2 -4
  52. data/test/functional/test_cancelSubscription.rb +2 -2
  53. data/test/functional/test_capture.rb +21 -14
  54. data/test/functional/test_captureGivenAuth.rb +15 -6
  55. data/test/functional/test_createPlan.rb +1 -1
  56. data/test/functional/test_credit.rb +14 -5
  57. data/test/functional/test_deactivate.rb +26 -3
  58. data/test/functional/test_deactivateReversal.rb +18 -5
  59. data/test/functional/test_depositReversal.rb +31 -19
  60. data/test/functional/test_echeckCredit.rb +34 -6
  61. data/test/functional/test_echeckRedeposit.rb +29 -2
  62. data/test/functional/test_echeckSale.rb +68 -11
  63. data/test/functional/test_echeckVerification.rb +32 -7
  64. data/test/functional/test_echeckVoid.rb +2 -1
  65. data/test/functional/test_forceCapture.rb +20 -6
  66. data/test/functional/test_fraudCheck.rb +3 -5
  67. data/test/functional/test_giftCardAuthReversal.rb +72 -0
  68. data/test/functional/test_giftCardCapture.rb +72 -0
  69. data/test/functional/test_giftCardCredit.rb +69 -0
  70. data/test/functional/test_litle_requests.rb +3 -6
  71. data/test/functional/test_load.rb +27 -3
  72. data/test/functional/test_loadReversal.rb +18 -5
  73. data/test/functional/test_override.rb +7 -3
  74. data/test/functional/test_pgp_litle_requests.rb +294 -0
  75. data/test/functional/test_queryTransaction.rb +152 -0
  76. data/test/functional/test_refundReversal.rb +18 -5
  77. data/test/functional/test_sale.rb +122 -159
  78. data/test/functional/test_token.rb +17 -11
  79. data/test/functional/test_unload.rb +27 -3
  80. data/test/functional/test_unloadReversal.rb +18 -5
  81. data/test/functional/test_updateCardValidationNumOnToken.rb +1 -0
  82. data/test/functional/test_updatePlan.rb +2 -1
  83. data/test/functional/test_updateSubscription.rb +3 -1
  84. data/test/functional/test_wallet.rb +74 -0
  85. data/test/functional/test_xmlfields.rb +22 -3
  86. data/test/functional/ts_all.rb +2 -0
  87. data/test/unit/test_LitleBatchRequest.rb +53 -5
  88. data/test/unit/test_LitleOnlineRequest.rb +5 -30
  89. data/test/unit/test_LitleRequest.rb +7 -6
  90. data/test/unit/test_LitleTransaction.rb +34 -5
  91. data/test/unit/test_LitleXmlMapper.rb +3 -0
  92. data/test/unit/test_activate.rb +22 -2
  93. data/test/unit/test_activateReversal.rb +15 -3
  94. data/test/unit/test_auth.rb +11 -9
  95. data/test/unit/test_balanceInquiry.rb +2 -2
  96. data/test/unit/test_capture.rb +2 -2
  97. data/test/unit/test_captureGivenAuth.rb +21 -1
  98. data/test/unit/test_credit.rb +1 -1
  99. data/test/unit/test_deactivate.rb +19 -0
  100. data/test/unit/test_deactivateReversal.rb +15 -3
  101. data/test/unit/test_depositReversal.rb +17 -5
  102. data/test/unit/test_echeckCredit.rb +19 -0
  103. data/test/unit/test_echeckRedeposit.rb +15 -0
  104. data/test/unit/test_echeckSale.rb +20 -1
  105. data/test/unit/test_echeckVerification.rb +6 -3
  106. data/test/unit/test_forceCapture.rb +1 -1
  107. data/test/unit/test_giftCardAuthReversal.rb +58 -0
  108. data/test/{functional/test_utf8.rb → unit/test_giftCardCapture.rb} +25 -12
  109. data/test/unit/test_giftCardCredit.rb +57 -0
  110. data/test/unit/test_load.rb +2 -2
  111. data/test/unit/test_loadReversal.rb +15 -3
  112. data/test/unit/test_pgp_LitleRequest +139 -0
  113. data/test/unit/test_queryTransaction.rb +105 -0
  114. data/test/unit/test_refundReversal.rb +15 -3
  115. data/test/unit/test_sale.rb +23 -3
  116. data/test/unit/test_token.rb +24 -20
  117. data/test/unit/test_unload.rb +2 -2
  118. data/test/unit/test_unloadReversal.rb +15 -3
  119. data/test/unit/test_wallet.rb +262 -0
  120. data/test/unit/ts_unit.rb +2 -1
  121. metadata +81 -100
@@ -33,12 +33,25 @@ def test_simple
33
33
  hash = {
34
34
  'merchantId' => '101',
35
35
  'version'=>'8.8',
36
+ 'id'=>'test',
36
37
  'reportGroup'=>'Planets',
37
- 'litleTxnId' =>'5000'
38
- }
38
+ 'litleTxnId' =>'5000',
39
+ 'card'=>{
40
+ 'type'=>'GC',
41
+ 'number' =>'400000000000001',
42
+ 'expDate' =>'0150',
43
+ 'pin' => '1234',
44
+ 'cardValidationNum' => '411'
45
+ },
46
+ 'originalRefCode' => '101',
47
+ 'originalAmount' => '34561',
48
+ 'originalTxnTime' => '2017-01-24T09:00:00',
49
+ 'originalSystemTraceId' => '33',
50
+ 'originalSequenceNumber' => '111111',
51
+ }
39
52
 
40
- response= LitleOnlineRequest.new.deactivate_reversal(hash)
41
- assert_equal('Valid Format', response.message)
53
+ response= LitleOnlineRequest.new.deposit_reversal(hash)
54
+ assert_equal('000', response.depositReversalResponse.response)
42
55
  end
43
56
 
44
57
 
@@ -52,7 +65,7 @@ def test_simple
52
65
  #Get exceptions
53
66
  exception = assert_raise(RuntimeError){LitleOnlineRequest.new.deactivate_reversal(hash)}
54
67
  #Test
55
- assert(exception.message =~ /Error validating xml data against the schema/)
68
+ assert(exception.message =~ /Error validating xml data against the schema/)
56
69
  end
57
70
  end
58
71
  end
@@ -22,37 +22,49 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22
22
  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23
23
  OTHER DEALINGS IN THE SOFTWARE.
24
24
  =end
25
- require File.expand_path("../../../lib/LitleOnline",__FILE__)
25
+ require File.expand_path("../../../lib/LitleOnline",__FILE__)
26
26
  require 'test/unit'
27
27
 
28
28
  #test DepositReversal Transaction
29
29
  module LitleOnline
30
- class TestDepositReversal < Test::Unit::TestCase
31
-
32
- def test_simple
33
- hash = {
30
+ class TestDepositReversal < Test::Unit::TestCase
31
+ def test_simple
32
+ hash = {
34
33
  'merchantId' => '101',
35
34
  'version'=>'8.8',
35
+ 'id'=>'test',
36
36
  'reportGroup'=>'Planets',
37
- 'litleTxnId' =>'5000'
38
- }
39
-
40
- response= LitleOnlineRequest.new.deposit_reversal(hash)
41
- assert_equal('Valid Format', response.message)
42
- end
37
+ 'litleTxnId' =>'5000',
38
+ 'card'=>{
39
+ 'type'=>'GC',
40
+ 'number' =>'400000000000000',
41
+ 'expDate' =>'0150',
42
+ 'pin' => '1234',
43
+ 'cardValidationNum' => '411'
44
+ },
45
+ 'originalRefCode' => '101',
46
+ 'originalAmount' => '34561',
47
+ 'originalTxnTime' => '2017-01-24T09:00:00',
48
+ 'originalSystemTraceId' => '33',
49
+ 'originalSequenceNumber' => '111111',
50
+ }
43
51
 
52
+ response= LitleOnlineRequest.new.deposit_reversal(hash)
53
+ assert_equal('000', response.depositReversalResponse.response)
54
+ end
44
55
 
45
- def test_simple_error
46
- hash = {
56
+ def test_simple_error
57
+ hash = {
47
58
  'merchantId' => '101',
48
59
  'version'=>'8.8',
60
+ 'id'=>'test',
49
61
  'reportGroup'=>'Planets',
50
- }
62
+ }
51
63
 
52
- #Get exceptions
53
- exception = assert_raise(RuntimeError){LitleOnlineRequest.new.deposit_reversal(hash)}
54
- #Test
55
- assert(exception.message =~ /Error validating xml data against the schema/)
64
+ #Get exceptions
65
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.deposit_reversal(hash)}
66
+ #Test
67
+ assert(exception.message =~ /Error validating xml data against the schema/)
68
+ end
56
69
  end
57
- end
58
70
  end
@@ -31,6 +31,7 @@ module LitleOnline
31
31
  hash = {
32
32
  'merchantId' => '101',
33
33
  'version'=>'8.8',
34
+ 'id'=>'test',
34
35
  'reportGroup'=>'Planets',
35
36
  'litleTxnId'=>'123456789101112',
36
37
  'amount'=>'12'
@@ -43,25 +44,27 @@ module LitleOnline
43
44
  hash = {
44
45
  'merchantId' => '101',
45
46
  'version'=>'8.8',
47
+ 'id'=>'test',
46
48
  'reportGroup'=>'Planets',
47
49
  }
48
50
  #Get exceptions
49
51
  exception = assert_raise(RuntimeError){LitleOnlineRequest.new.echeck_credit(hash)}
50
52
  #Test
51
- assert(exception.message =~ /The content of element 'echeckCredit' is not complete/)
53
+ assert(exception.message =~ /Error validating xml data against the schema/)
52
54
  end
53
55
 
54
56
  def test_echeck_credit_with_echeck
55
57
  hash = {
56
58
  'merchantId' => '101',
57
59
  'version'=>'8.8',
60
+ 'id'=>'test',
58
61
  'reportGroup'=>'Planets',
59
62
  'amount'=>'123456',
60
63
  'verify'=>'true',
61
64
  'orderId'=>'12345',
62
65
  'orderSource'=>'ecommerce',
63
66
  'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
64
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'}
67
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
65
68
  }
66
69
  response= LitleOnlineRequest.new.echeck_credit(hash)
67
70
  assert_equal('Valid Format', response.message)
@@ -71,13 +74,14 @@ module LitleOnline
71
74
  hash = {
72
75
  'merchantId' => '101',
73
76
  'version'=>'8.8',
77
+ 'id'=>'test',
74
78
  'reportGroup'=>'Planets',
75
79
  'amount'=>'123456',
76
80
  'verify'=>'true',
77
81
  'orderId'=>'12345',
78
82
  'orderSource'=>'ecommerce',
79
83
  'echeckToken' => {'accType'=>'Checking','litleToken'=>'1234565789012','routingNum'=>'123456789','checkNum'=>'123455'},
80
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'}
84
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
81
85
  }
82
86
  response= LitleOnlineRequest.new.echeck_credit(hash)
83
87
  assert_equal('Valid Format', response.message)
@@ -87,6 +91,7 @@ module LitleOnline
87
91
  hash = {
88
92
  'merchantId' => '101',
89
93
  'version'=>'8.8',
94
+ 'id'=>'test',
90
95
  'reportGroup'=>'Planets',
91
96
  'amount'=>'123',
92
97
  'invalidfield'=>'nonexistant',
@@ -94,7 +99,7 @@ module LitleOnline
94
99
  'verify'=>'true',
95
100
  'orderId'=>'12345',
96
101
  'orderSource'=>'ecommerce',
97
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'}
102
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
98
103
  }
99
104
  response= LitleOnlineRequest.new.echeck_credit(hash)
100
105
  assert_equal('Valid Format', response.message)
@@ -104,6 +109,7 @@ module LitleOnline
104
109
  hash = {
105
110
  'merchantId' => '101',
106
111
  'version'=>'8.8',
112
+ 'id'=>'test',
107
113
  'reportGroup'=>'Planets',
108
114
  'amount'=>'123',
109
115
  'invalidfield'=>'nonexistant',
@@ -115,13 +121,14 @@ module LitleOnline
115
121
  #Get exceptions
116
122
  exception = assert_raise(RuntimeError){LitleOnlineRequest.new.echeck_credit(hash)}
117
123
  #Test
118
- assert(exception.message =~ /Error validating xml data against the schema/)
124
+ assert(exception.message =~ /Error validating xml data against the schema/)
119
125
  end
120
126
 
121
127
  def test_echeck_credit_with_secondaryAmount
122
128
  hash = {
123
129
  'merchantId' => '101',
124
130
  'version'=>'8.8',
131
+ 'id'=>'test',
125
132
  'reportGroup'=>'Planets',
126
133
  'amount'=>'123456',
127
134
  'secondaryAmount'=>'50',
@@ -129,7 +136,7 @@ module LitleOnline
129
136
  'orderId'=>'12345',
130
137
  'orderSource'=>'ecommerce',
131
138
  'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
132
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'}
139
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
133
140
  }
134
141
  response= LitleOnlineRequest.new.echeck_credit(hash)
135
142
  assert_equal('Valid Format', response.message)
@@ -139,6 +146,7 @@ module LitleOnline
139
146
  hash = {
140
147
  'merchantId' => '101',
141
148
  'version'=>'8.8',
149
+ 'id'=>'test',
142
150
  'reportGroup'=>'Planets',
143
151
  'litleTxnId'=>'123456789101112',
144
152
  'amount'=>'12',
@@ -147,5 +155,25 @@ module LitleOnline
147
155
  response= LitleOnlineRequest.new.echeck_credit(hash)
148
156
  assert_equal('Valid Format', response.message)
149
157
  end
158
+
159
+ def test_echeck_credit_with_customIdentifier
160
+ hash = {
161
+ 'merchantId' => '101',
162
+ 'version'=>'8.8',
163
+ 'id'=>'test',
164
+ 'reportGroup'=>'Planets',
165
+ 'amount'=>'123456',
166
+ 'verify'=>'true',
167
+ 'orderId'=>'12345',
168
+ 'orderSource'=>'ecommerce',
169
+ 'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
170
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'},
171
+ 'shipToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'},
172
+ 'merchantData'=>{'campaign'=>'camping'},
173
+ 'customIdentifier' =>'identifier',
174
+ }
175
+ response= LitleOnlineRequest.new.echeck_credit(hash)
176
+ assert_equal('Valid Format', response.message)
177
+ end
150
178
  end
151
179
  end
@@ -31,6 +31,7 @@ module LitleOnline
31
31
  hash = {
32
32
  'merchantId' => '101',
33
33
  'version'=>'8.8',
34
+ 'id'=>'test',
34
35
  'reportGroup'=>'Planets',
35
36
  'litleTxnId'=>'123456'
36
37
  }
@@ -42,6 +43,7 @@ module LitleOnline
42
43
  hash = {
43
44
  'merchantId' => '101',
44
45
  'version'=>'8.8',
46
+ 'id'=>'test',
45
47
  'reportGroup'=>'Planets',
46
48
  'litleTxnId'=>'123456',
47
49
  'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'}
@@ -54,9 +56,11 @@ module LitleOnline
54
56
  hash = {
55
57
  'merchantId' => '101',
56
58
  'version'=>'8.8',
59
+ 'id'=>'test',
57
60
  'reportGroup'=>'Planets',
58
61
  'litleTxnId'=>'123456',
59
- 'echeckToken' => {'accType'=>'Checking','litleToken'=>'1234565789012','routingNum'=>'123456789','checkNum'=>'123455'}
62
+ 'echeckToken' => {'accType'=>'Checking','litleToken'=>'1234565789012','routingNum'=>'123456789','checkNum'=>'123455'},
63
+
60
64
  }
61
65
  response= LitleOnlineRequest.new.echeck_redeposit(hash)
62
66
  assert_equal('Valid Format', response.message)
@@ -66,6 +70,7 @@ module LitleOnline
66
70
  hash = {
67
71
  'merchantId' => '101',
68
72
  'version'=>'8.8',
73
+ 'id'=>'test',
69
74
  'reportGroup'=>'Planets',
70
75
  'invalidfield'=>'nonexistant',
71
76
  'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
@@ -84,7 +89,29 @@ module LitleOnline
84
89
  #Get exceptions
85
90
  exception = assert_raise(RuntimeError){LitleOnlineRequest.new.echeck_redeposit(hash)}
86
91
  #Test
87
- assert(exception.message =~ /Error validating xml data against the schema/)
92
+ assert(exception.message =~ /Error validating xml data against the schema/)
88
93
  end
94
+
95
+ def test_echeck_Redeposit_with_customIdentifier
96
+ hash = {
97
+ 'merchantId' => '101',
98
+ 'version'=>'8.8',
99
+ 'id'=>'test',
100
+ 'reportGroup'=>'Planets',
101
+ 'amount'=>'123456',
102
+ 'verify'=>'true',
103
+ 'orderId'=>'12345',
104
+ 'litleTxnId'=>'123456',
105
+ 'orderSource'=>'ecommerce',
106
+ 'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
107
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'},
108
+ 'shipToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'},
109
+ 'merchantData'=>{'campaign'=>'camping'},
110
+ 'customIdentifier' =>'identifier',
111
+ }
112
+ response= LitleOnlineRequest.new.echeck_redeposit(hash)
113
+ assert_equal('Valid Format', response.message)
114
+ end
115
+
89
116
  end
90
117
  end
@@ -27,11 +27,28 @@ require 'test/unit'
27
27
 
28
28
  module LitleOnline
29
29
  class Test_echeckSale < Test::Unit::TestCase
30
+ def test_echeck_sale_with_echeck
31
+ hash = {
32
+ 'merchantId' => '101',
33
+ 'version'=>'8.8',
34
+ 'id'=>'test',
35
+ 'reportGroup'=>'Planets',
36
+ 'amount'=>'123456',
37
+ 'verify'=>'true',
38
+ 'orderId'=>'12345',
39
+ 'orderSource'=>'ecommerce',
40
+ 'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
41
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
42
+ }
43
+ response= LitleOnlineRequest.new.echeck_sale(hash)
44
+ assert_equal('Valid Format', response.message)
45
+ end
30
46
 
31
47
  def test_no_amount
32
48
  hash = {
33
49
  'merchantId' => '101',
34
50
  'version'=>'8.8',
51
+ 'id'=>'test',
35
52
  'reportGroup'=>'Planets'
36
53
  }
37
54
  #Get exceptions
@@ -40,17 +57,18 @@ module LitleOnline
40
57
  assert(exception.message =~ /The content of element 'echeckSale' is not complete/)
41
58
  end
42
59
 
43
- def test_echeck_sale_with_echeck
60
+ def test_echeck_sale_with_echeck1
44
61
  hash = {
45
62
  'merchantId' => '101',
46
63
  'version'=>'8.8',
64
+ 'id'=>'test',
47
65
  'reportGroup'=>'Planets',
48
66
  'amount'=>'123456',
49
67
  'verify'=>'true',
50
68
  'orderId'=>'12345',
51
69
  'orderSource'=>'ecommerce',
52
70
  'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
53
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'}
71
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
54
72
  }
55
73
  response= LitleOnlineRequest.new.echeck_sale(hash)
56
74
  assert_equal('Valid Format', response.message)
@@ -60,14 +78,15 @@ module LitleOnline
60
78
  hash = {
61
79
  'merchantId' => '101',
62
80
  'version'=>'8.8',
81
+ 'id'=>'test',
63
82
  'reportGroup'=>'Planets',
64
83
  'amount'=>'123456',
65
84
  'verify'=>'true',
66
85
  'orderId'=>'12345',
67
86
  'orderSource'=>'ecommerce',
68
87
  'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
69
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'},
70
- 'shipToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'}
88
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'},
89
+ 'shipToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
71
90
  }
72
91
  response= LitleOnlineRequest.new.echeck_sale(hash)
73
92
  assert_equal('Valid Format', response.message)
@@ -77,6 +96,7 @@ module LitleOnline
77
96
  hash = {
78
97
  'merchantId' => '101',
79
98
  'version'=>'8.8',
99
+ 'id'=>'test',
80
100
  'reportGroup'=>'Planets',
81
101
  'amount'=>'123456',
82
102
  'verify'=>'true',
@@ -84,7 +104,7 @@ module LitleOnline
84
104
  'orderSource'=>'ecommerce',
85
105
  'echeckToken' => {'accType'=>'Checking','litleToken'=>'1234565789012','routingNum'=>'123456789','checkNum'=>'123455'},
86
106
  'customBilling'=>{'phone'=>'123456789','descriptor'=>'good'},
87
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'}
107
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
88
108
  }
89
109
  response= LitleOnlineRequest.new.echeck_sale(hash)
90
110
  assert_equal('Valid Format', response.message)
@@ -94,6 +114,7 @@ module LitleOnline
94
114
  hash = {
95
115
  'merchantId' => '101',
96
116
  'version'=>'8.8',
117
+ 'id'=>'test',
97
118
  'reportGroup'=>'Planets',
98
119
  'amount'=>'123',
99
120
  'invalidfield'=>'nonexistant',
@@ -101,7 +122,7 @@ module LitleOnline
101
122
  'verify'=>'true',
102
123
  'orderId'=>'12345',
103
124
  'orderSource'=>'ecommerce',
104
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'}
125
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
105
126
  }
106
127
  response= LitleOnlineRequest.new.echeck_sale(hash)
107
128
  assert_equal('Valid Format', response.message)
@@ -111,6 +132,7 @@ module LitleOnline
111
132
  hash = {
112
133
  'merchantId' => '101',
113
134
  'version'=>'8.8',
135
+ 'id'=>'test',
114
136
  'reportGroup'=>'Planets',
115
137
  'amount'=>'123',
116
138
  'invalidfield'=>'nonexistant',
@@ -122,14 +144,20 @@ module LitleOnline
122
144
  #Get exceptions
123
145
  exception = assert_raise(RuntimeError){LitleOnlineRequest.new.echeck_sale(hash)}
124
146
  #Test
125
- assert(exception.message =~ /Error validating xml data against the schema/)
147
+ assert(exception.message =~ /Error validating xml data against the schema/)
126
148
  end
127
149
 
128
150
  def test_simple_echeck_sale
129
151
  hash = {
130
152
  'reportGroup'=>'Planets',
153
+ 'id'=>'test',
131
154
  'litleTxnId'=>'123456789101112',
132
- 'amount'=>'12'
155
+ 'orderId'=>'12345',
156
+ 'amount'=>'12',
157
+ 'orderSource'=>'ecommerce',
158
+ 'echeckToken' => {'accType'=>'Checking','litleToken'=>'1234565789012','routingNum'=>'123456789','checkNum'=>'123455'},
159
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'},
160
+ 'shipToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
133
161
  }
134
162
  response= LitleOnlineRequest.new.echeck_sale(hash)
135
163
  assert_equal('Valid Format', response.message)
@@ -138,8 +166,14 @@ module LitleOnline
138
166
  def test_simple_echeck_sale_with_custom_billing
139
167
  hash = {
140
168
  'reportGroup'=>'Planets',
169
+ 'id'=>'test',
141
170
  'litleTxnId'=>'123456',
171
+ 'orderId'=>'12345',
142
172
  'amount'=>'10',
173
+ 'orderSource'=>'ecommerce',
174
+ 'echeckToken' => {'accType'=>'Checking','litleToken'=>'1234565789012','routingNum'=>'123456789','checkNum'=>'123455'},
175
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'},
176
+ 'shipToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
143
177
  }
144
178
  response= LitleOnlineRequest.new.echeck_sale(hash)
145
179
  assert_equal('Valid Format', response.message)
@@ -149,6 +183,7 @@ module LitleOnline
149
183
  hash = {
150
184
  'merchantId' => '101',
151
185
  'version'=>'8.8',
186
+ 'id'=>'test',
152
187
  'reportGroup'=>'Planets',
153
188
  'amount'=>'123456',
154
189
  'secondaryAmount'=>'50',
@@ -156,7 +191,7 @@ module LitleOnline
156
191
  'orderId'=>'12345',
157
192
  'orderSource'=>'ecommerce',
158
193
  'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455','ccdPaymentInformation'=>'12345678901234567890123456789012345678901234567890123456789012345678901234567890'},
159
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'}
194
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
160
195
  }
161
196
  response= LitleOnlineRequest.new.echeck_sale(hash)
162
197
  assert_equal('Valid Format', response.message)
@@ -166,6 +201,7 @@ module LitleOnline
166
201
  hash = {
167
202
  'merchantId' => '101',
168
203
  'version'=>'8.8',
204
+ 'id'=>'test',
169
205
  'reportGroup'=>'Planets',
170
206
  'amount'=>'123456',
171
207
  'secondaryAmount'=>'50',
@@ -173,7 +209,7 @@ module LitleOnline
173
209
  'orderId'=>'12345',
174
210
  'orderSource'=>'ecommerce',
175
211
  'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455','ccdPaymentInformation'=>'123456789012345678901234567890123456789012345678901234567890123456789012345678901'},
176
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'}
212
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
177
213
  }
178
214
  assert_raises RuntimeError do
179
215
  response= LitleOnlineRequest.new.echeck_sale(hash)
@@ -184,6 +220,7 @@ module LitleOnline
184
220
  def test_echeck_sale_with_txnId_secondaryAmount
185
221
  hash = {
186
222
  'reportGroup'=>'Planets',
223
+ 'id'=>'test',
187
224
  'litleTxnId'=>'123456789101112',
188
225
  'amount'=>'12',
189
226
  'secondaryAmount'=>'50'
@@ -191,7 +228,27 @@ module LitleOnline
191
228
  #Get exceptions
192
229
  exception = assert_raise(RuntimeError){LitleOnlineRequest.new.echeck_sale(hash)}
193
230
  #Test
194
- assert(exception.message =~ /Error validating xml data against the schema/)
231
+ assert(exception.message =~ /Error validating xml data against the schema/)
232
+ end
233
+
234
+ def test_echeck_sale_with_customIdentifier
235
+ hash = {
236
+ 'merchantId' => '101',
237
+ 'version'=>'8.8',
238
+ 'id'=>'test',
239
+ 'reportGroup'=>'Planets',
240
+ 'amount'=>'123456',
241
+ 'verify'=>'true',
242
+ 'orderId'=>'12345',
243
+ 'orderSource'=>'ecommerce',
244
+ 'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
245
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'},
246
+ 'shipToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'},
247
+ 'merchantData'=>{'campaign'=>'camping'},
248
+ 'customIdentifier' =>'identifier',
249
+ }
250
+ response= LitleOnlineRequest.new.echeck_sale(hash)
251
+ assert_equal('Valid Format', response.message)
195
252
  end
196
253
 
197
254
  end