CnpOnline 8.31.1 → 9.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +29 -12
  3. data/DESCRIPTION +2 -2
  4. data/LICENSE +1 -1
  5. data/README.md +1 -1
  6. data/Rakefile +4 -4
  7. data/Rakefile~ +5 -5
  8. data/SETUP.md +3 -3
  9. data/bin/Setup.rb +9 -8
  10. data/bin/sample_batch_driver.rb +1 -1
  11. data/bin/sample_driver.rb +1 -1
  12. data/lib/Communications.rb +1 -1
  13. data/lib/Configuration.rb +16 -16
  14. data/lib/EnvironmentVariables.rb +1 -2
  15. data/lib/LitleBatchRequest.rb +283 -147
  16. data/lib/LitleListeners.rb +132 -33
  17. data/lib/LitleOnline.rb +5 -4
  18. data/lib/LitleOnlineRequest.rb +69 -59
  19. data/lib/LitleRequest.rb +178 -141
  20. data/lib/LitleTransaction.rb +279 -122
  21. data/lib/LitleXmlMapper.rb +9 -4
  22. data/lib/XMLFields.rb +345 -26
  23. data/test/certification/certTest1_base.rb +74 -73
  24. data/test/certification/certTest2_authenhanced.rb +1 -1
  25. data/test/certification/certTest3_authreversal.rb +1 -1
  26. data/test/certification/certTest4_echeck.rb +4 -1
  27. data/test/certification/certTest5_token.rb +4 -4
  28. data/test/certification/certTest_batchAll.rb +296 -55
  29. data/test/certification/ts_all.rb +1 -1
  30. data/test/functional/test_activate.rb +7 -3
  31. data/test/functional/test_activateReversal.rb +7 -3
  32. data/test/functional/test_auth.rb +119 -16
  33. data/test/functional/test_authReversal.rb +5 -3
  34. data/test/functional/test_balanceInquiry.rb +5 -3
  35. data/test/functional/test_batch.rb +3 -3
  36. data/test/functional/test_batchStream.rb +14 -4
  37. data/test/functional/test_cancelSubscription.rb +5 -3
  38. data/test/functional/test_capture.rb +34 -3
  39. data/test/functional/test_captureGivenAuth.rb +55 -4
  40. data/test/functional/test_configuration.rb +2 -2
  41. data/test/functional/test_createPlan.rb +5 -3
  42. data/test/functional/test_credit.rb +45 -16
  43. data/test/functional/test_deactivate.rb +5 -3
  44. data/test/functional/test_deactivateReversal.rb +5 -3
  45. data/test/functional/test_depositReversal.rb +5 -3
  46. data/test/functional/test_echeckCredit.rb +26 -9
  47. data/test/functional/test_echeckRedeposit.rb +5 -3
  48. data/test/functional/test_echeckSale.rb +49 -28
  49. data/test/functional/test_echeckVerification.rb +20 -12
  50. data/test/functional/test_echeckVoid.rb +1 -1
  51. data/test/functional/test_forceCapture.rb +44 -22
  52. data/test/functional/test_fraudCheck.rb +77 -0
  53. data/test/functional/test_litle_requests.rb +24 -24
  54. data/test/functional/test_load.rb +5 -3
  55. data/test/functional/test_loadReversal.rb +5 -3
  56. data/test/functional/test_refundReversal.rb +5 -3
  57. data/test/functional/test_sale.rb +214 -29
  58. data/test/functional/test_token.rb +19 -3
  59. data/test/functional/test_unload.rb +5 -3
  60. data/test/functional/test_unloadReversal.rb +6 -4
  61. data/test/functional/test_updateCardValidationNumOnToken.rb +1 -1
  62. data/test/functional/test_updatePlan.rb +5 -3
  63. data/test/functional/test_updateSubscription.rb +5 -3
  64. data/test/functional/test_utf8.rb +44 -0
  65. data/test/functional/test_xmlfields.rb +10 -6
  66. data/test/functional/ts_all.rb +2 -1
  67. data/test/unit/test_LitleAUBatch.rb +29 -1
  68. data/test/unit/test_LitleBatchRequest.rb +247 -113
  69. data/test/unit/test_LitleOnlineRequest.rb +37 -54
  70. data/test/unit/test_LitleRequest.rb +3 -3
  71. data/test/unit/test_LitleTransaction.rb +5 -5
  72. data/test/unit/test_LitleXmlMapper.rb +136 -0
  73. data/test/unit/test_activate.rb +1 -21
  74. data/test/unit/test_activateReversal.rb +1 -1
  75. data/test/unit/test_auth.rb +54 -14
  76. data/test/unit/test_authReversal.rb +1 -1
  77. data/test/unit/test_balanceInquiry.rb +1 -1
  78. data/test/unit/test_cancelSubscription.rb +1 -1
  79. data/test/unit/test_capture.rb +27 -1
  80. data/test/unit/test_captureGivenAuth.rb +44 -18
  81. data/test/unit/test_createPlan.rb +1 -1
  82. data/test/unit/test_credit.rb +16 -3
  83. data/test/unit/test_deactivate.rb +1 -1
  84. data/test/unit/test_deactivateReversal.rb +1 -1
  85. data/test/unit/test_depositReversal.rb +1 -1
  86. data/test/unit/test_echeckCredit.rb +15 -2
  87. data/test/unit/test_echeckRedeposit.rb +1 -1
  88. data/test/unit/test_echeckSale.rb +18 -1
  89. data/test/unit/test_echeckVerification.rb +1 -1
  90. data/test/unit/test_echeckVoid.rb +1 -1
  91. data/test/unit/test_forceCapture.rb +20 -2
  92. data/test/unit/test_fraudCheck.rb +45 -0
  93. data/test/unit/test_load.rb +1 -1
  94. data/test/unit/test_loadReversal.rb +1 -1
  95. data/test/unit/test_refundReversal.rb +1 -1
  96. data/test/unit/test_sale.rb +73 -7
  97. data/test/unit/test_token.rb +15 -4
  98. data/test/unit/test_unload.rb +1 -1
  99. data/test/unit/test_unloadReversal.rb +1 -1
  100. data/test/unit/test_updateCardValidationNumOnToken.rb +1 -1
  101. data/test/unit/test_updatePlan.rb +1 -1
  102. data/test/unit/test_updateSubscription.rb +1 -1
  103. data/test/unit/test_xmlfields.rb +1 -1
  104. data/test/unit/ts_unit.rb +2 -1
  105. metadata +10 -7
  106. data/CHANGELOG~ +0 -142
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2012 Litle & Co.
2
+ Copyright (c) 2017 Vantiv eCommerce
3
3
  Permission is hereby granted, free of charge, to any person
