LitleOnline 10.1.1 → 11.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +13 -6
  3. data/DESCRIPTION +2 -2
  4. data/LICENSE +1 -1
  5. data/README.md +8 -8
  6. data/Rakefile +6 -7
  7. data/SETUP.md +4 -4
  8. data/bin/Setup.rb +4 -4
  9. data/bin/sample_batch_driver.rb +1 -1
  10. data/bin/sample_driver.rb +1 -1
  11. data/lib/Communications.rb +5 -5
  12. data/lib/Configuration.rb +1 -1
  13. data/lib/LitleBatchRequest.rb +39 -1
  14. data/lib/LitleListeners.rb +2 -2
  15. data/lib/LitleOnline.rb +1 -1
  16. data/lib/LitleOnlineRequest.rb +22 -3
  17. data/lib/LitleRequest.rb +4 -4
  18. data/lib/LitleTransaction.rb +156 -47
  19. data/lib/LitleXmlMapper.rb +8 -1
  20. data/lib/XMLFields.rb +252 -51
  21. data/temp.xml +21 -0
  22. data/test/certification/certTest1_base.rb +52 -52
  23. data/test/certification/certTest2_authenhanced.rb +20 -20
  24. data/test/certification/certTest3_authreversal.rb +16 -16
  25. data/test/certification/certTest4_echeck.rb +18 -12
  26. data/test/certification/certTest5_token.rb +3 -3
  27. data/test/certification/certTest_batchAll.rb +9 -1
  28. data/test/certification/ts_all.rb +1 -1
  29. data/test/functional/test_activate.rb +34 -5
  30. data/test/functional/test_activateReversal.rb +23 -7
  31. data/test/functional/test_auth.rb +126 -17
  32. data/test/functional/test_authReversal.rb +5 -3
  33. data/test/functional/test_balanceInquiry.rb +30 -5
  34. data/test/functional/test_batch.rb +1 -1
  35. data/test/functional/test_batchStream.rb +1 -1
  36. data/test/functional/test_cancelSubscription.rb +5 -3
  37. data/test/functional/test_capture.rb +37 -2
  38. data/test/functional/test_captureGivenAuth.rb +54 -3
  39. data/test/functional/test_configuration.rb +1 -1
  40. data/test/functional/test_createPlan.rb +5 -3
  41. data/test/functional/test_credit.rb +17 -1
  42. data/test/functional/test_deactivate.rb +28 -5
  43. data/test/functional/test_deactivateReversal.rb +21 -7
  44. data/test/functional/test_depositReversal.rb +30 -18
  45. data/test/functional/test_echeckCredit.rb +29 -5
  46. data/test/functional/test_echeckRedeposit.rb +28 -3
  47. data/test/functional/test_echeckSale.rb +43 -7
  48. data/test/functional/test_echeckVerification.rb +34 -8
  49. data/test/functional/test_echeckVoid.rb +2 -2
  50. data/test/functional/test_forceCapture.rb +36 -8
  51. data/test/functional/test_fraudCheck.rb +12 -14
  52. data/test/functional/test_giftCardAuthReversal.rb +72 -0
  53. data/test/functional/test_giftCardCapture.rb +72 -0
  54. data/test/functional/test_giftCardCredit.rb +69 -0
  55. data/test/functional/test_litle_requests.rb +1 -1
  56. data/test/functional/test_load.rb +29 -5
  57. data/test/functional/test_loadReversal.rb +21 -7
  58. data/test/functional/test_override.rb +4 -3
  59. data/test/functional/test_queryTransaction.rb +24 -18
  60. data/test/functional/test_refundReversal.rb +21 -7
  61. data/test/functional/test_sale.rb +86 -9
  62. data/test/functional/test_token.rb +26 -11
  63. data/test/functional/test_unload.rb +29 -5
  64. data/test/functional/test_unloadReversal.rb +21 -7
  65. data/test/functional/test_updateCardValidationNumOnToken.rb +1 -1
  66. data/test/functional/test_updatePlan.rb +5 -3
  67. data/test/functional/test_updateSubscription.rb +5 -3
  68. data/test/functional/test_wallet.rb +1 -1
  69. data/test/functional/test_xmlfields.rb +9 -5
  70. data/test/functional/ts_all.rb +1 -1
  71. data/test/unit/test_LitleAUBatch.rb +1 -1
  72. data/test/unit/test_LitleBatchRequest.rb +1 -1
  73. data/test/unit/test_LitleOnlineRequest.rb +15 -57
  74. data/test/unit/test_LitleRequest.rb +1 -1
  75. data/test/unit/test_LitleTransaction.rb +3 -3
  76. data/test/unit/test_LitleXmlMapper.rb +139 -0
  77. data/test/unit/test_activate.rb +5 -5
  78. data/test/unit/test_activateReversal.rb +16 -4
  79. data/test/unit/test_auth.rb +50 -9
  80. data/test/unit/test_authReversal.rb +1 -1
  81. data/test/unit/test_balanceInquiry.rb +3 -3
  82. data/test/unit/test_cancelSubscription.rb +1 -1
  83. data/test/unit/test_capture.rb +27 -1
  84. data/test/unit/test_captureGivenAuth.rb +47 -1
  85. data/test/unit/test_createPlan.rb +1 -1
  86. data/test/unit/test_credit.rb +16 -3
  87. data/test/unit/test_deactivate.rb +20 -1
  88. data/test/unit/test_deactivateReversal.rb +16 -4
  89. data/test/unit/test_depositReversal.rb +18 -6
  90. data/test/unit/test_echeckCredit.rb +20 -1
  91. data/test/unit/test_echeckRedeposit.rb +16 -1
  92. data/test/unit/test_echeckSale.rb +20 -1
  93. data/test/unit/test_echeckVerification.rb +7 -4
  94. data/test/unit/test_echeckVoid.rb +1 -1
  95. data/test/unit/test_forceCapture.rb +19 -1
  96. data/test/unit/test_fraudCheck.rb +1 -1
  97. data/test/unit/test_giftCardAuthReversal.rb +58 -0
  98. data/test/unit/test_giftCardCapture.rb +57 -0
  99. data/test/unit/test_giftCardCredit.rb +57 -0
  100. data/test/unit/test_load.rb +3 -3
  101. data/test/unit/test_loadReversal.rb +16 -4
  102. data/test/unit/test_queryTransaction.rb +5 -22
  103. data/test/unit/test_refundReversal.rb +16 -4
  104. data/test/unit/test_sale.rb +90 -5
  105. data/test/unit/test_token.rb +35 -24
  106. data/test/unit/test_unload.rb +3 -3
  107. data/test/unit/test_unloadReversal.rb +16 -4
  108. data/test/unit/test_updateCardValidationNumOnToken.rb +1 -1
  109. data/test/unit/test_updatePlan.rb +1 -1
  110. data/test/unit/test_updateSubscription.rb +1 -1
  111. data/test/unit/test_wallet.rb +1 -1
  112. data/test/unit/test_xmlfields.rb +1 -1
  113. data/test/unit/ts_unit.rb +1 -1
  114. metadata +18 -10
