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
@@ -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'=>'12345678000',
36
37
  'amount'=>'106',
@@ -44,6 +45,7 @@ module LitleOnline
44
45
  hash = {
45
46
  'merchantId' => '101',
46
47
  'version'=>'8.8',
48
+ 'id'=>'test',
47
49
  'litleTxnId'=>'12345000',
48
50
  'payPalNotes'=>'Notes',
49
51
  'amount'=>'106',
@@ -57,6 +59,7 @@ module LitleOnline
57
59
  hash = {
58
60
  'merchantId' => '101',
59
61
  'version'=>'8.8',
62
+ 'id'=>'test',
60
63
  'reportGroup'=>'12345678',
61
64
  'amount'=>'106',
62
65
  'payPalNotes'=>'Notes'
@@ -64,7 +67,7 @@ module LitleOnline
64
67
  #Get exceptions
65
68
  exception = assert_raise(RuntimeError){LitleOnlineRequest.new.auth_reversal(hash)}
66
69
  #Test
67
- assert(exception.message =~ /Error validating xml data against the schema/)
70
+ assert(exception.message =~ /Error validating xml data against the schema/)
68
71
  end
69
72
 
70
73
  end
@@ -33,11 +33,12 @@ def test_simple_happy
33
33
  hash = {
34
34
  'merchantId' => '101',
35
35
  'version'=>'8.8',
36
+ 'id'=>'test',
36
37
  'reportGroup'=>'Planets',
37
38
  'orderId' =>'1001',
38
39
  'orderSource' =>'ecommerce',
39
40
  'card'=>{
40
- 'type'=>'VI',
41
+ 'type'=>'GC',
41
42
  'number' =>'4100000000000001',
42
43
  'expDate' =>'1210'
43
44
  }
@@ -51,11 +52,12 @@ def test_simple_happy
51
52
  hash = {
52
53
  'merchantId' => '101',
53
54
  'version'=>'8.8',
55
+ 'id'=>'test',
54
56
  'reportGroup'=>'Planets',
55
57
  'orderSource' =>'ecommerce',
56
58
  'orderId' =>'1001',
57
59
  'card'=>{
58
- 'type'=>'VI',
60
+ 'type'=>'GC',
59
61
  'number' =>'4100000000000001',
60
62
  'expDate' =>'1210'
61
63
  }
@@ -76,7 +78,30 @@ def test_simple_happy
76
78
  #Get exceptions
77
79
  exception = assert_raise(RuntimeError){LitleOnlineRequest.new.balance_inquiry(hash)}
78
80
  #Test
79
- assert(exception.message =~ /Error validating xml data against the schema/)
81
+ assert(exception.message =~ /Error validating xml data against the schema/)
80
82
  end
83
+
84
+ def test_GiftCardCardType_NotPresent
85
+ hash = {
86
+ 'merchantId' => '101',
87
+ 'version'=>'8.8',
88
+ 'id' =>'test',
89
+ 'reportGroup'=>'Planets',
90
+ 'amount' =>'500',
91
+ 'orderId' =>'1001',
92
+ 'orderSource' =>'ecommerce',
93
+ 'card'=>{
94
+ 'type'=>'VI',
95
+ 'number' =>'4100000000000001',
96
+ 'expDate' =>'1210'
97
+ }
98
+ }
99
+
100
+ #Get exceptions
101
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.balance_inquiry(hash)}
102
+ #Test
103
+ assert(exception.message =~ /Error validating xml data against the schema/)
104
+ end
105
+
81
106
  end
82
107
  end
@@ -1,6 +1,5 @@
1
1
  =begin
2
2
  Copyright (c) 2017 Vantiv eCommerce
3
-
4
3
  Permission is hereby granted, free of charge, to any person
5
4
  obtaining a copy of this software and associated documentation
6
5
  files (the "Software"), to deal in the Software without
@@ -9,10 +8,8 @@ copy, modify, merge, publish, distribute, sublicense, and/or sell
9
8
  copies of the Software, and to permit persons to whom the
10
9
  Software is furnished to do so, subject to the following
11
10
  conditions:
12
-
13
11
  The above copyright notice and this permission notice shall be
14
12
  included in all copies or substantial portions of the Software.
15
-
16
13
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
14
  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
18
15
  OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -96,6 +93,7 @@ module LitleOnline
96
93
  updatePlanHash ={
97
94
  'merchantId' => '101',
98
95
  'version'=>'8.8',
96
+
99
97
  'reportGroup'=>'Planets',
100
98
  'planCode'=>'updatePlanCodeString',
101
99
  'active'=>'true'
@@ -152,4 +150,4 @@ module LitleOnline
152
150
 
153
151
  end
154
152
  end
155
- end
153
+ end
@@ -47,10 +47,10 @@ module LitleOnline
47
47
  'reportGroup'=>'Planets',
48
48
  }
49
49
 
50
- #Get exceptions
50
+ #Get exceptions
51
51
  exception = assert_raise(RuntimeError){LitleOnlineRequest.new.cancel_subscription(hash)}
52
52
  #Test
53
- assert(exception.message =~ /Error validating xml data against the schema/)
53
+ assert(exception.message =~ /Error validating xml data against the schema/)
54
54
  end
55
55
 
56
56
  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'=>'123456000',
36
37
  'amount'=>'106',
@@ -43,6 +44,7 @@ module LitleOnline
43
44
  hash = {
44
45
  'merchantId' => '101',
45
46
  'version'=>'8.8',
47
+ 'id'=>'test',
46
48
  'reportGroup'=>'Planets',
47
49
  'partial'=>'true',
48
50
  'litleTxnId'=>'123456000',
@@ -56,6 +58,7 @@ module LitleOnline
56
58
  hash = {
57
59
  'merchantId' => '101',
58
60
  'version'=>'8.8',
61
+ 'id'=>'test',
59
62
  'reportGroup'=>'Planets',
60
63
  'litleTxnId'=>'123456000',
61
64
  'amount'=>'106',
@@ -75,18 +78,22 @@ module LitleOnline
75
78
  'version'=>'8.8',
76
79
  'reportGroup'=>'Planets',
77
80
  'amount'=>'106',
81
+ 'pin'=>'3333'
78
82
  }
79
83
  #Get exceptions
80
84
  exception = assert_raise(RuntimeError){LitleOnlineRequest.new.capture(hash)}
81
85
  #Test
82
- assert(exception.message =~ /Error validating xml data against the schema/)
86
+ assert(exception.message =~ /Error validating xml data against the schema/)
83
87
  end
84
88
 
85
- def test_custom_billing
89
+ def test_custom_billing
86
90
  hash = {
87
- 'payPalNotes'=>'Notes',
88
- 'litleTxnId'=>'123456000',
91
+ 'merchantId' => '101',
92
+ 'id' => '102',
93
+ 'reportGroup'=>'Planets',
89
94
  'amount'=>'106',
95
+ 'secondaryAmount'=>'20',
96
+ 'litleTxnId'=>'1234',
90
97
  'customBilling'=>{
91
98
  'city' =>'boston',
92
99
  'descriptor' => 'card was present',
@@ -95,21 +102,21 @@ module LitleOnline
95
102
  assert_equal('Valid Format', response.message)
96
103
  end
97
104
 
98
-
99
- def test_simple_capture_with_pin
105
+ def test_simple_capture_with_pin
100
106
  hash = {
101
- #'merchantId' => '101',
102
- #'version'=>'8.8',
103
- #'reportGroup'=>'Planets',
104
- 'payPalNotes'=>'Notes',
105
- 'litleTxnId'=>'123456000',
107
+ 'merchantId' => '101',
108
+ 'id' => '102',
109
+ 'reportGroup'=>'Planets',
106
110
  'amount'=>'106',
111
+ 'secondaryAmount'=>'20',
112
+ 'litleTxnId'=>'123456000',
107
113
  'pin'=>'1234'
108
114
  }
109
115
  response= LitleOnlineRequest.new.capture(hash)
110
- assert_equal('Valid Format', response.message)
111
- assert_equal('Approved', response.captureResponse.message)
116
+ assert_equal('Valid Format', response.message)
112
117
  end
113
-
118
+
119
+
120
+
114
121
  end
115
122
  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
  'orderId'=>'12344',
36
37
  'amount'=>'106',
@@ -52,6 +53,7 @@ module LitleOnline
52
53
  hash = {
53
54
  'merchantId' => '101',
54
55
  'version'=>'8.8',
56
+ 'id'=>'test',
55
57
  'reportGroup'=>'Planets',
56
58
  'orderId'=>'12344',
57
59
  'authInformation' => {
@@ -74,6 +76,7 @@ module LitleOnline
74
76
  hash = {
75
77
  'merchantId' => '101',
76
78
  'version'=>'8.8',
79
+ 'id'=>'test',
77
80
  'orderSource'=>'ecommerce',
78
81
  'authInformation' => {
79
82
  'authDate'=>'2002-10-09','authCode'=>'543216',
@@ -96,6 +99,7 @@ module LitleOnline
96
99
  hash = {
97
100
  'merchantId' => '101',
98
101
  'version'=>'8.8',
102
+ 'id'=>'test',
99
103
  'reportGroup'=>'Planets',
100
104
  'authInformation' => {
101
105
  'authDate'=>'2002-10-09','authCode'=>'543216',
@@ -118,6 +122,7 @@ module LitleOnline
118
122
  hash = {
119
123
  'merchantId' => '101',
120
124
  'version'=>'8.8',
125
+ 'id'=>'test',
121
126
  'reportGroup'=>'Planets',
122
127
  'orderId'=>'12344',
123
128
  'amount'=>'106',
@@ -125,7 +130,7 @@ module LitleOnline
125
130
  'authDate'=>'2002-10-09','authCode'=>'543216',
126
131
  'authAmount'=>'12345'
127
132
  },
128
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'},
133
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'},
129
134
  'processingInstructions'=>{'bypassVelocityCheck'=>'true'},
130
135
  'orderSource'=>'ecommerce',
131
136
  'card'=>{
@@ -141,6 +146,7 @@ module LitleOnline
141
146
  hash = {
142
147
  'merchantId' => '101',
143
148
  'version'=>'8.8',
149
+ 'id'=>'test',
144
150
  'reportGroup'=>'Planets',
145
151
  'orderId'=>'12344',
146
152
  'amount'=>'106',
@@ -168,6 +174,7 @@ module LitleOnline
168
174
  hash = {
169
175
  'merchantId' => '101',
170
176
  'version'=>'8.8',
177
+ 'id'=>'test',
171
178
  'reportGroup'=>'Planets',
172
179
  'orderId'=>'12344',
173
180
  'authInformation' => {
@@ -180,16 +187,17 @@ module LitleOnline
180
187
  'number' =>'4100000000000001',
181
188
  'expDate' =>'1210'
182
189
  }}
183
- #Get exceptions
190
+ #Get exceptions
184
191
  exception = assert_raise(RuntimeError){LitleOnlineRequest.new.capture_given_auth(hash)}
185
192
  #Test
186
- assert(exception.message =~ /Error validating xml data against the schema/)
193
+ assert(exception.message =~ /Error validating xml data against the schema/)
187
194
  end
188
195
 
189
196
  def test_simple_captureGivenAuth_with_mpos
190
197
  hash = {
191
198
  'merchantId' => '101',
192
199
  'version'=>'8.8',
200
+ 'id'=>'test',
193
201
  'reportGroup'=>'Planets',
194
202
  'orderId'=>'12344',
195
203
  'amount'=>'106',
@@ -215,6 +223,7 @@ module LitleOnline
215
223
  hash = {
216
224
  'merchantId' => '101',
217
225
  'version'=>'8.8',
226
+ 'id'=>'test',
218
227
  'reportGroup'=>'Planets',
219
228
  'orderId'=>'12344',
220
229
  'authInformation' => {
@@ -234,9 +243,10 @@ module LitleOnline
234
243
  assert_equal('Valid Format', response.message)
235
244
  end
236
245
 
237
- def test_simple_capture_given_auth_with_processingType
246
+ def test_simple_capture_given_auth_with_processingType
238
247
  hash = {
239
248
  'merchantId' => '101',
249
+ 'id'=>'test',
240
250
  'version'=>'8.8',
241
251
  'reportGroup'=>'Planets',
242
252
  'orderId'=>'12344',
@@ -254,12 +264,12 @@ module LitleOnline
254
264
  }}
255
265
  response= LitleOnlineRequest.new.capture_given_auth(hash)
256
266
  assert_equal('Valid Format', response.message)
257
- #assert_equal('000', response.captureGivenAuthResponse.response)
258
267
  end
259
268
 
260
269
  def test_simple_capture_given_auth_with_originalNetworkTransactionId_originalTransactionAmount
261
270
  hash = {
262
271
  'merchantId' => '101',
272
+ 'id'=>'test',
263
273
  'version'=>'8.8',
264
274
  'reportGroup'=>'Planets',
265
275
  'orderId'=>'12344',
@@ -279,7 +289,6 @@ module LitleOnline
279
289
  }
280
290
  response= LitleOnlineRequest.new.capture_given_auth(hash)
281
291
  assert_equal('Valid Format', response.message)
282
- #assert_equal('000', response.captureGivenAuthResponse.response)
283
292
  end
284
293
 
285
294
  end
@@ -81,7 +81,7 @@ def test_simple_happy
81
81
  #Get exceptions
82
82
  exception = assert_raise(RuntimeError){LitleOnlineRequest.new.create_plan(hash)}
83
83
  #Test
84
- assert(exception.message =~ /Error validating xml data against the schema/)
84
+ assert(exception.message =~ /Error validating xml data against the schema/)
85
85
  end
86
86
  end
87
87
  end
@@ -30,6 +30,7 @@ module LitleOnline
30
30
  def test_simple_credit_with_card
31
31
  hash = {
32
32
  'merchantId' => '101',
33
+ 'id' => 'test',
33
34
  'version'=>'8.8',
34
35
  'reportGroup'=>'Planets',
35
36
  'orderId'=>'12344',
@@ -47,6 +48,7 @@ module LitleOnline
47
48
  def test_simple_credit_with_paypal
48
49
  hash = {
49
50
  'merchantId' => '101',
51
+ 'id' => 'test',
50
52
  'version'=>'8.8',
51
53
  'reportGroup'=>'Planets',
52
54
  'amount'=>'106',
@@ -63,6 +65,7 @@ module LitleOnline
63
65
  def test_simple_credit_with_secondaryAmount
64
66
  hash = {
65
67
  'merchantId' => '101',
68
+ 'id' => 'test',
66
69
  'version'=>'8.8',
67
70
  'reportGroup'=>'Planets',
68
71
  'amount'=>'106',
@@ -80,6 +83,7 @@ module LitleOnline
80
83
  def test_credit_with_TxnID_secondaryAmount
81
84
  hash = {
82
85
  'merchantId' => '101',
86
+ 'id' => '102',
83
87
  'version'=>'8.8',
84
88
  'reportGroup'=>'Planets',
85
89
  'amount'=>'106',
@@ -93,6 +97,7 @@ module LitleOnline
93
97
  def test_fields_out_of_order
94
98
  hash = {
95
99
  'merchantId' => '101',
100
+ 'id' => '102',
96
101
  'version'=>'8.8',
97
102
  'reportGroup'=>'Planets',
98
103
  'orderId'=>'12344',
@@ -111,6 +116,7 @@ module LitleOnline
111
116
  def test_invalid_field
112
117
  hash = {
113
118
  'merchantId' => '101',
119
+ 'id' => '102',
114
120
  'version'=>'8.8',
115
121
  'reportGroup'=>'Planets',
116
122
  'orderId'=>'12344',
@@ -129,6 +135,7 @@ module LitleOnline
129
135
  def test_pay_pal_notes
130
136
  hash = {
131
137
  'merchantId' => '101',
138
+ 'id' => '102',
132
139
  'version'=>'8.8',
133
140
  'reportGroup'=>'Planets',
134
141
  'orderId'=>'12344',
@@ -147,6 +154,7 @@ module LitleOnline
147
154
  def test_processing_instructions_and_amex_data
148
155
  hash = {
149
156
  'merchantId' => '101',
157
+ 'id' => '102',
150
158
  'version'=>'8.8',
151
159
  'reportGroup'=>'Planets',
152
160
  'amount'=>'2000',
@@ -166,6 +174,7 @@ module LitleOnline
166
174
  def test_simple_credit_with_mpos
167
175
  hash = {
168
176
  'merchantId' => '101',
177
+ 'id' => '102',
169
178
  'version'=>'8.8',
170
179
  'reportGroup'=>'Planets',
171
180
  'orderId'=>'12344',
@@ -187,17 +196,17 @@ module LitleOnline
187
196
  def test_simple_credit_with_pin
188
197
  hash = {
189
198
  'merchantId' => '101',
190
- 'version'=>'8.8',
199
+ 'id' => '102',
191
200
  'reportGroup'=>'Planets',
192
201
  'amount'=>'106',
193
202
  'secondaryAmount'=>'20',
194
- 'litleTxnId'=>'1234',
195
- 'pin'=>'3333'
203
+ 'litleTxnId'=>'123456000',
204
+ 'pin'=>'1234'
196
205
  }
197
206
  response= LitleOnlineRequest.new.credit(hash)
198
207
  assert_equal('Valid Format', response.message)
199
208
  assert_equal('000', response.creditResponse.response)
200
- end
201
-
209
+ end
210
+
202
211
  end
203
212
  end
@@ -33,11 +33,12 @@ def test_simple_happy
33
33
  hash = {
34
34
  'merchantId' => '101',
35
35
  'version'=>'8.8',
36
+ 'id'=>'test',
36
37
  'reportGroup'=>'Planets',
37
38
  'orderId' =>'1001',
38
39
  'orderSource' =>'ecommerce',
39
40
  'card'=>{
40
- 'type'=>'VI',
41
+ 'type'=>'GC',
41
42
  'number' =>'4100000000000001',
42
43
  'expDate' =>'1210'
43
44
  }
@@ -51,11 +52,12 @@ def test_simple_happy
51
52
  hash = {
52
53
  'merchantId' => '101',
53
54
  'version'=>'8.8',
55
+ 'id'=>'test',
54
56
  'reportGroup'=>'Planets',
55
57
  'orderSource' =>'ecommerce',
56
58
  'orderId' =>'1001',
57
59
  'card'=>{
58
- 'type'=>'VI',
60
+ 'type'=>'GC',
59
61
  'number' =>'4100000000000001',
60
62
  'expDate' =>'1210'
61
63
  }
@@ -76,7 +78,28 @@ def test_simple_happy
76
78
  #Get exceptions
77
79
  exception = assert_raise(RuntimeError){LitleOnlineRequest.new.deactivate(hash)}
78
80
  #Test
79
- assert(exception.message =~ /Error validating xml data against the schema/)
81
+ assert(exception.message =~ /Error validating xml data against the schema/)
80
82
  end
83
+
84
+ def test_CardType_NotGiftCard
85
+ hash = {
86
+ 'merchantId' => '101',
87
+ 'version'=>'8.8',
88
+ 'id'=>'test',
89
+ 'reportGroup'=>'Planets',
90
+ 'orderId' =>'1001',
91
+ 'orderSource' =>'ecommerce',
92
+ 'card'=>{
93
+ 'type'=>'VI',
94
+ 'number' =>'4100000000000001',
95
+ 'expDate' =>'1210'
96
+ }
97
+ }
98
+ #Get exceptions
99
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.deactivate(hash)}
100
+ #Test
101
+ assert(exception.message =~ /Error validating xml data against the schema/)
102
+ end
103
+
81
104
  end
82
105
  end