4
4
  obtaining a copy of this software and associated documentation
5
5
  files (the "Software"), to deal in the Software without
@@ -73,7 +73,7 @@ module LitleOnline
73
73
  assert_equal('fire is comming',@config_hash['sftp_password'])
74
74
  assert_equal('prelive.litle.com',@config_hash['fast_url'])
75
75
  assert_equal('15000',@config_hash['fast_port'])
76
- ENV['litle_user']=nil
76
+ ENV['litle_user']=nil
77
77
  ENV['litle_password']=nil
78
78
  ENV['litle_currency_merchant_map']=nil
79
79
  ENV['litle_url']=nil
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2012 Litle & Co.
2
+ Copyright (c) 2017 Vantiv eCommerce
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,8 +78,10 @@ def test_simple_happy
78
78
  'intervalType'=>'ANNUAL',
79
79
  }
80
80
 
81
- response= LitleOnlineRequest.new.create_plan(hash)
82
- assert(response.message =~ /Error validating xml data against the schema/)
81
+ #Get exceptions
82
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.create_plan(hash)}
83
+ #Test
84
+ assert(exception.message =~ /Error validating xml data against the schema/)
83
85
  end
84
86
  end
85
87
  end
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2012 Litle & Co.
2
+ Copyright (c) 2017 Vantiv eCommerce
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
@@ -61,21 +61,34 @@ module LitleOnline
61
61
  end
62
62
 
63
63
  def test_simple_credit_with_secondaryAmount