@@ -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
@@ -62,15 +62,15 @@ module LitleOnline
62
62
  'reportGroup'=>'Planets',
63
63
  'orderId'=>'12344',
64
64
  'applepay'=>{
65
- 'data'=>'1234',
66
- 'header'=>{
67
- 'applicationData'=>'454657413164',
68
- 'ephemeralPublicKey'=>'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855',
69
- 'publicKeyHash'=>'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855',
70
- 'transactionId'=>'1234'
71
- },
72
- 'signature' =>'1',
73
- 'version'=>'10000'
65
+ 'data'=>'1234',
66
+ 'header'=>{
67
+ 'applicationData'=>'454657413164',
68
+ 'ephemeralPublicKey'=>'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855',
69
+ 'publicKeyHash'=>'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855',
70
+ 'transactionId'=>'1234'
71
+ },
72
+ 'signature' =>'1',
73
+ 'version'=>'10000'
74
74
  }
75
75
  }
76
76
  response= LitleOnlineRequest.new.register_token_request(hash)
@@ -117,6 +117,21 @@ module LitleOnline
117
117
  response= LitleOnlineRequest.new.register_token_request(hash)
118
118
  assert_equal('Valid Format', response.message)
119
119
  end
120
- end
121
120
 
121
+ def test_simple_token_with_androidpay
122
+ hash = {
123
+ 'merchantId' => '101',
124
+ 'version'=>'8.8',
125
+ 'reportGroup'=>'Planets',
126
+ 'id'=>'test',
127
+ 'orderId'=>'androidpay',
128
+ 'accountNumber'=>'1233456789103801'
129
+ }
130
+ response= LitleOnlineRequest.new.register_token_request(hash)
131
+ assert_equal('Account number was successfully registered', response.registerTokenResponse.message)
132
+ assert_equal('01', response.registerTokenResponse.androidpayResponse.expMonth)
133
+ assert_equal('2050', response.registerTokenResponse.androidpayResponse.expYear)
134
+ assert_equal('aHR0cHM6Ly93d3cueW91dHViZS5jb20vd2F0Y2g/dj1kUXc0dzlXZ1hjUQ0K', response.registerTokenResponse.androidpayResponse.cryptogram)
135
+ end
136
+ end
122
137
  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
