CnpOnline 8.31.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG +139 -0
- data/CONTRIBUTORS +2 -0
- data/DESCRIPTION +5 -0
- data/LICENSE +22 -0
- data/README.md +72 -0
- data/Rakefile +89 -0
- data/Rakefile~ +89 -0
- data/SETUP.md +46 -0
- data/bin/Setup.rb +124 -0
- data/bin/sample_batch_driver.rb +123 -0
- data/bin/sample_driver.rb +49 -0
- data/lib/Communications.rb +85 -0
- data/lib/Configuration.rb +67 -0
- data/lib/EnvironmentVariables.rb +22 -0
- data/lib/LitleBatchRequest.rb +562 -0
- data/lib/LitleListeners.rb +142 -0
- data/lib/LitleOnline.rb +62 -0
- data/lib/LitleOnlineRequest.rb +297 -0
- data/lib/LitleRequest.rb +494 -0
- data/lib/LitleTransaction.rb +463 -0
- data/lib/LitleXmlMapper.rb +64 -0
- data/lib/XMLFields.rb +1869 -0
- data/lib/cacert.pem +3331 -0
- data/samples/Auth/LitleAuthReversalTransaction.rb +15 -0
- data/samples/Auth/LitleAuthorizationTransaction.rb +31 -0
- data/samples/Auth/LitlePaymentFullLifeCycle.rb +47 -0
- data/samples/Batch/AccountUpdate.rb +64 -0
- data/samples/Batch/SampleBatchDriver.rb +94 -0
- data/samples/Capture/LitleCaptureGivenAuthTransaction.rb +30 -0
- data/samples/Capture/LitleCaptureTransaction.rb +14 -0
- data/samples/Capture/LitleForceCaptureTransaction.rb +26 -0
- data/samples/Capture/LitlePartialCapture.rb +16 -0
- data/samples/Credit/LitleCreditTransaction.rb +16 -0
- data/samples/Credit/LitleRefundTransaction.rb +29 -0
- data/samples/Other/LitleAvsTransaction.rb +34 -0
- data/samples/Other/LitleVoidTransaction.rb +18 -0
- data/samples/Paypage/FullPaypageLifeCycle.rb +74 -0
- data/samples/Run_all.rb +17 -0
- data/samples/Sale/LitleSaleTransaction.rb +29 -0
- data/samples/Sale/SampleSaleTransaction.rb +24 -0
- data/test/certification/certTest1_base.rb +945 -0
- data/test/certification/certTest2_authenhanced.rb +573 -0
- data/test/certification/certTest3_authreversal.rb +185 -0
- data/test/certification/certTest4_echeck.rb +278 -0
- data/test/certification/certTest5_token.rb +204 -0
- data/test/certification/certTest_batchAll.rb +337 -0
- data/test/certification/ts_all.rb +33 -0
- data/test/functional/test_activate.rb +100 -0
- data/test/functional/test_activateReversal.rb +56 -0
- data/test/functional/test_auth.rb +298 -0
- data/test/functional/test_authReversal.rb +69 -0
- data/test/functional/test_balanceInquiry.rb +80 -0
- data/test/functional/test_batch.rb +164 -0
- data/test/functional/test_batchStream.rb +145 -0
- data/test/functional/test_cancelSubscription.rb +55 -0
- data/test/functional/test_capture.rb +84 -0
- data/test/functional/test_captureGivenAuth.rb +235 -0
- data/test/functional/test_configuration.rb +89 -0
- data/test/functional/test_createPlan.rb +85 -0
- data/test/functional/test_credit.rb +174 -0
- data/test/functional/test_deactivate.rb +80 -0
- data/test/functional/test_deactivateReversal.rb +56 -0
- data/test/functional/test_depositReversal.rb +56 -0
- data/test/functional/test_echeckCredit.rb +134 -0
- data/test/functional/test_echeckRedeposit.rb +88 -0
- data/test/functional/test_echeckSale.rb +177 -0
- data/test/functional/test_echeckVerification.rb +127 -0
- data/test/functional/test_echeckVoid.rb +41 -0
- data/test/functional/test_forceCapture.rb +183 -0
- data/test/functional/test_litle_requests.rb +356 -0
- data/test/functional/test_load.rb +82 -0
- data/test/functional/test_loadReversal.rb +56 -0
- data/test/functional/test_override.rb +64 -0
- data/test/functional/test_refundReversal.rb +56 -0
- data/test/functional/test_sale.rb +259 -0
- data/test/functional/test_token.rb +115 -0
- data/test/functional/test_unload.rb +82 -0
- data/test/functional/test_unloadReversal.rb +56 -0
- data/test/functional/test_updateCardValidationNumOnToken.rb +43 -0
- data/test/functional/test_updatePlan.rb +58 -0
- data/test/functional/test_updateSubscription.rb +76 -0
- data/test/functional/test_xmlfields.rb +427 -0
- data/test/functional/ts_all.rb +66 -0
- data/test/unit/test_LitleAUBatch.rb +216 -0
- data/test/unit/test_LitleBatchRequest.rb +643 -0
- data/test/unit/test_LitleOnlineRequest.rb +295 -0
- data/test/unit/test_LitleRequest.rb +316 -0
- data/test/unit/test_LitleTransaction.rb +397 -0
- data/test/unit/test_activate.rb +92 -0
- data/test/unit/test_activateReversal.rb +44 -0
- data/test/unit/test_auth.rb +421 -0
- data/test/unit/test_authReversal.rb +82 -0
- data/test/unit/test_balanceInquiry.rb +52 -0
- data/test/unit/test_cancelSubscription.rb +43 -0
- data/test/unit/test_capture.rb +73 -0
- data/test/unit/test_captureGivenAuth.rb +188 -0
- data/test/unit/test_createPlan.rb +52 -0
- data/test/unit/test_credit.rb +342 -0
- data/test/unit/test_deactivate.rb +52 -0
- data/test/unit/test_deactivateReversal.rb +44 -0
- data/test/unit/test_depositReversal.rb +44 -0
- data/test/unit/test_echeckCredit.rb +71 -0
- data/test/unit/test_echeckRedeposit.rb +94 -0
- data/test/unit/test_echeckSale.rb +71 -0
- data/test/unit/test_echeckVerification.rb +71 -0
- data/test/unit/test_echeckVoid.rb +54 -0
- data/test/unit/test_forceCapture.rb +145 -0
- data/test/unit/test_load.rb +53 -0
- data/test/unit/test_loadReversal.rb +44 -0
- data/test/unit/test_refundReversal.rb +44 -0
- data/test/unit/test_sale.rb +465 -0
- data/test/unit/test_token.rb +144 -0
- data/test/unit/test_unload.rb +53 -0
- data/test/unit/test_unloadReversal.rb +44 -0
- data/test/unit/test_updateCardValidationNumOnToken.rb +80 -0
- data/test/unit/test_updatePlan.rb +45 -0
- data/test/unit/test_updateSubscription.rb +172 -0
- data/test/unit/test_xmlfields.rb +2930 -0
- data/test/unit/ts_unit.rb +65 -0
- metadata +255 -0
@@ -0,0 +1,115 @@
|
|
1
|
+
=begin
|
2
|
+
Copyright (c) 2012 Litle & Co.
|
3
|
+
|
4
|
+
Permission is hereby granted, free of charge, to any person
|
5
|
+
obtaining a copy of this software and associated documentation
|
6
|
+
files (the "Software"), to deal in the Software without
|
7
|
+
restriction, including without limitation the rights to use,
|
8
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the
|
10
|
+
Software is furnished to do so, subject to the following
|
11
|
+
conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
18
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
20
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
21
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
22
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
23
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
24
|
+
=end
|
25
|
+
require File.expand_path("../../../lib/LitleOnline",__FILE__)
|
26
|
+
require 'test/unit'
|
27
|
+
|
28
|
+
module LitleOnline
|
29
|
+
class TestToken < Test::Unit::TestCase
|
30
|
+
def test_simple_token
|
31
|
+
hash = {
|
32
|
+
'merchantId' => '101',
|
33
|
+
'version'=>'8.8',
|
34
|
+
'reportGroup'=>'Planets',
|
35
|
+
'orderId'=>'12344',
|
36
|
+
'accountNumber'=>'1233456789103801'
|
37
|
+
}
|
38
|
+
response= LitleOnlineRequest.new.register_token_request(hash)
|
39
|
+
assert_equal('Valid Format', response.message)
|
40
|
+
end
|
41
|
+
|
42
|
+
def test_simple_token_with_paypage
|
43
|
+
hash = {
|
44
|
+
'merchantId' => '101',
|
45
|
+
'version'=>'8.8',
|
46
|
+
'reportGroup'=>'Planets',
|
47
|
+
'orderId'=>'12344',
|
48
|
+
'paypageRegistrationId'=>'QU1pTFZnV2NGQWZrZzRKeTNVR0lzejB1K2Q5VDdWMTVqb2J5WFJ2Snh4U0U4eTBxaFg2cEVWaDBWSlhtMVZTTw=='
|
49
|
+
}
|
50
|
+
response= LitleOnlineRequest.new.register_token_request(hash)
|
51
|
+
assert_equal('Valid Format', response.message)
|
52
|
+
assert_equal('1111222233334444', response.registerTokenResponse.litleToken)
|
53
|
+
end
|
54
|
+
|
55
|
+
def test_simple_token_with_applepay
|
56
|
+
hash = {
|
57
|
+
'merchantId' => '101',
|
58
|
+
'version'=>'8.8',
|
59
|
+
'reportGroup'=>'Planets',
|
60
|
+
'orderId'=>'12344',
|
61
|
+
'applepay'=>{
|
62
|
+
'data'=>'1234',
|
63
|
+
'header'=>{
|
64
|
+
'applicationData'=>'454657413164',
|
65
|
+
'ephemeralPublicKey'=>'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855',
|
66
|
+
'publicKeyHash'=>'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855',
|
67
|
+
'transactionId'=>'1234'
|
68
|
+
},
|
69
|
+
'signature' =>'1',
|
70
|
+
'version'=>'12345'
|
71
|
+
}
|
72
|
+
}
|
73
|
+
response= LitleOnlineRequest.new.register_token_request(hash)
|
74
|
+
assert_equal('Valid Format', response.message)
|
75
|
+
end
|
76
|
+
|
77
|
+
def test_simple_token_echeck
|
78
|
+
hash = {
|
79
|
+
'reportGroup'=>'Planets',
|
80
|
+
'merchantId' => '101',
|
81
|
+
'version'=>'8.8',
|
82
|
+
'orderId'=>'12344',
|
83
|
+
'echeckForToken'=>{'accNum'=>'12344565','routingNum'=>'123476545'}
|
84
|
+
}
|
85
|
+
response= LitleOnlineRequest.new.register_token_request(hash)
|
86
|
+
assert_equal('Valid Format', response.message)
|
87
|
+
end
|
88
|
+
|
89
|
+
def test_fields_out_of_order
|
90
|
+
hash = {
|
91
|
+
'merchantId' => '101',
|
92
|
+
'version'=>'8.8',
|
93
|
+
'orderId'=>'12344',
|
94
|
+
'accountNumber'=>'1233456789103801',
|
95
|
+
'reportGroup'=>'Planets',
|
96
|
+
}
|
97
|
+
response= LitleOnlineRequest.new.register_token_request(hash)
|
98
|
+
assert_equal('Valid Format', response.message)
|
99
|
+
end
|
100
|
+
|
101
|
+
def test_invalid_field
|
102
|
+
hash = {
|
103
|
+
'merchantId' => '101',
|
104
|
+
'version'=>'8.8',
|
105
|
+
'NOSUCHFIELD'=>'none',
|
106
|
+
'orderId'=>'12344',
|
107
|
+
'accountNumber'=>'1233456789103801',
|
108
|
+
'reportGroup'=>'Planets',
|
109
|
+
}
|
110
|
+
response= LitleOnlineRequest.new.register_token_request(hash)
|
111
|
+
assert_equal('Valid Format', response.message)
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
end
|
@@ -0,0 +1,82 @@
|
|
1
|
+
=begin
|
2
|
+
Copyright (c) 2012 Litle & Co.
|
3
|
+
|
4
|
+
Permission is hereby granted, free of charge, to any person
|
5
|
+
obtaining a copy of this software and associated documentation
|
6
|
+
files (the "Software"), to deal in the Software without
|
7
|
+
restriction, including without limitation the rights to use,
|
8
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the
|
10
|
+
Software is furnished to do so, subject to the following
|
11
|
+
conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
18
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
20
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
21
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
22
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
23
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
24
|
+
=end
|
25
|
+
require File.expand_path("../../../lib/LitleOnline",__FILE__)
|
26
|
+
require 'test/unit'
|
27
|
+
|
28
|
+
#test Unload Transaction
|
29
|
+
module LitleOnline
|
30
|
+
class TestUnload < Test::Unit::TestCase
|
31
|
+
|
32
|
+
def test_simple_happy
|
33
|
+
hash = {
|
34
|
+
'merchantId' => '101',
|
35
|
+
'version'=>'8.8',
|
36
|
+
'reportGroup'=>'Planets',
|
37
|
+
'orderId' =>'1001',
|
38
|
+
'amount' =>'500',
|
39
|
+
'orderSource' =>'ecommerce',
|
40
|
+
'card'=>{
|
41
|
+
'type'=>'VI',
|
42
|
+
'number' =>'4100000000000001',
|
43
|
+
'expDate' =>'1210'
|
44
|
+
}
|
45
|
+
}
|
46
|
+
|
47
|
+
response= LitleOnlineRequest.new.unload_request(hash)
|
48
|
+
assert_equal('Valid Format', response.message)
|
49
|
+
end
|
50
|
+
|
51
|
+
def test_simple_out_of_order
|
52
|
+
hash = {
|
53
|
+
'merchantId' => '101',
|
54
|
+
'version'=>'8.8',
|
55
|
+
'reportGroup'=>'Planets',
|
56
|
+
'amount' =>'500',
|
57
|
+
'orderId' =>'1001',
|
58
|
+
'orderSource' =>'ecommerce',
|
59
|
+
'card'=>{
|
60
|
+
'type'=>'VI',
|
61
|
+
'number' =>'4100000000000001',
|
62
|
+
'expDate' =>'1210'
|
63
|
+
}
|
64
|
+
}
|
65
|
+
|
66
|
+
response= LitleOnlineRequest.new.unload_request(hash)
|
67
|
+
assert_equal('Valid Format', response.message)
|
68
|
+
end
|
69
|
+
|
70
|
+
def test_simple_error
|
71
|
+
hash = {
|
72
|
+
'merchantId' => '101',
|
73
|
+
'version'=>'8.8',
|
74
|
+
'reportGroup'=>'Planets',
|
75
|
+
'amount' =>'500',
|
76
|
+
}
|
77
|
+
|
78
|
+
response= LitleOnlineRequest.new.unload_request(hash)
|
79
|
+
assert(response.message =~ /Error validating xml data against the schema/)
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
=begin
|
2
|
+
Copyright (c) 2012 Litle & Co.
|
3
|
+
|
4
|
+
Permission is hereby granted, free of charge, to any person
|
5
|
+
obtaining a copy of this software and associated documentation
|
6
|
+
files (the "Software"), to deal in the Software without
|
7
|
+
restriction, including without limitation the rights to use,
|
8
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the
|
10
|
+
Software is furnished to do so, subject to the following
|
11
|
+
conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
18
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
20
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
21
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
22
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
23
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
24
|
+
=end
|
25
|
+
require File.expand_path("../../../lib/LitleOnline",__FILE__)
|
26
|
+
require 'test/unit'
|
27
|
+
|
28
|
+
#test unloadReversal Transaction
|
29
|
+
module LitleOnline
|
30
|
+
class TestUnloadReversal < Test::Unit::TestCase
|
31
|
+
|
32
|
+
def test_simple
|
33
|
+
hash = {
|
34
|
+
'merchantId' => '101',
|
35
|
+
'version'=>'8.8',
|
36
|
+
'reportGroup'=>'Planets',
|
37
|
+
'litleTxnId' =>'5000'
|
38
|
+
}
|
39
|
+
|
40
|
+
response= LitleOnlineRequest.new.unload_reversal(hash)
|
41
|
+
assert_equal('Valid Format', response.message)
|
42
|
+
end
|
43
|
+
|
44
|
+
|
45
|
+
def test_simple_error
|
46
|
+
hash = {
|
47
|
+
'merchantId' => '101',
|
48
|
+
'version'=>'8.8',
|
49
|
+
'reportGroup'=>'Planets',
|
50
|
+
}
|
51
|
+
|
52
|
+
response= LitleOnlineRequest.new.unload_reversal(hash)
|
53
|
+
assert(response.message =~ /Error validating xml data against the schema/)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
=begin
|
2
|
+
Copyright (c) 2012 Litle & Co.
|
3
|
+
|
4
|
+
Permission is hereby granted, free of charge, to any person
|
5
|
+
obtaining a copy of this software and associated documentation
|
6
|
+
files (the "Software"), to deal in the Software without
|
7
|
+
restriction, including without limitation the rights to use,
|
8
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the
|
10
|
+
Software is furnished to do so, subject to the following
|
11
|
+
conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
18
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
20
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
21
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
22
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
23
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
24
|
+
=end
|
25
|
+
require File.expand_path("../../../lib/LitleOnline",__FILE__)
|
26
|
+
require 'test/unit'
|
27
|
+
|
28
|
+
module LitleOnline
|
29
|
+
class TestUpdateCardValidationNumOnToken < Test::Unit::TestCase
|
30
|
+
def test_simple
|
31
|
+
hash = {
|
32
|
+
'merchantId' => '101',
|
33
|
+
'version'=>'8.8',
|
34
|
+
'reportGroup'=>'Planets',
|
35
|
+
'orderId'=>'12344',
|
36
|
+
'litleToken'=>'1233456789103801',
|
37
|
+
'cardValidationNum'=>'123'
|
38
|
+
}
|
39
|
+
response= LitleOnlineRequest.new.update_card_validation_num_on_token(hash)
|
40
|
+
assert_equal('Valid Format', response.message)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
=begin
|
2
|
+
Copyright (c) 2012 Litle & Co.
|
3
|
+
|
4
|
+
Permission is hereby granted, free of charge, to any person
|
5
|
+
obtaining a copy of this software and associated documentation
|
6
|
+
files (the "Software"), to deal in the Software without
|
7
|
+
restriction, including without limitation the rights to use,
|
8
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the
|
10
|
+
Software is furnished to do so, subject to the following
|
11
|
+
conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
18
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
20
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
21
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
22
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
23
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
24
|
+
=end
|
25
|
+
require File.expand_path("../../../lib/LitleOnline",__FILE__)
|
26
|
+
require 'test/unit'
|
27
|
+
|
28
|
+
#test UpdatePlan Transaction
|
29
|
+
module LitleOnline
|
30
|
+
class TestUpdatePlan < Test::Unit::TestCase
|
31
|
+
|
32
|
+
def test_simple_happy
|
33
|
+
hash ={
|
34
|
+
'merchantId' => '101',
|
35
|
+
'version'=>'8.8',
|
36
|
+
'reportGroup'=>'Planets',
|
37
|
+
'planCode'=>'planCodeString',
|
38
|
+
'active'=>'true'
|
39
|
+
}
|
40
|
+
|
41
|
+
response= LitleOnlineRequest.new.update_plan(hash)
|
42
|
+
assert_equal('Valid Format', response.message)
|
43
|
+
end
|
44
|
+
|
45
|
+
|
46
|
+
def test_simple_error
|
47
|
+
hash = {
|
48
|
+
'merchantId' => '101',
|
49
|
+
'version'=>'8.8',
|
50
|
+
'reportGroup'=>'Planets',
|
51
|
+
'planCode'=>'planCodeString',
|
52
|
+
}
|
53
|
+
|
54
|
+
response= LitleOnlineRequest.new.update_plan(hash)
|
55
|
+
assert(response.message =~ /Error validating xml data against the schema/)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,76 @@
|
|
1
|
+
=begin
|
2
|
+
Copyright (c) 2012 Litle & Co.
|
3
|
+
|
4
|
+
Permission is hereby granted, free of charge, to any person
|
5
|
+
obtaining a copy of this software and associated documentation
|
6
|
+
files (the "Software"), to deal in the Software without
|
7
|
+
restriction, including without limitation the rights to use,
|
8
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the
|
10
|
+
Software is furnished to do so, subject to the following
|
11
|
+
conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
18
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
20
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
21
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
22
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
23
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
24
|
+
=end
|
25
|
+
require File.expand_path("../../../lib/LitleOnline",__FILE__)
|
26
|
+
require 'test/unit'
|
27
|
+
|
28
|
+
#test Authorization Transaction
|
29
|
+
module LitleOnline
|
30
|
+
class TestUpdateSubscription < Test::Unit::TestCase
|
31
|
+
|
32
|
+
def test_simple_happy
|
33
|
+
hash = {
|
34
|
+
'merchantId' => '101',
|
35
|
+
'version'=>'8.8',
|
36
|
+
'reportGroup'=>'Planets',
|
37
|
+
'subscriptionId' =>'1001'
|
38
|
+
}
|
39
|
+
|
40
|
+
response= LitleOnlineRequest.new.update_subscription(hash)
|
41
|
+
assert_equal('Valid Format', response.message)
|
42
|
+
end
|
43
|
+
|
44
|
+
def test_simple_out_of_order
|
45
|
+
hash = {
|
46
|
+
'merchantId' => '101',
|
47
|
+
'version'=>'8.8',
|
48
|
+
'reportGroup'=>'Planets',
|
49
|
+
'subscriptionId' =>'1001',
|
50
|
+
'billingDate'=>'2014-03-11',
|
51
|
+
'planCode'=>'planCodeString',
|
52
|
+
'deleteDiscount'=>[{'discountCode'=>'discCode3'},{'discountCode'=>'discCode33'}],
|
53
|
+
'updateAddOn'=>[
|
54
|
+
{
|
55
|
+
'addOnCode'=>'addOnCode2',
|
56
|
+
}],
|
57
|
+
'deleteAddOn'=>[{'addOnCode'=>'addOnCode3'}]
|
58
|
+
|
59
|
+
}
|
60
|
+
|
61
|
+
response= LitleOnlineRequest.new.update_subscription(hash)
|
62
|
+
assert_equal('Valid Format', response.message)
|
63
|
+
end
|
64
|
+
|
65
|
+
def test_simple_error
|
66
|
+
hash = {
|
67
|
+
'merchantId' => '101',
|
68
|
+
'version'=>'8.8',
|
69
|
+
'reportGroup'=>'Planets',
|
70
|
+
}
|
71
|
+
|
72
|
+
response= LitleOnlineRequest.new.update_subscription(hash)
|
73
|
+
assert(response.message =~ /Error validating xml data against the schema/)
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
@@ -0,0 +1,427 @@
|
|
1
|
+
=begin
|
2
|
+
Copyright (c) 2012 Litle & Co.
|
3
|
+
|
4
|
+
Permission is hereby granted, free of charge, to any person
|
5
|
+
obtaining a copy of this software and associated documentation
|
6
|
+
files (the "Software"), to deal in the Software without
|
7
|
+
restriction, including without limitation the rights to use,
|
8
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the
|
10
|
+
Software is furnished to do so, subject to the following
|
11
|
+
conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
18
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
20
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
21
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
22
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
23
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
24
|
+
=end
|
25
|
+
require File.expand_path("../../../lib/LitleOnline",__FILE__)
|
26
|
+
require 'test/unit'
|
27
|
+
|
28
|
+
module LitleOnline
|
29
|
+
class TestXmlfields < Test::Unit::TestCase
|
30
|
+
def test_card_no_required_type_or_track
|
31
|
+
hash = {
|
32
|
+
'merchantId' => '101',
|
33
|
+
'version'=>'8.8',
|
34
|
+
'reportGroup'=>'Planets',
|
35
|
+
'litleTxnId'=>'123456',
|
36
|
+
'orderId'=>'12344',
|
37
|
+
'amount'=>'106',
|
38
|
+
'orderSource'=>'ecommerce',
|
39
|
+
'card'=>{
|
40
|
+
'number' =>'4100000000000001',
|
41
|
+
'expDate' =>'1210',
|
42
|
+
'cardValidationNum'=> '123'
|
43
|
+
}}
|
44
|
+
response= LitleOnlineRequest.new.sale(hash)
|
45
|
+
assert(response.message =~ /Error validating xml data against the schema/)
|
46
|
+
end
|
47
|
+
|
48
|
+
def test_simple_custom_billing
|
49
|
+
hash = {
|
50
|
+
'merchantId' => '101',
|
51
|
+
'version'=>'8.8',
|
52
|
+
'reportGroup'=>'Planets',
|
53
|
+
'litleTxnId'=>'123456',
|
54
|
+
'orderId'=>'12344',
|
55
|
+
'amount'=>'106',
|
56
|
+
'orderSource'=>'ecommerce',
|
57
|
+
'customBilling'=>{'phone'=>'123456789','descriptor'=>'good'},
|
58
|
+
'card'=>{
|
59
|
+
'type'=>'VI',
|
60
|
+
'number' =>'4100000000000000',
|
61
|
+
'expDate' =>'1210'
|
62
|
+
}}
|
63
|
+
response= LitleOnlineRequest.new.sale(hash)
|
64
|
+
assert_equal('Valid Format', response.message)
|
65
|
+
end
|
66
|
+
|
67
|
+
def test_bill_me_later
|
68
|
+
hash = {
|
69
|
+
'merchantId' => '101',
|
70
|
+
'version'=>'8.8',
|
71
|
+
'reportGroup'=>'Planets',
|
72
|
+
'litleTxnId'=>'123456',
|
73
|
+
'orderId'=>'12344',
|
74
|
+
'amount'=>'106',
|
75
|
+
'orderSource'=>'ecommerce',
|
76
|
+
'billMeLaterRequest'=>{'bmlMerchantId'=>'12345','preapprovalNumber'=>'12345678909023',
|
77
|
+
'customerPhoneChnaged'=>'False','itemCategoryCode'=>'2'},
|
78
|
+
'card'=>{
|
79
|
+
'type'=>'VI',
|
80
|
+
'number' =>'4100000000000000',
|
81
|
+
'expDate' =>'1210'
|
82
|
+
}}
|
83
|
+
response= LitleOnlineRequest.new.sale(hash)
|
84
|
+
assert_equal('000', response.saleResponse.response)
|
85
|
+
end
|
86
|
+
|
87
|
+
def test__customer_info
|
88
|
+
hash = {
|
89
|
+
'merchantId' => '101',
|
90
|
+
'version'=>'8.8',
|
91
|
+
'reportGroup'=>'Planets',
|
92
|
+
'litleTxnId'=>'123456',
|
93
|
+
'orderId'=>'12344',
|
94
|
+
'amount'=>'106',
|
95
|
+
'orderSource'=>'ecommerce',
|
96
|
+
'CustomerInfo'=>{'ssn'=>'12345','incomeAmount'=>'12345','incomeCurrency'=>'dollar','yearsAtResidence'=>'2'},
|
97
|
+
'card'=>{
|
98
|
+
'type'=>'VI',
|
99
|
+
'number' =>'4100000000000000',
|
100
|
+
'expDate' =>'1210'
|
101
|
+
}}
|
102
|
+
response= LitleOnlineRequest.new.sale(hash)
|
103
|
+
assert_equal('Valid Format', response.message)
|
104
|
+
end
|
105
|
+
|
106
|
+
def test_simple_bill_to_address
|
107
|
+
hash = {
|
108
|
+
'merchantId' => '101',
|
109
|
+
'version'=>'8.8',
|
110
|
+
'reportGroup'=>'Planets',
|
111
|
+
'orderId'=>'12344',
|
112
|
+
'amount'=>'106',
|
113
|
+
'orderSource'=>'ecommerce',
|
114
|
+
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'},
|
115
|
+
'card'=>{
|
116
|
+
'type'=>'VI',
|
117
|
+
'number' =>'4100000000000000',
|
118
|
+
'expDate' =>'1210'
|
119
|
+
}}
|
120
|
+
response= LitleOnlineRequest.new.authorization(hash)
|
121
|
+
assert_equal('Valid Format', response.message)
|
122
|
+
end
|
123
|
+
|
124
|
+
def test_processing_instructions
|
125
|
+
hash = {
|
126
|
+
'merchantId' => '101',
|
127
|
+
'version'=>'8.8',
|
128
|
+
'reportGroup'=>'Planets',
|
129
|
+
'orderId'=>'12344',
|
130
|
+
'amount'=>'106',
|
131
|
+
'orderSource'=>'ecommerce',
|
132
|
+
'processingInstructions'=>{'bypassVelocityCheck'=>'true'},
|
133
|
+
'card'=>{
|
134
|
+
'type'=>'VI',
|
135
|
+
'number' =>'4100000000000000',
|
136
|
+
'expDate' =>'1210'
|
137
|
+
}}
|
138
|
+
response= LitleOnlineRequest.new.authorization(hash)
|
139
|
+
assert_equal('Valid Format', response.message)
|
140
|
+
end
|
141
|
+
|
142
|
+
def test_pos
|
143
|
+
hash = {
|
144
|
+
'merchantId' => '101',
|
145
|
+
'version'=>'8.8',
|
146
|
+
'reportGroup'=>'Planets',
|
147
|
+
'orderId'=>'12344',
|
148
|
+
'amount'=>'106',
|
149
|
+
'orderSource'=>'ecommerce',
|
150
|
+
'pos'=>{'capability'=>'notused','entryMode'=>'track1','cardholderId'=>'pin'},
|
151
|
+
'card'=>{
|
152
|
+
'type'=>'VI',
|
153
|
+
'number' =>'4100000000000000',
|
154
|
+
'expDate' =>'1210'
|
155
|
+
}}
|
156
|
+
response= LitleOnlineRequest.new.authorization(hash)
|
157
|
+
assert_equal('Valid Format', response.message)
|
158
|
+
end
|
159
|
+
|
160
|
+
def test_amex_data
|
161
|
+
hash = {
|
162
|
+
'merchantId' => '101',
|
163
|
+
'version'=>'8.8',
|
164
|
+
'reportGroup'=>'Planets',
|
165
|
+
'orderId'=>'12344',
|
166
|
+
'amount'=>'106',
|
167
|
+
'card'=>{
|
168
|
+
'type'=>'VI',
|
169
|
+
'number' =>'4100000000000000',
|
170
|
+
'expDate' =>'1210'},
|
171
|
+
'orderSource'=>'ecommerce',
|
172
|
+
'amexAggregatorData'=>{'sellerMerchantCategoryCode'=>'1234','sellerId'=>'1234Id'}
|
173
|
+
}
|
174
|
+
response= LitleOnlineRequest.new.credit(hash)
|
175
|
+
assert_equal('Valid Format', response.message)
|
176
|
+
end
|
177
|
+
|
178
|
+
def test_amex_data_missing_seller_id
|
179
|
+
hash = {
|
180
|
+
'merchantId' => '101',
|
181
|
+
'version'=>'8.8',
|
182
|
+
'reportGroup'=>'Planets',
|
183
|
+
'orderId'=>'12344',
|
184
|
+
'amount'=>'106',
|
185
|
+
'orderSource'=>'ecommerce',
|
186
|
+
'card'=>{
|
187
|
+
'type'=>'VI',
|
188
|
+
'number' =>'4100000000000001',
|
189
|
+
'expDate' =>'1210'},
|
190
|
+
'amexAggregatorData'=>{'sellerMerchantCategoryCode'=>'1234'}
|
191
|
+
}
|
192
|
+
response= LitleOnlineRequest.new.credit(hash)
|
193
|
+
assert(response.message =~ /Error validating xml data against the schema/)
|
194
|
+
end
|
195
|
+
|
196
|
+
def test_simple_enhanced_data
|
197
|
+
hash = {
|
198
|
+
'merchantId' => '101',
|
199
|
+
'version'=>'8.8',
|
200
|
+
'reportGroup'=>'Planets',
|
201
|
+
'orderId'=>'12344',
|
202
|
+
'amount'=>'106',
|
203
|
+
'card'=>{
|
204
|
+
'type'=>'VI',
|
205
|
+
'number' =>'4100000000000000',
|
206
|
+
'expDate' =>'1210'},
|
207
|
+
'orderSource'=>'ecommerce',
|
208
|
+
'enhancedData'=>{
|
209
|
+
'customerReference'=>'Litle',
|
210
|
+
'salesTax'=>'50',
|
211
|
+
'deliveryType'=>'TBD',
|
212
|
+
'restriction'=>'DIG',
|
213
|
+
'shipFromPostalCode'=>'01741',
|
214
|
+
'destinationPostalCode'=>'01742'}
|
215
|
+
}
|
216
|
+
response= LitleOnlineRequest.new.credit(hash)
|
217
|
+
assert_equal('Valid Format', response.message)
|
218
|
+
end
|
219
|
+
|
220
|
+
def test_enhanced_data_with_detail_tax
|
221
|
+
hash = {
|
222
|
+
'merchantId' => '101',
|
223
|
+
'version'=>'8.8',
|
224
|
+
'reportGroup'=>'Planets',
|
225
|
+
'orderId'=>'12344',
|
226
|
+
'amount'=>'106',
|
227
|
+
'card'=>{
|
228
|
+
'type'=>'VI',
|
229
|
+
'number' =>'4100000000000000',
|
230
|
+
'expDate' =>'1210'},
|
231
|
+
'orderSource'=>'ecommerce',
|
232
|
+
'enhancedData'=>{
|
233
|
+
'detailtax'=>{'taxAmount'=>'1234','tax'=>'50'},
|
234
|
+
'customerReference'=>'Litle',
|
235
|
+
'salesTax'=>'50',
|
236
|
+
'deliveryType'=>'TBD',
|
237
|
+
'restriction'=>'DIG',
|
238
|
+
'shipFromPostalCode'=>'01741',
|
239
|
+
'destinationPostalCode'=>'01742'}
|
240
|
+
}
|
241
|
+
response= LitleOnlineRequest.new.credit(hash)
|
242
|
+
assert_equal('Valid Format', response.message)
|
243
|
+
end
|
244
|
+
|
245
|
+
def test_enhanced_data_with_line_item
|
246
|
+
hash = {
|
247
|
+
'merchantId' => '101',
|
248
|
+
'version'=>'8.8',
|
249
|
+
'reportGroup'=>'Planets',
|
250
|
+
'orderId'=>'12344',
|
251
|
+
'amount'=>'106',
|
252
|
+
'card'=>{
|
253
|
+
'type'=>'VI',
|
254
|
+
'number' =>'4100000000000000',
|
255
|
+
'expDate' =>'1210'}, 'processingInstructions'=>{'bypassVelocityCheck'=>'true'},
|
256
|
+
'orderSource'=>'ecommerce',
|
257
|
+
'lineItemData'=>{
|
258
|
+
'itemSequenceNumber'=>'98765',
|
259
|
+
'itemDescription'=>'VERYnice',
|
260
|
+
'productCode'=>'10010100',
|
261
|
+
'quantity'=>'7',
|
262
|
+
'unitOfMeasure'=>'pounds',
|
263
|
+
'enhancedData'=>{
|
264
|
+
'detailtax'=>{'taxAmount'=>'1234','tax'=>'50'}},
|
265
|
+
'customerReference'=>'Litle',
|
266
|
+
'salesTax'=>'50',
|
267
|
+
'deliveryType'=>'TBD',
|
268
|
+
'restriction'=>'DIG',
|
269
|
+
'shipFromPostalCode'=>'01741',
|
270
|
+
'destinationPostalCode'=>'01742'}
|
271
|
+
}
|
272
|
+
response= LitleOnlineRequest.new.credit(hash)
|
273
|
+
assert_equal('Valid Format', response.message)
|
274
|
+
end
|
275
|
+
|
276
|
+
def test_simple_token
|
277
|
+
hash = {
|
278
|
+
'merchantId' => '101',
|
279
|
+
'version'=>'8.8',
|
280
|
+
'reportGroup'=>'Planets',
|
281
|
+
'orderId'=>'12344',
|
282
|
+
'amount'=>'106',
|
283
|
+
'orderSource'=>'ecommerce',
|
284
|
+
'token'=> {
|
285
|
+
'litleToken'=>'123456789101112',
|
286
|
+
'expDate'=>'1210',
|
287
|
+
'cardValidationNum'=>'555',
|
288
|
+
'type'=>'VI'
|
289
|
+
}}
|
290
|
+
response= LitleOnlineRequest.new.credit(hash)
|
291
|
+
assert_equal('Valid Format', response.message)
|
292
|
+
end
|
293
|
+
|
294
|
+
def test_token_missing_exp_dat_and_valid_num
|
295
|
+
hash = {
|
296
|
+
'merchantId' => '101',
|
297
|
+
'version'=>'8.8',
|
298
|
+
'reportGroup'=>'Planets',
|
299
|
+
'orderId'=>'12344',
|
300
|
+
'amount'=>'106',
|
301
|
+
'orderSource'=>'ecommerce',
|
302
|
+
'token'=> {
|
303
|
+
'litleToken'=>'123456789101112',
|
304
|
+
'type'=>'VI'
|
305
|
+
}}
|
306
|
+
response= LitleOnlineRequest.new.credit(hash)
|
307
|
+
assert_equal('Valid Format', response.message)
|
308
|
+
end
|
309
|
+
|
310
|
+
def test_simple_paypage
|
311
|
+
hash = {
|
312
|
+
'merchantId' => '101',
|
313
|
+
'version'=>'8.8',
|
314
|
+
'reportGroup'=>'Planets',
|
315
|
+
'orderId'=>'12344',
|
316
|
+
'amount'=>'106',
|
317
|
+
'orderSource'=>'ecommerce',
|
318
|
+
'paypage'=> {
|
319
|
+
'paypageRegistrationId'=>'123456789101112',
|
320
|
+
'expDate'=>'1210',
|
321
|
+
'cardValidationNum'=>'555',
|
322
|
+
'type'=>'VI'
|
323
|
+
}}
|
324
|
+
response= LitleOnlineRequest.new.credit(hash)
|
325
|
+
assert_equal('Valid Format', response.message)
|
326
|
+
end
|
327
|
+
|
328
|
+
def test_paypage_missing_exp_dat_and_valid_num
|
329
|
+
hash = {
|
330
|
+
'merchantId' => '101',
|
331
|
+
'version'=>'8.8',
|
332
|
+
'reportGroup'=>'Planets',
|
333
|
+
'orderId'=>'12344',
|
334
|
+
'amount'=>'106',
|
335
|
+
'orderSource'=>'ecommerce',
|
336
|
+
'paypage'=> {
|
337
|
+
'paypageRegistrationId'=>'123456789101112',
|
338
|
+
'type'=>'VI'
|
339
|
+
}}
|
340
|
+
response= LitleOnlineRequest.new.credit(hash)
|
341
|
+
assert_equal('Valid Format', response.message)
|
342
|
+
end
|
343
|
+
|
344
|
+
def test_line_item_data
|
345
|
+
hash = {
|
346
|
+
'merchantId' => '101',
|
347
|
+
'version'=>'8.8',
|
348
|
+
'reportGroup'=>'Planets',
|
349
|
+
'orderId'=>'1',
|
350
|
+
'amount'=>'2',
|
351
|
+
'orderSource'=>'ecommerce',
|
352
|
+
'card'=>{
|
353
|
+
'type'=>'VI',
|
354
|
+
'number' =>'4100000000000001',
|
355
|
+
'expDate' =>'1210'
|
356
|
+
},
|
357
|
+
'enhancedData'=>
|
358
|
+
{
|
359
|
+
'lineItemData'=>[
|
360
|
+
{'itemSequenceNumber'=>'1', 'itemDescription'=>'desc1'},
|
361
|
+
{'itemSequenceNumber'=>'2', 'itemDescription'=>'desc2'}
|
362
|
+
]
|
363
|
+
}
|
364
|
+
}
|
365
|
+
response= LitleOnlineRequest.new.authorization(hash)
|
366
|
+
assert_equal('Valid Format', response.message)
|
367
|
+
end
|
368
|
+
|
369
|
+
def test_detail_tax
|
370
|
+
hash = {
|
371
|
+
'merchantId' => '101',
|
372
|
+
'version'=>'8.8',
|
373
|
+
'reportGroup'=>'Planets',
|
374
|
+
'orderId'=>'1',
|
375
|
+
'amount'=>'2',
|
376
|
+
'orderSource'=>'ecommerce',
|
377
|
+
'card'=>{
|
378
|
+
'type'=>'VI',
|
379
|
+
'number' =>'4100000000000001',
|
380
|
+
'expDate' =>'1210'
|
381
|
+
},
|
382
|
+
'enhancedData'=>
|
383
|
+
{
|
384
|
+
'detailTax'=>[
|
385
|
+
{'taxIncludedInTotal'=>'true', 'taxAmount'=>'0'},
|
386
|
+
{'taxIncludedInTotal'=>'false', 'taxAmount'=>'1'}
|
387
|
+
]
|
388
|
+
}
|
389
|
+
}
|
390
|
+
response= LitleOnlineRequest.new.authorization(hash)
|
391
|
+
assert_equal('Valid Format', response.message)
|
392
|
+
end
|
393
|
+
|
394
|
+
def test_detail_tax_in_lineItem
|
395
|
+
hash = {
|
396
|
+
'merchantId' => '101',
|
397
|
+
'version'=>'8.8',
|
398
|
+
'reportGroup'=>'Planets',
|
399
|
+
'orderId'=>'1',
|
400
|
+
'amount'=>'2',
|
401
|
+
'orderSource'=>'ecommerce',
|
402
|
+
'card'=>{
|
403
|
+
'type'=>'VI',
|
404
|
+
'number' =>'4100000000000001',
|
405
|
+
'expDate' =>'1210'
|
406
|
+
},
|
407
|
+
'enhancedData'=>
|
408
|
+
{
|
409
|
+
'lineItemData'=>[
|
410
|
+
{'itemSequenceNumber'=>'1', 'itemDescription'=>'desc1','detailTax'=>[
|
411
|
+
{'taxAmount'=>'1'},
|
412
|
+
{'taxAmount'=>'2'}]
|
413
|
+
},
|
414
|
+
{'itemSequenceNumber'=>'2', 'itemDescription'=>'desc2','detailTax'=>[
|
415
|
+
{'taxAmount'=>'3'},
|
416
|
+
{'taxAmount'=>'4'}]
|
417
|
+
}],
|
418
|
+
'detailTax'=>[
|
419
|
+
{'taxAmount'=>'5'},
|
420
|
+
{'taxAmount'=>'6'}
|
421
|
+
]}
|
422
|
+
}
|
423
|
+
response= LitleOnlineRequest.new.authorization(hash)
|
424
|
+
assert_equal('Valid Format', response.message)
|
425
|
+
end
|
426
|
+
end
|
427
|
+
end
|