64
- hash = {
65
- 'merchantId' => '101',
66
- 'version'=>'8.8',
67
- 'reportGroup'=>'Planets',
68
- 'amount'=>'106',
69
- 'secondaryAmount'=>'50',
70
- 'orderId'=>'123456',
71
- 'orderSource'=>'ecommerce',
72
- 'paypal'=>{
73
- 'payerId'=>'1234',
74
- 'transactionId'=>'1234',
75
- }}
76
- response= LitleOnlineRequest.new.credit(hash)
77
- assert_equal('Valid Format', response.message)
78
- end
64
+ hash = {
65
+ 'merchantId' => '101',
66
+ 'version'=>'8.8',
67
+ 'reportGroup'=>'Planets',
68
+ 'amount'=>'106',
69
+ 'secondaryAmount'=>'50',
70
+ 'orderId'=>'123456',
71
+ 'orderSource'=>'ecommerce',
72
+ 'paypal'=>{
73
+ 'payerId'=>'1234',
74
+ 'transactionId'=>'1234',
75
+ }}
76
+ response= LitleOnlineRequest.new.credit(hash)
77
+ assert_equal('Valid Format', response.message)
78
+ end
79
+
80
+ def test_credit_with_TxnID_secondaryAmount
81
+ hash = {
82
+ 'merchantId' => '101',
83
+ 'version'=>'8.8',
84
+ 'reportGroup'=>'Planets',
85
+ 'amount'=>'106',
86
+ 'secondaryAmount'=>'50',
87
+ 'litleTxnId'=>'123456'
88
+ }
89
+ response= LitleOnlineRequest.new.credit(hash)
90
+ assert_equal('Valid Format', response.message)
91
+ end
79
92
 
80
93
  def test_fields_out_of_order
81
94
  hash = {
@@ -170,5 +183,21 @@ module LitleOnline
170
183
  response= LitleOnlineRequest.new.credit(hash)
171
184
  assert_equal('Valid Format', response.message)
172
185
  end
186
+
187
+ def test_simple_credit_with_pin
188
+ hash = {
189
+ 'merchantId' => '101',
190
+ 'version'=>'8.8',
191
+ 'reportGroup'=>'Planets',
192
+ 'amount'=>'106',
193
+ 'secondaryAmount'=>'20',
194
+ 'litleTxnId'=>'1234',
195
+ 'pin'=>'3333'
196
+ }
197
+ response= LitleOnlineRequest.new.credit(hash)
198
+ assert_equal('Valid Format', response.message)
199
+ assert_equal('000', response.creditResponse.response)
200
+ end
201
+
173
202
  end
174
203
  end
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2012 Litle & Co.
2
+ Copyright (c) 2017 Vantiv eCommerce
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
@@ -73,8 +73,10 @@ def test_simple_happy
73
73
  'amount' =>'500',
74
74
  }
75
75
 
76
- response= LitleOnlineRequest.new.deactivate(hash)
77
- assert(response.message =~ /Error validating xml data against the schema/)
76
+ #Get exceptions
77
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.deactivate(hash)}
78
+ #Test
79
+ assert(exception.message =~ /Error validating xml data against the schema/)
78
80
  end
79
81
  end
80
82
  end
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2012 Litle & Co.
2
+ Copyright (c) 2017 Vantiv eCommerce
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
@@ -49,8 +49,10 @@ def test_simple
49
49
  'reportGroup'=>'Planets',
50
50
  }
51
51
 
52
- response= LitleOnlineRequest.new.deactivate_reversal(hash)
53
- assert(response.message =~ /Error validating xml data against the schema/)
52
+ #Get exceptions
53
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.deactivate_reversal(hash)}
54
+ #Test
55
+ assert(exception.message =~ /Error validating xml data against the schema/)
54
56
  end
55
57
  end
56
58
  end
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2012 Litle & Co.
2
+ Copyright (c) 2017 Vantiv eCommerce
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
@@ -49,8 +49,10 @@ def test_simple
49
49
  'reportGroup'=>'Planets',
50
50
  }
51
51
 
52
- response= LitleOnlineRequest.new.deposit_reversal(hash)
53
- assert(response.message =~ /Error validating xml data against the schema/)
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/)
54
56
  end
55
57
  end
56
58
  end
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2012 Litle & Co.
2
+ Copyright (c) 2017 Vantiv eCommerce
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
@@ -45,8 +45,10 @@ module LitleOnline
45
45
  'version'=>'8.8',
46
46
  'reportGroup'=>'Planets',
47
47
  }