@@ -39,7 +39,7 @@ def test_simple_happy
39
39
  'amount' =>'500',
40
40
  'orderSource' =>'ecommerce',
41
41
  'card'=>{
42
- 'type'=>'VI',
42
+ 'type'=>'GC',
43
43
  'number' =>'4100000000000001',
44
44
  'expDate' =>'1210'
45
45
  }
@@ -59,7 +59,7 @@ def test_simple_happy
59
59
  'orderId' =>'1001',
60
60
  'orderSource' =>'ecommerce',
61
61
  'card'=>{
62
- 'type'=>'VI',
62
+ 'type'=>'GC',
63
63
  'number' =>'4100000000000001',
64
64
  'expDate' =>'1210'
65
65
  }
@@ -77,8 +77,32 @@ def test_simple_happy
77
77
  'amount' =>'500',
78
78
  }
79
79
 
80
- response= LitleOnlineRequest.new.unload_request(hash)
81
- assert(response.message =~ /Error validating xml data against the schema/)
80
+ #Get exceptions
81
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.unload_request(hash)}
82
+ #Test
83
+ assert(exception.message =~ /Error validating xml data against the schema/)
84
+ end
85
+
86
+ def test_GiftCardCardType_NotPresent
87
+ hash = {
88
+ 'merchantId' => '101',
89
+ 'version'=>'8.8',
90
+ 'id' =>'test',
91
+ 'reportGroup'=>'Planets',
92
+ 'amount' =>'500',
93
+ 'orderId' =>'1001',
94
+ 'orderSource' =>'ecommerce',
95
+ 'card'=>{
96
+ 'type'=>'VI',
97
+ 'number' =>'4100000000000001',
98
+ 'expDate' =>'1210'
99
+ }
100
+ }
101
+
102
+ #Get exceptions
103
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.unload_request(hash)}
104
+ #Test
105
+ assert(exception.message =~ /Error validating xml data against the schema/)
82
106
  end
83
107
  end
84
108
  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
@@ -35,11 +35,23 @@ def test_simple
35
35
  'version'=>'8.8',
36
36
  'id'=>'test',
37
37
  'reportGroup'=>'Planets',
38
- 'litleTxnId' =>'5000'
39
- }
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
+ }
40
52
 
41
- response= LitleOnlineRequest.new.unload_reversal(hash)
42
- assert_equal('Valid Format', response.message)
53
+ response= LitleOnlineRequest.new.deposit_reversal(hash)
54
+ assert_equal('000', response.depositReversalResponse.response)
43
55
  end
44
56
 
45
57
 
@@ -50,8 +62,10 @@ def test_simple
50
62
  'reportGroup'=>'Planets',
51
63
  }
52
64
 