48
- response = LitleOnlineRequest.new.echeck_credit(hash)
49
- assert_match /The content of element 'echeckCredit' is not complete/, response.message
48
+ #Get exceptions
49
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.echeck_credit(hash)}
50
+ #Test
51
+ assert(exception.message =~ /The content of element 'echeckCredit' is not complete/)
50
52
  end
51
53
 
52
54
  def test_echeck_credit_with_echeck
@@ -59,7 +61,7 @@ module LitleOnline
59
61
  'orderId'=>'12345',
60
62
  'orderSource'=>'ecommerce',
61
63
  'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
62
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
64
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'}
63
65
  }
64
66
  response= LitleOnlineRequest.new.echeck_credit(hash)
65
67
  assert_equal('Valid Format', response.message)
@@ -75,7 +77,7 @@ module LitleOnline
75
77
  'orderId'=>'12345',
76
78
  'orderSource'=>'ecommerce',
77
79
  'echeckToken' => {'accType'=>'Checking','litleToken'=>'1234565789012','routingNum'=>'123456789','checkNum'=>'123455'},
78
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
80
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'}
79
81
  }
80
82
  response= LitleOnlineRequest.new.echeck_credit(hash)
81
83
  assert_equal('Valid Format', response.message)
@@ -92,7 +94,7 @@ module LitleOnline
92
94
  'verify'=>'true',
93
95
  'orderId'=>'12345',
94
96
  'orderSource'=>'ecommerce',
95
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
97
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'}
96
98
  }
97
99
  response= LitleOnlineRequest.new.echeck_credit(hash)
98
100
  assert_equal('Valid Format', response.message)
@@ -110,8 +112,10 @@ module LitleOnline
110
112
  'orderId'=>'12345',
111
113
  'orderSource'=>'ecommerce',
112
114
  }
113
- response= LitleOnlineRequest.new.echeck_credit(hash)
114
- assert(response.message =~ /Error validating xml data against the schema/)
115
+ #Get exceptions
116
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.echeck_credit(hash)}
117
+ #Test
118
+ assert(exception.message =~ /Error validating xml data against the schema/)
115
119
  end
116
120
 
117
121
  def test_echeck_credit_with_secondaryAmount
@@ -125,7 +129,20 @@ module LitleOnline
125
129
  'orderId'=>'12345',
126
130
  'orderSource'=>'ecommerce',
127
131
  'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
128
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
132
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'}
133
+ }
134
+ response= LitleOnlineRequest.new.echeck_credit(hash)
135
+ assert_equal('Valid Format', response.message)
136
+ end
137
+
138
+ def test_echeck_credit_with_txnId_secondaryAmount
139
+ hash = {
140
+ 'merchantId' => '101',
141
+ 'version'=>'8.8',
142
+ 'reportGroup'=>'Planets',
143
+ 'litleTxnId'=>'123456789101112',
144
+ 'amount'=>'12',
145
+ 'secondaryAmount'=>'50'
129
146
  }
130
147
  response= LitleOnlineRequest.new.echeck_credit(hash)
131
148
  assert_equal('Valid Format', response.message)
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2012 Litle & Co.
2
+ Copyright (c) 2017 Vantiv eCommerce
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
@@ -81,8 +81,10 @@ module LitleOnline
81
81
  'version'=>'8.8',
82
82
  'reportGroup'=>'Planets',
83
83
  }
84
- response= LitleOnlineRequest.new.echeck_redeposit(hash)
85
- assert(response.message =~ /Error validating xml data against the schema/)
84
+ #Get exceptions
85
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.echeck_redeposit(hash)}
86
+ #Test
87
+ assert(exception.message =~ /Error validating xml data against the schema/)
86
88
  end
87
89
  end
88
90
  end
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2012 Litle & Co.
2
+ Copyright (c) 2017 Vantiv eCommerce
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
@@ -27,21 +27,6 @@ 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
- 'reportGroup'=>'Planets',
35
- 'amount'=>'123456',
36
- 'verify'=>'true',
37
- 'orderId'=>'12345',
38
- 'orderSource'=>'ecommerce',
39
- 'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
40
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
41
- }
42
- response= LitleOnlineRequest.new.echeck_sale(hash)
43
- assert_equal('Valid Format', response.message)
44
- end
45
30
 
46
31
  def test_no_amount