53
- response= LitleOnlineRequest.new.unload_reversal(hash)
54
- assert(response.message =~ /Error validating xml data against the schema/)
65
+ #Get exceptions
66
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.unload_reversal(hash)}
67
+ #Test
68
+ assert(exception.message =~ /Error validating xml data against the schema/)
55
69
  end
56
70
  end
57
71
  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
@@ -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
@@ -52,8 +52,10 @@ def test_simple_happy
52
52
  'planCode'=>'planCodeString',
53
53
  }
54
54
 
55
- response= LitleOnlineRequest.new.update_plan(hash)
56
- assert(response.message =~ /Error validating xml data against the schema/)
55
+ #Get exceptions
56
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.update_plan(hash)}
57
+ #Test
58
+ assert(exception.message =~ /Error validating xml data against the schema/)
57
59
  end
58
60
  end
59
61
  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
@@ -71,8 +71,10 @@ def test_simple_happy
71
71
  'reportGroup'=>'Planets',
72
72
  }
73
73
 
74
- response= LitleOnlineRequest.new.update_subscription(hash)
75
- assert(response.message =~ /Error validating xml data against the schema/)
74
+ #Get exceptions
75
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.update_subscription(hash)}
76
+ #Test
77
+ assert(exception.message =~ /Error validating xml data against the schema/)
76
78
  end
77
79
  end
78
80
  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
@@ -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
@@ -42,8 +42,10 @@ module LitleOnline
42
42
  'expDate' =>'1210',
43
43
  'cardValidationNum'=> '123'
44
44
  }}
45
- response= LitleOnlineRequest.new.sale(hash)
46
- assert(response.message =~ /Error validating xml data against the schema/)
45
+ #Get exceptions
46
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.sale(hash)}
47
+ #Test
48
+ assert(exception.message =~ /Error validating xml data against the schema/)
47
49
  end
48
50
 
49
51
  def test_simple_custom_billing
@@ -198,8 +200,10 @@ module LitleOnline
198
200
  'expDate' =>'1210'},
199
201
  'amexAggregatorData'=>{'sellerMerchantCategoryCode'=>'1234'}
200
202
  }
201
- response= LitleOnlineRequest.new.credit(hash)
202
- assert(response.message =~ /Error validating xml data against the schema/)
203
+ #Get exceptions
204
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.credit(hash)}
205
+ #Test
206
+ assert(exception.message =~ /Error validating xml data against the schema/)
203
207
  end
204
208
 
205
209
  def test_simple_enhanced_data
@@ -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
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2011 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
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2011 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
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2011 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,9 +49,7 @@ module LitleOnline
49
49
  'expDate' =>'1210'
50
50
  }}
51
51
 
52
- Communications.expects(:http_post).with(regexp_matches(/<litleOnlineRequest .*/m),kind_of(Hash))
53
- XMLObject.expects(:new)
54
-
52
+ LitleXmlMapper.expects(:request).with(regexp_matches(/<litleOnlineRequest .*/m), is_a(Hash))
55
53
  response = LitleOnlineRequest.new.authorization(hash)
56
54
  end
57
55
 
@@ -69,9 +67,7 @@ module LitleOnline
69
67
  'expDate' =>'1210'
70
68
  }}
71
69
 
72
- Communications.expects(:http_post).with(regexp_matches(/.*<authorization ((reportGroup="Planets" id="003")|(id="003" reportGroup="Planets")).*/m),kind_of(Hash))
73
- XMLObject.expects(:new)
74
-
70
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<authorization ((reportGroup="Planets" id="003")|(id="003" reportGroup="Planets")).*/m), is_a(Hash))
75
71
  response = LitleOnlineRequest.new.authorization(hash)
76
72
  end
77
73
 
@@ -89,9 +85,7 @@ module LitleOnline
89
85
  'expDate' =>'1210'
90
86
  }}
91
87
 