47
32
  hash = {
@@ -49,8 +34,10 @@ module LitleOnline
49
34
  'version'=>'8.8',
50
35
  'reportGroup'=>'Planets'
51
36
  }
52
- response = LitleOnlineRequest.new.echeck_sale(hash)
53
- assert_match /The content of element 'echeckSale' is not complete/, response.message
37
+ #Get exceptions
38
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.echeck_sale(hash)}
39
+ #Test
40
+ assert(exception.message =~ /The content of element 'echeckSale' is not complete/)
54
41
  end
55
42
 
56
43
  def test_echeck_sale_with_echeck
@@ -63,7 +50,7 @@ module LitleOnline
63
50
  'orderId'=>'12345',
64
51
  'orderSource'=>'ecommerce',
65
52
  'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
66
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
53
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'}
67
54
  }
68
55
  response= LitleOnlineRequest.new.echeck_sale(hash)
69
56
  assert_equal('Valid Format', response.message)
@@ -79,8 +66,8 @@ module LitleOnline
79
66
  'orderId'=>'12345',
80
67
  'orderSource'=>'ecommerce',
81
68
  'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
82
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'},
83
- 'shipToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
69
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'},
70
+ 'shipToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'}
84
71
  }
85
72
  response= LitleOnlineRequest.new.echeck_sale(hash)
86
73
  assert_equal('Valid Format', response.message)
@@ -97,7 +84,7 @@ module LitleOnline
97
84
  'orderSource'=>'ecommerce',
98
85
  'echeckToken' => {'accType'=>'Checking','litleToken'=>'1234565789012','routingNum'=>'123456789','checkNum'=>'123455'},
99
86
  'customBilling'=>{'phone'=>'123456789','descriptor'=>'good'},
100
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
87
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'}
101
88
  }
102
89
  response= LitleOnlineRequest.new.echeck_sale(hash)
103
90
  assert_equal('Valid Format', response.message)
@@ -114,7 +101,7 @@ module LitleOnline
114
101
  'verify'=>'true',
115
102
  'orderId'=>'12345',
116
103
  'orderSource'=>'ecommerce',
117
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
104
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'}
118
105
  }
119
106
  response= LitleOnlineRequest.new.echeck_sale(hash)
120
107
  assert_equal('Valid Format', response.message)
@@ -132,8 +119,10 @@ module LitleOnline
132
119
  'orderId'=>'12345',
133
120
  'orderSource'=>'ecommerce',
134
121
  }
135
- response= LitleOnlineRequest.new.echeck_sale(hash)
136
- assert(response.message =~ /Error validating xml data against the schema/)
122
+ #Get exceptions
123
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.echeck_sale(hash)}
124
+ #Test
125
+ assert(exception.message =~ /Error validating xml data against the schema/)
137
126
  end
138
127
 
139
128
  def test_simple_echeck_sale
@@ -156,7 +145,7 @@ module LitleOnline
156
145
  assert_equal('Valid Format', response.message)
157
146
  end
158
147
 
159
- def test_echeck_sale_with_secondaryAmount
148
+ def test_echeck_sale_with_secondaryAmount_ccd
160
149
  hash = {
161
150
  'merchantId' => '101',
162
151
  'version'=>'8.8',
@@ -166,12 +155,44 @@ module LitleOnline
166
155
  'verify'=>'true',
167
156
  'orderId'=>'12345',
168
157
  'orderSource'=>'ecommerce',
169
- 'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
170
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
158
+ 'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455','ccdPaymentInformation'=>'12345678901234567890123456789012345678901234567890123456789012345678901234567890'},
159
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'}
171
160
  }
172
161
  response= LitleOnlineRequest.new.echeck_sale(hash)
173
162
  assert_equal('Valid Format', response.message)
174
163
  end
164
+
165
+ def test_echeck_sale_with_secondaryAmount_ccd_longer_than_80
166
+ hash = {
167
+ 'merchantId' => '101',
168
+ 'version'=>'8.8',
169
+ 'reportGroup'=>'Planets',
170
+ 'amount'=>'123456',
171
+ 'secondaryAmount'=>'50',
172
+ 'verify'=>'true',
173
+ 'orderId'=>'12345',
174
+ 'orderSource'=>'ecommerce',
175
+ 'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455','ccdPaymentInformation'=>'123456789012345678901234567890123456789012345678901234567890123456789012345678901'},
176
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'}
177
+ }
178
+ assert_raises RuntimeError do
179
+ response= LitleOnlineRequest.new.echeck_sale(hash)
180
+ puts "validation for ccdPaymentInformation"
181
+ end
182
+ end
183
+
184
+ def test_echeck_sale_with_txnId_secondaryAmount
185
+ hash = {
186
+ 'reportGroup'=>'Planets',
187
+ 'litleTxnId'=>'123456789101112',
188
+ 'amount'=>'12',
189
+ 'secondaryAmount'=>'50'
190
+ }
191
+ #Get exceptions
192
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.echeck_sale(hash)}
193
+ #Test
194
+ assert(exception.message =~ /Error validating xml data against the schema/)
195
+ end
175
196
 
176
197
  end
177
198
  end
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2012 Litle & Co.
2
+ Copyright (c) 2017 Vantiv eCommerce
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
@@ -37,7 +37,7 @@ module LitleOnline
37
37
  'orderId'=>'12345',
38
38
  'orderSource'=>'ecommerce',
39
39
  'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
40
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
40
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'}
41
41
  }
42
42
  response= LitleOnlineRequest.new.echeck_verification(hash)
43
43
  assert_equal('Valid Format', response.message)
@@ -52,7 +52,7 @@ module LitleOnline
52
52
  'orderId'=>'12345',
53
53
  'orderSource'=>'ecommerce',
54
54
  'echeckToken' => {'accType'=>'Checking','litleToken'=>'1234565789012','routingNum'=>'123456789','checkNum'=>'123455'},
55
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
55
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'}
56
56
  }
57
57
  response= LitleOnlineRequest.new.echeck_verification(hash)
58
58
  assert_equal('Valid Format', response.message)
@@ -68,7 +68,7 @@ module LitleOnline
68
68
  'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
69
69
  'orderId'=>'12345',
70
70
  'orderSource'=>'ecommerce',
71
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
71
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'}
72
72
  }
73
73
  response= LitleOnlineRequest.new.echeck_verification(hash)
74
74
  assert_equal('Valid Format', response.message)
@@ -85,8 +85,10 @@ module LitleOnline
85
85
  'orderId'=>'12345',
86
86
  'orderSource'=>'ecommerce',
87
87
  }
88
- response= LitleOnlineRequest.new.echeck_verification(hash)
89
- assert(response.message =~ /Error validating xml data against the schema/)
88
+ #Get exceptions
89
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.echeck_verification(hash)}
90
+ #Test
91
+ assert(exception.message =~ /Error validating xml data against the schema/)
90
92
  end
91
93
 
92
94
  def test_no_amount
@@ -96,8 +98,10 @@ module LitleOnline
96
98
  'reportGroup'=>'Planets',
97
99
  'orderId'=>'12345'
98
100
  }
99
- response= LitleOnlineRequest.new.echeck_verification(hash)
100
- assert(response.message =~ /Error validating xml data against the schema/)
101
+ #Get exceptions
102
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.echeck_verification(hash)}
103
+ #Test
104
+ assert(exception.message =~ /Error validating xml data against the schema/)
101
105
  end
102
106
 
103
107
  def test_no_order_id
@@ -106,8 +110,10 @@ module LitleOnline
106
110
  'version'=>'8.8',
107
111
  'reportGroup'=>'Planets',
108
112
  }
109
- response= LitleOnlineRequest.new.echeck_verification(hash)
110
- assert(response.message =~ /Error validating xml data against the schema/)
113
+ #Get exceptions
114
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.echeck_verification(hash)}
115
+ #Test
116
+ assert(exception.message =~ /Error validating xml data against the schema/)
111
117
  end
112
118
 
113
119
  def test_no_order_source
@@ -118,8 +124,10 @@ module LitleOnline
118
124
  'amount'=>'123456',
119
125
  'orderId'=>'12345'
120
126
  }
121
- response= LitleOnlineRequest.new.echeck_verification(hash)
122
- assert(response.message =~ /Error validating xml data against the schema/)
127
+ #Get exceptions
128
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.echeck_verification(hash)}
129
+ #Test
130
+ assert(exception.message =~ /Error validating xml data against the schema/)
123
131
  end
124
132
 
125
133
  end