92
- Communications.expects(:http_post).with(regexp_matches(/.*<authorization.*<orderId>12344.*<amount>106.*<orderSource>ecommerce.*/m),kind_of(Hash))
93
- XMLObject.expects(:new)
94
-
88
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<authorization.*<orderId>12344.*<amount>106.*<orderSource>ecommerce.*/m), is_a(Hash))
95
89
  response = LitleOnlineRequest.new.authorization(hash)
96
90
  end
97
91
 
@@ -109,9 +103,7 @@ module LitleOnline
109
103
  'expDate' =>'1210'
110
104
  }}
111
105
 
112
- Communications.expects(:http_post).with(regexp_matches(/.*<authorization.*<card>.*<number>4100000000000001.*<expDate>1210.*/m),kind_of(Hash))
113
- XMLObject.expects(:new)
114
-
106
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<authorization.*<card>.*<number>4100000000000001.*<expDate>1210.*/m), is_a(Hash))
115
107
  response = LitleOnlineRequest.new.authorization(hash)
116
108
  end
117
109
 
@@ -129,9 +121,7 @@ module LitleOnline
129
121
  'expDate' =>'1210'
130
122
  }}
131
123
 
132
- Communications.expects(:http_post).with(regexp_matches(/<litleOnlineRequest.*<sale.*<card>.*<number>4100000000000001.*<expDate>1210.*/m),kind_of(Hash))
133
- XMLObject.expects(:new)
134
-
124
+ LitleXmlMapper.expects(:request).with(regexp_matches(/<litleOnlineRequest.*<sale.*<card>.*<number>4100000000000001.*<expDate>1210.*/m), is_a(Hash))
135
125
  response = LitleOnlineRequest.new.sale(hash)
136
126
  end
137
127
 
@@ -143,9 +133,7 @@ module LitleOnline
143
133
  'litleTxnId'=>'123456789012345678'
144
134
  }
145
135
 
146
- Communications.expects(:http_post).with(Not(regexp_matches(/.*amount.*/m)),kind_of(Hash))
147
- XMLObject.expects(:new)
148
-
136
+ LitleXmlMapper.expects(:request).with(Not(regexp_matches(/.*amount.*/m)), is_a(Hash))
149
137
  response = LitleOnlineRequest.new.capture(hash)
150
138
  end
151
139
 
@@ -159,9 +147,7 @@ module LitleOnline
159
147
  'litleTxnId'=>'123456789012345678'
160
148
  }
161
149
 
162
- Communications.expects(:http_post).with(Not(regexp_matches(/.*amount.*/m)),kind_of(Hash))
163
- XMLObject.expects(:new)
164
-
150
+ LitleXmlMapper.expects(:request).with(Not(regexp_matches(/.*amount.*/m)), is_a(Hash))
165
151
  response = LitleOnlineRequest.new.force_capture(hash)
166
152
  end
167
153
 
@@ -175,8 +161,7 @@ module LitleOnline
175
161
  'litleTxnId'=>'123456789012345678',
176
162
  }
177
163
 
178
- Communications.expects(:http_post).with(Not(regexp_matches(/.*amount.*/m)),kind_of(Hash))
179
- XMLObject.expects(:new)
164
+ LitleXmlMapper.expects(:request).with(Not(regexp_matches(/.*amount.*/m)), is_a(Hash))
180
165
 
181
166
  response = LitleOnlineRequest.new.echeck_credit(hash)
182
167
  end
@@ -191,9 +176,7 @@ module LitleOnline
191
176
  'litleTxnId'=>'123456789012345678',
192
177
  }
193
178
 
194
- Communications.expects(:http_post).with(Not(regexp_matches(/.*amount.*/m)),kind_of(Hash))
195
- XMLObject.expects(:new)
196
-
179
+ LitleXmlMapper.expects(:request).with(Not(regexp_matches(/.*amount.*/m)), is_a(Hash))
197
180
  response = LitleOnlineRequest.new.echeck_sale(hash)
198
181
  end
199
182
 
@@ -213,8 +196,7 @@ module LitleOnline
213
196
  }
214
197
  }
215
198
 
216
- XMLObject.expects(:new)
217
- Communications.expects(:http_post).with(regexp_matches(/.*card.*/m),kind_of(Hash))
199
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*card.*/m), is_a(Hash))
218
200
  LitleOnlineRequest.new.authorization(start_hash.merge(card_only))
219
201
  end
220
202
 
@@ -233,18 +215,11 @@ module LitleOnline
233
215
  }
234
216
  }
235
217
 
236
- XMLObject.expects(:new)
237
- Communications.expects(:http_post).with(regexp_matches(/.*token.*/m),kind_of(Hash))
218
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*token.*/m), is_a(Hash))
238
219
  LitleOnlineRequest.new.authorization(start_hash.merge(token_only))
239
220
  end
240
221
 
241
- def test_set_merchant_sdk
242
- litle = LitleOnlineRequest.new
243
- #Explicit - used for integrations
244
- assert_equal 'ActiveMerchant;3.2', litle.send(:get_merchant_sdk, {'merchantSdk'=>'ActiveMerchant;3.2'})
245
- #Implicit - used raw when nothing is specified
246
- assert_equal 'Ruby;10.1', litle.send(:get_merchant_sdk, {'NotMerchantSdk'=>'ActiveMerchant;3.2'})
247
- end
222
+
248
223
 
249
224
  def test_sale_paypal_order_complete_typo
250
225
  Configuration.any_instance.stubs(:config).returns({'currency_merchant_map'=>{'DEFAULT'=>'1'}, 'user'=>'a','password'=>'b','version'=>'8.10'})
@@ -261,9 +236,7 @@ module LitleOnline
261
236
  'expDate' =>'1210'
262
237
  }}
263
238
 
264
- Communications.expects(:http_post).with(regexp_matches(/<litleOnlineRequest.*<sale.*<payPalOrderComplete>true<\/payPalOrderComplete>.*/m),kind_of(Hash))
265
- XMLObject.expects(:new)
266
-
239
+ LitleXmlMapper.expects(:request).with(regexp_matches(/<litleOnlineRequest.*<sale.*<payPalOrderComplete>true<\/payPalOrderComplete>.*/m), is_a(Hash))
267
240
  response = LitleOnlineRequest.new.sale(hash)
268
241
  end
269
242
 
@@ -272,23 +245,8 @@ module LitleOnline
272
245
  hash={
273
246
  'litleTxnId' => '006'
274
247
  }
275
-
276
- Communications.expects(:http_post).with(regexp_matches(/<litleOnlineRequest.*version="10\.1".*/m),kind_of(Hash))
277
- XMLObject.expects(:new)
278
-
279
- response = LitleOnlineRequest.new.void(hash)
280
- end
281
-
282
- def test_void_response_contains_recycling
283
- Configuration.any_instance.stubs(:config).returns({'currency_merchant_map'=>{'DEFAULT'=>'1'}, 'user'=>'a','password'=>'b','version'=>'8.10'})
284
- hash={
285
- 'litleTxnId' => '123'
286
- }
287
-
288
- Communications.expects(:http_post).with(kind_of(String),kind_of(Hash)).returns('<litleOnlineResponse><voidResponse><recycling><creditLitleTxnId>65</creditLitleTxnId></recycling></voidResponse></litleOnlineResponse>')
289
-
248
+ LitleXmlMapper.expects(:request).with(regexp_matches(/<litleOnlineRequest.*version="11\.0".*/m), is_a(Hash))
290
249
  response = LitleOnlineRequest.new.void(hash)
291
- assert_equal '65', response.voidResponse.recycling.creditLitleTxnId
292
250
  end
293
251
 
294
252
  end
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2011 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
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2011 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
@@ -419,8 +419,8 @@ module LitleOnline
419
419
  assert_equal '834262', result.origId
420
420
  assert_equal 'A', result.origActionType
421
421
  assert_equal '123456', result.origLitleTxnId
422
- assert_equal '65347567', result.origOrderId
423
- assert_equal '4000000000000001', result.origAccountNumber
422
+ #assert_equal '65347567', result.origOrderId
423
+ #assert_equal '4000000000000001', result.origAccountNumber
424
424
  end
425
425
  end
426
426
  end