LitleOnline 8.19.0 → 8.25.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/CHANGELOG +34 -0
- data/README.md +1 -1
- data/Rakefile +2 -2
- data/bin/Setup.rb +16 -6
- data/lib/LitleBatchRequest.rb +85 -2
- data/lib/LitleOnlineRequest.rb +108 -5
- data/lib/LitleRequest.rb +14 -9
- data/lib/LitleTransaction.rb +152 -3
- data/lib/XMLFields.rb +441 -7
- data/test/functional/test_activate.rb +100 -0
- data/test/functional/test_activateReversal.rb +56 -0
- data/test/functional/test_auth.rb +38 -1
- data/test/functional/test_balanceInquiry.rb +80 -0
- data/test/functional/test_batchStream.rb +145 -0
- data/test/functional/test_cancelSubscription.rb +55 -0
- data/test/functional/test_captureGivenAuth.rb +32 -2
- data/test/functional/test_createPlan.rb +85 -0
- data/test/functional/test_credit.rb +22 -1
- 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_forceCapture.rb +23 -1
- data/test/functional/test_litle_requests.rb +3 -2
- data/test/functional/test_load.rb +82 -0
- data/test/functional/test_loadReversal.rb +56 -0
- data/test/functional/test_refundReversal.rb +56 -0
- data/test/functional/test_sale.rb +23 -1
- data/test/functional/test_unload.rb +82 -0
- data/test/functional/test_unloadReversal.rb +56 -0
- data/test/functional/test_updatePlan.rb +58 -0
- data/test/functional/test_updateSubscription.rb +76 -0
- data/test/functional/ts_all.rb +21 -2
- data/test/unit/test_LitleBatchRequest.rb +47 -2
- data/test/unit/test_LitleOnlineRequest.rb +2 -2
- data/test/unit/test_activate.rb +92 -0
- data/test/{functional/ts_all.rb~ → unit/test_activateReversal.rb} +17 -17
- data/test/unit/test_auth.rb +37 -3
- data/test/unit/test_balanceInquiry.rb +52 -0
- data/test/unit/test_cancelSubscription.rb +43 -0
- data/test/unit/test_captureGivenAuth.rb +44 -2
- data/test/unit/test_createPlan.rb +52 -0
- data/test/unit/test_credit.rb +3 -2
- 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_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 +18 -1
- data/test/unit/test_unload.rb +53 -0
- data/test/unit/test_unloadReversal.rb +44 -0
- data/test/unit/test_updatePlan.rb +45 -0
- data/test/unit/test_updateSubscription.rb +172 -0
- data/test/unit/test_xmlfields.rb +395 -0
- data/test/unit/ts_unit.rb +19 -2
- metadata +51 -34
- data/CHANGELOG~ +0 -81
- data/Rakefile~ +0 -93
- data/lib/LitleOnlineRequest.rb~ +0 -198
- data/lib/LitleRequest.rb~ +0 -513
- data/lib/LitleTransaction.rb~ +0 -297
- data/lib/XMLFields.rb~ +0 -1380
- data/test/unit/test_LitleOnlineRequest.rb~ +0 -296
- data/test/unit/test_sale.rb~ +0 -390
- data/test/unit/test_xmlfields.rb~ +0 -2515
@@ -0,0 +1,45 @@
|
|
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 'lib/LitleOnline'
|
26
|
+
require 'test/unit'
|
27
|
+
|
28
|
+
module LitleOnline
|
29
|
+
class TestUpdatePlan < Test::Unit::TestCase
|
30
|
+
|
31
|
+
def test_simple
|
32
|
+
hash ={
|
33
|
+
'merchantId' => '101',
|
34
|
+
'version'=>'8.8',
|
35
|
+
'reportGroup'=>'Planets',
|
36
|
+
'planCode'=>'planCodeString',
|
37
|
+
'active'=>'true'
|
38
|
+
}
|
39
|
+
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<updatePlan><planCode>planCodeString<\/planCode><active>true<\/active><\/updatePlan>.*/m), is_a(Hash))
|
40
|
+
LitleOnlineRequest.new.update_plan(hash)
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|
@@ -0,0 +1,172 @@
|
|
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 'lib/LitleOnline'
|
26
|
+
require 'test/unit'
|
27
|
+
require 'mocha/setup'
|
28
|
+
|
29
|
+
module LitleOnline
|
30
|
+
class TestUpdateSubscription < Test::Unit::TestCase
|
31
|
+
|
32
|
+
def test_simple
|
33
|
+
hash = {
|
34
|
+
'subscriptionId' =>'100',
|
35
|
+
'merchantId' => '101',
|
36
|
+
'version'=>'8.8',
|
37
|
+
}
|
38
|
+
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<updateSubscription><subscriptionId>100<\/subscriptionId><\/updateSubscription>.*/m), is_a(Hash))
|
39
|
+
LitleOnlineRequest.new.update_subscription(hash)
|
40
|
+
end
|
41
|
+
|
42
|
+
def test_allFields
|
43
|
+
hash = {
|
44
|
+
'subscriptionId' =>'100',
|
45
|
+
'merchantId' => '101',
|
46
|
+
'version'=>'8.8',
|
47
|
+
'reportGroup'=>'Planets',
|
48
|
+
'planCode' => 'planCodeString',
|
49
|
+
'billToAddress' =>
|
50
|
+
{
|
51
|
+
'name' =>'nameString'
|
52
|
+
},
|
53
|
+
'card'=>
|
54
|
+
{
|
55
|
+
'type'=>'VI',
|
56
|
+
'number' =>'4100000000000001',
|
57
|
+
'expDate' =>'1210'
|
58
|
+
},
|
59
|
+
'billingDate' =>'2014-03-11'
|
60
|
+
}
|
61
|
+
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<updateSubscription><subscriptionId>100<\/subscriptionId><planCode>planCodeString<\/planCode><billToAddress><name>nameString<\/name><\/billToAddress><card><type>VI<\/type><number>4100000000000001<\/number><expDate>1210<\/expDate><\/card><billingDate>2014-03-11<\/billingDate><\/updateSubscription>.*/m), is_a(Hash))
|
62
|
+
LitleOnlineRequest.new.update_subscription(hash)
|
63
|
+
end
|
64
|
+
|
65
|
+
def test_update_subscription_token
|
66
|
+
hash = {
|
67
|
+
'merchantId' => '101',
|
68
|
+
'version'=>'8.8',
|
69
|
+
'reportGroup'=>'Planets',
|
70
|
+
'subscriptionId' => '1000',
|
71
|
+
'planCode' => 'planCodeString',
|
72
|
+
'billToAddress' =>
|
73
|
+
{
|
74
|
+
'name' =>'nameString'
|
75
|
+
},
|
76
|
+
'token'=>
|
77
|
+
{
|
78
|
+
'litleToken'=>'litleTokenString'
|
79
|
+
},
|
80
|
+
'billingDate' =>'2014-03-11',
|
81
|
+
'createDiscount'=>[
|
82
|
+
{
|
83
|
+
'discountCode'=>'discCode1',
|
84
|
+
'name'=>'name1',
|
85
|
+
'amount'=>'500',
|
86
|
+
'startDate'=>'2014-03-12',
|
87
|
+
'endDate'=>'2014-03-12',
|
88
|
+
},
|
89
|
+
{
|
90
|
+
'discountCode'=>'discCode11',
|
91
|
+
'name'=>'name11',
|
92
|
+
'amount'=>'5000',
|
93
|
+
'startDate'=>'2014-03-12',
|
94
|
+
'endDate'=>'2014-03-12',
|
95
|
+
}],
|
96
|
+
'updateDiscount'=>[
|
97
|
+
{
|
98
|
+
'discountCode'=>'discCode2',
|
99
|
+
}],
|
100
|
+
'createAddOn'=>[
|
101
|
+
{
|
102
|
+
'addOnCode'=>'addOnCode1',
|
103
|
+
'name'=>'name1',
|
104
|
+
'amount'=>'500',
|
105
|
+
'startDate'=>'2014-03-12',
|
106
|
+
'endDate'=>'2014-03-12',
|
107
|
+
}],
|
108
|
+
'updateAddOn'=>[
|
109
|
+
{
|
110
|
+
'addOnCode'=>'addOnCode2',
|
111
|
+
}],
|
112
|
+
'deleteAddOn'=>[{'addOnCode'=>'addOnCode3'}]
|
113
|
+
}
|
114
|
+
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<updateSubscription><subscriptionId>1000<\/subscriptionId><planCode>planCodeString<\/planCode><billToAddress><name>nameString<\/name><\/billToAddress><token><litleToken>litleTokenString<\/litleToken><\/token><billingDate>2014-03-11<\/billingDate><createDiscount><discountCode>discCode1<\/discountCode><name>name1<\/name><amount>500<\/amount><startDate>2014-03-12<\/startDate><endDate>2014-03-12<\/endDate><\/createDiscount><createDiscount><discountCode>discCode11<\/discountCode><name>name11<\/name><amount>5000<\/amount><startDate>2014-03-12<\/startDate><endDate>2014-03-12<\/endDate><\/createDiscount><updateDiscount><discountCode>discCode2<\/discountCode><\/updateDiscount><createAddOn><addOnCode>addOnCode1<\/addOnCode><name>name1<\/name><amount>500<\/amount><startDate>2014-03-12<\/startDate><endDate>2014-03-12<\/endDate><\/createAddOn><updateAddOn><addOnCode>addOnCode2<\/addOnCode><\/updateAddOn><deleteAddOn><addOnCode>addOnCode3<\/addOnCode><\/deleteAddOn><\/updateSubscription>.*/m), is_a(Hash))
|
115
|
+
LitleOnlineRequest.new.update_subscription(hash)
|
116
|
+
end
|
117
|
+
|
118
|
+
def test_update_subscription_paypage
|
119
|
+
hash = {
|
120
|
+
'merchantId' => '101',
|
121
|
+
'version'=>'8.8',
|
122
|
+
'reportGroup'=>'Planets',
|
123
|
+
'subscriptionId' => '1000',
|
124
|
+
'planCode' => 'planCodeString',
|
125
|
+
'billToAddress' =>
|
126
|
+
{
|
127
|
+
'name' =>'nameString'
|
128
|
+
},
|
129
|
+
'paypage'=>
|
130
|
+
{
|
131
|
+
'paypageRegistrationId'=>'paypageString'
|
132
|
+
},
|
133
|
+
'billingDate' =>'2014-03-11',
|
134
|
+
'createDiscount'=>[
|
135
|
+
{
|
136
|
+
'discountCode'=>'discCode1',
|
137
|
+
'name'=>'name1',
|
138
|
+
'amount'=>'500',
|
139
|
+
'startDate'=>'2014-03-12',
|
140
|
+
'endDate'=>'2014-03-12',
|
141
|
+
},
|
142
|
+
{
|
143
|
+
'discountCode'=>'discCode11',
|
144
|
+
'name'=>'name11',
|
145
|
+
'amount'=>'5000',
|
146
|
+
'startDate'=>'2014-03-12',
|
147
|
+
'endDate'=>'2014-03-12',
|
148
|
+
}],
|
149
|
+
'updateDiscount'=>[
|
150
|
+
{
|
151
|
+
'discountCode'=>'discCode2',
|
152
|
+
}],
|
153
|
+
'deleteDiscount'=>[{'discountCode'=>'discCode3'},{'discountCode'=>'discCode33'}],
|
154
|
+
'createAddOn'=>[
|
155
|
+
{
|
156
|
+
'addOnCode'=>'addOnCode1',
|
157
|
+
'name'=>'name1',
|
158
|
+
'amount'=>'500',
|
159
|
+
'startDate'=>'2014-03-12',
|
160
|
+
'endDate'=>'2014-03-12',
|
161
|
+
}],
|
162
|
+
'updateAddOn'=>[
|
163
|
+
{
|
164
|
+
'addOnCode'=>'addOnCode2',
|
165
|
+
}],
|
166
|
+
}
|
167
|
+
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<updateSubscription><subscriptionId>1000<\/subscriptionId><planCode>planCodeString<\/planCode><billToAddress><name>nameString<\/name><\/billToAddress><paypage><paypageRegistrationId>paypageString<\/paypageRegistrationId><\/paypage><billingDate>2014-03-11<\/billingDate><createDiscount><discountCode>discCode1<\/discountCode><name>name1<\/name><amount>500<\/amount><startDate>2014-03-12<\/startDate><endDate>2014-03-12<\/endDate><\/createDiscount><createDiscount><discountCode>discCode11<\/discountCode><name>name11<\/name><amount>5000<\/amount><startDate>2014-03-12<\/startDate><endDate>2014-03-12<\/endDate><\/createDiscount><updateDiscount><discountCode>discCode2<\/discountCode><\/updateDiscount><deleteDiscount><discountCode>discCode3<\/discountCode><\/deleteDiscount><deleteDiscount><discountCode>discCode33<\/discountCode><\/deleteDiscount><createAddOn><addOnCode>addOnCode1<\/addOnCode><name>name1<\/name><amount>500<\/amount><startDate>2014-03-12<\/startDate><endDate>2014-03-12<\/endDate><\/createAddOn><updateAddOn><addOnCode>addOnCode2<\/addOnCode><\/updateAddOn><\/updateSubscription>.*/m), is_a(Hash))
|
168
|
+
LitleOnlineRequest.new.update_subscription(hash)
|
169
|
+
end
|
170
|
+
end
|
171
|
+
|
172
|
+
end
|
data/test/unit/test_xmlfields.rb
CHANGED
@@ -2531,5 +2531,400 @@ module LitleOnline
|
|
2531
2531
|
LitleOnlineRequest.new.authorization(hash)
|
2532
2532
|
end
|
2533
2533
|
|
2534
|
+
def test_subscription_type_discount_addOn
|
2535
|
+
hash = {
|
2536
|
+
'merchantId' => '101',
|
2537
|
+
'version'=>'8.8',
|
2538
|
+
'reportGroup'=>'Planets',
|
2539
|
+
'recurringRequest'=> {
|
2540
|
+
'subscription'=>
|
2541
|
+
{
|
2542
|
+
'planCode'=>'planCodeString',
|
2543
|
+
'numberOfPayments'=>'10',
|
2544
|
+
'startDate'=>'2014-03-07',
|
2545
|
+
'amount'=>'100',
|
2546
|
+
'createDiscount'=>[
|
2547
|
+
{
|
2548
|
+
'discountCode'=>'discCode1',
|
2549
|
+
'name'=>'name1',
|
2550
|
+
'amount'=>'500',
|
2551
|
+
'startDate'=>'2014-03-12',
|
2552
|
+
'endDate'=>'2014-03-12',
|
2553
|
+
},
|
2554
|
+
{
|
2555
|
+
'discountCode'=>'discCode11',
|
2556
|
+
'name'=>'name11',
|
2557
|
+
'amount'=>'5000',
|
2558
|
+
'startDate'=>'2014-03-12',
|
2559
|
+
'endDate'=>'2014-03-12',
|
2560
|
+
}],
|
2561
|
+
'createAddOn'=>[
|
2562
|
+
{
|
2563
|
+
'addOnCode'=>'addOnCode1',
|
2564
|
+
'name'=>'name1',
|
2565
|
+
'amount'=>'500',
|
2566
|
+
'startDate'=>'2014-03-12',
|
2567
|
+
'endDate'=>'2014-03-12',
|
2568
|
+
}]
|
2569
|
+
}
|
2570
|
+
}
|
2571
|
+
}
|
2572
|
+
|
2573
|
+
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<subscription>.*<planCode>planCodeString<\/planCode><numberOfPayments>10<\/numberOfPayments><startDate>2014-03-07<\/startDate><amount>100<\/amount><createDiscount><discountCode>discCode1<\/discountCode><name>name1<\/name><amount>500<\/amount><startDate>2014-03-12<\/startDate><endDate>2014-03-12<\/endDate><\/createDiscount><createDiscount><discountCode>discCode11<\/discountCode><name>name11<\/name><amount>5000<\/amount><startDate>2014-03-12<\/startDate><endDate>2014-03-12<\/endDate><\/createDiscount><createAddOn><addOnCode>addOnCode1<\/addOnCode><name>name1<\/name><amount>500<\/amount><startDate>2014-03-12<\/startDate><endDate>2014-03-12<\/endDate><\/createAddOn><\/subscription>.*/m), is_a(Hash))
|
2574
|
+
LitleOnlineRequest.new.authorization(hash)
|
2575
|
+
end
|
2576
|
+
|
2577
|
+
def test_cancel_subscription
|
2578
|
+
hash = {
|
2579
|
+
'merchantId' => '101',
|
2580
|
+
'version'=>'8.8',
|
2581
|
+
'reportGroup'=>'Planets',
|
2582
|
+
'subscriptionId' => '1000'
|
2583
|
+
}
|
2584
|
+
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<cancelSubscription><subscriptionId>1000<\/subscriptionId><\/cancelSubscription>.*/m), is_a(Hash))
|
2585
|
+
LitleOnlineRequest.new.cancel_subscription(hash)
|
2586
|
+
end
|
2587
|
+
|
2588
|
+
def test_update_subscription_card
|
2589
|
+
hash = {
|
2590
|
+
'merchantId' => '101',
|
2591
|
+
'version'=>'8.8',
|
2592
|
+
'reportGroup'=>'Planets',
|
2593
|
+
'subscriptionId' => '1000',
|
2594
|
+
'planCode' => 'planCodeString',
|
2595
|
+
'billToAddress' =>
|
2596
|
+
{
|
2597
|
+
'name' =>'nameString'
|
2598
|
+
},
|
2599
|
+
'card'=>
|
2600
|
+
{
|
2601
|
+
'type'=>'VI',
|
2602
|
+
'number' =>'4100000000000001',
|
2603
|
+
'expDate' =>'1210'
|
2604
|
+
},
|
2605
|
+
'billingDate' =>'2014-03-11',
|
2606
|
+
'createDiscount'=>[
|
2607
|
+
{
|
2608
|
+
'discountCode'=>'discCode1',
|
2609
|
+
'name'=>'name1',
|
2610
|
+
'amount'=>'500',
|
2611
|
+
'startDate'=>'2014-03-12',
|
2612
|
+
'endDate'=>'2014-03-12',
|
2613
|
+
},
|
2614
|
+
{
|
2615
|
+
'discountCode'=>'discCode11',
|
2616
|
+
'name'=>'name11',
|
2617
|
+
'amount'=>'5000',
|
2618
|
+
'startDate'=>'2014-03-12',
|
2619
|
+
'endDate'=>'2014-03-12',
|
2620
|
+
}],
|
2621
|
+
'updateDiscount'=>[
|
2622
|
+
{
|
2623
|
+
'discountCode'=>'discCode2',
|
2624
|
+
}],
|
2625
|
+
'deleteDiscount'=>[{'discountCode'=>'discCode3'},{'discountCode'=>'discCode33'}],
|
2626
|
+
'createAddOn'=>[
|
2627
|
+
{
|
2628
|
+
'addOnCode'=>'addOnCode1',
|
2629
|
+
'name'=>'name1',
|
2630
|
+
'amount'=>'500',
|
2631
|
+
'startDate'=>'2014-03-12',
|
2632
|
+
'endDate'=>'2014-03-12',
|
2633
|
+
}],
|
2634
|
+
'updateAddOn'=>[
|
2635
|
+
{
|
2636
|
+
'addOnCode'=>'addOnCode2',
|
2637
|
+
}],
|
2638
|
+
}
|
2639
|
+
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<updateSubscription><subscriptionId>1000<\/subscriptionId><planCode>planCodeString<\/planCode><billToAddress><name>nameString<\/name><\/billToAddress><card><type>VI<\/type><number>4100000000000001<\/number><expDate>1210<\/expDate><\/card><billingDate>2014-03-11<\/billingDate><createDiscount><discountCode>discCode1<\/discountCode><name>name1<\/name><amount>500<\/amount><startDate>2014-03-12<\/startDate><endDate>2014-03-12<\/endDate><\/createDiscount><createDiscount><discountCode>discCode11<\/discountCode><name>name11<\/name><amount>5000<\/amount><startDate>2014-03-12<\/startDate><endDate>2014-03-12<\/endDate><\/createDiscount><updateDiscount><discountCode>discCode2<\/discountCode><\/updateDiscount><deleteDiscount><discountCode>discCode3<\/discountCode><\/deleteDiscount><deleteDiscount><discountCode>discCode33<\/discountCode><\/deleteDiscount><createAddOn><addOnCode>addOnCode1<\/addOnCode><name>name1<\/name><amount>500<\/amount><startDate>2014-03-12<\/startDate><endDate>2014-03-12<\/endDate><\/createAddOn><updateAddOn><addOnCode>addOnCode2<\/addOnCode><\/updateAddOn><\/updateSubscription>.*/m), is_a(Hash))
|
2640
|
+
LitleOnlineRequest.new.update_subscription(hash)
|
2641
|
+
end
|
2642
|
+
|
2643
|
+
def test_update_subscription_token
|
2644
|
+
hash = {
|
2645
|
+
'merchantId' => '101',
|
2646
|
+
'version'=>'8.8',
|
2647
|
+
'reportGroup'=>'Planets',
|
2648
|
+
'subscriptionId' => '1000',
|
2649
|
+
'planCode' => 'planCodeString',
|
2650
|
+
'billToAddress' =>
|
2651
|
+
{
|
2652
|
+
'name' =>'nameString'
|
2653
|
+
},
|
2654
|
+
'token'=>
|
2655
|
+
{
|
2656
|
+
'litleToken'=>'litleTokenString'
|
2657
|
+
},
|
2658
|
+
'billingDate' =>'2014-03-11',
|
2659
|
+
'createDiscount'=>[
|
2660
|
+
{
|
2661
|
+
'discountCode'=>'discCode1',
|
2662
|
+
'name'=>'name1',
|
2663
|
+
'amount'=>'500',
|
2664
|
+
'startDate'=>'2014-03-12',
|
2665
|
+
'endDate'=>'2014-03-12',
|
2666
|
+
},
|
2667
|
+
{
|
2668
|
+
'discountCode'=>'discCode11',
|
2669
|
+
'name'=>'name11',
|
2670
|
+
'amount'=>'5000',
|
2671
|
+
'startDate'=>'2014-03-12',
|
2672
|
+
'endDate'=>'2014-03-12',
|
2673
|
+
}],
|
2674
|
+
'updateDiscount'=>[
|
2675
|
+
{
|
2676
|
+
'discountCode'=>'discCode2',
|
2677
|
+
}],
|
2678
|
+
'createAddOn'=>[
|
2679
|
+
{
|
2680
|
+
'addOnCode'=>'addOnCode1',
|
2681
|
+
'name'=>'name1',
|
2682
|
+
'amount'=>'500',
|
2683
|
+
'startDate'=>'2014-03-12',
|
2684
|
+
'endDate'=>'2014-03-12',
|
2685
|
+
}],
|
2686
|
+
'updateAddOn'=>[
|
2687
|
+
{
|
2688
|
+
'addOnCode'=>'addOnCode2',
|
2689
|
+
}],
|
2690
|
+
'deleteAddOn'=>[{'addOnCode'=>'addOnCode3'}]
|
2691
|
+
}
|
2692
|
+
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<updateSubscription><subscriptionId>1000<\/subscriptionId><planCode>planCodeString<\/planCode><billToAddress><name>nameString<\/name><\/billToAddress><token><litleToken>litleTokenString<\/litleToken><\/token><billingDate>2014-03-11<\/billingDate><createDiscount><discountCode>discCode1<\/discountCode><name>name1<\/name><amount>500<\/amount><startDate>2014-03-12<\/startDate><endDate>2014-03-12<\/endDate><\/createDiscount><createDiscount><discountCode>discCode11<\/discountCode><name>name11<\/name><amount>5000<\/amount><startDate>2014-03-12<\/startDate><endDate>2014-03-12<\/endDate><\/createDiscount><updateDiscount><discountCode>discCode2<\/discountCode><\/updateDiscount><createAddOn><addOnCode>addOnCode1<\/addOnCode><name>name1<\/name><amount>500<\/amount><startDate>2014-03-12<\/startDate><endDate>2014-03-12<\/endDate><\/createAddOn><updateAddOn><addOnCode>addOnCode2<\/addOnCode><\/updateAddOn><deleteAddOn><addOnCode>addOnCode3<\/addOnCode><\/deleteAddOn><\/updateSubscription>.*/m), is_a(Hash))
|
2693
|
+
LitleOnlineRequest.new.update_subscription(hash)
|
2694
|
+
end
|
2695
|
+
|
2696
|
+
def test_activate
|
2697
|
+
hash = {
|
2698
|
+
'merchantId' => '101',
|
2699
|
+
'version'=>'8.8',
|
2700
|
+
'reportGroup'=>'Planets',
|
2701
|
+
'orderId' => '11',
|
2702
|
+
'amount' => '500',
|
2703
|
+
'orderSource'=>'ecommerce',
|
2704
|
+
'card'=>
|
2705
|
+
{
|
2706
|
+
'type'=>'VI',
|
2707
|
+
'number' =>'4100000000000001',
|
2708
|
+
'expDate' =>'1210'
|
2709
|
+
}
|
2710
|
+
}
|
2711
|
+
|
2712
|
+
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<activate reportGroup="Planets"><orderId>11<\/orderId><amount>500<\/amount><orderSource>ecommerce<\/orderSource><card><type>VI<\/type><number>4100000000000001<\/number><expDate>1210<\/expDate><\/card><\/activate>.*/m), is_a(Hash))
|
2713
|
+
LitleOnlineRequest.new.activate(hash)
|
2714
|
+
end
|
2715
|
+
|
2716
|
+
def test_deactivate
|
2717
|
+
hash = {
|
2718
|
+
'merchantId' => '101',
|
2719
|
+
'version'=>'8.8',
|
2720
|
+
'reportGroup'=>'Planets',
|
2721
|
+
'orderId' => '11',
|
2722
|
+
'orderSource'=>'ecommerce',
|
2723
|
+
'card'=>
|
2724
|
+
{
|
2725
|
+
'type'=>'VI',
|
2726
|
+
'number' =>'4100000000000001',
|
2727
|
+
'expDate' =>'1210'
|
2728
|
+
}
|
2729
|
+
}
|
2730
|
+
|
2731
|
+
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<deactivate reportGroup="Planets"><orderId>11<\/orderId><orderSource>ecommerce<\/orderSource><card><type>VI<\/type><number>4100000000000001<\/number><expDate>1210<\/expDate><\/card><\/deactivate>.*/m), is_a(Hash))
|
2732
|
+
LitleOnlineRequest.new.deactivate(hash)
|
2733
|
+
end
|
2734
|
+
|
2735
|
+
def test_load
|
2736
|
+
hash = {
|
2737
|
+
'merchantId' => '101',
|
2738
|
+
'version'=>'8.8',
|
2739
|
+
'reportGroup'=>'Planets',
|
2740
|
+
'orderId' => '11',
|
2741
|
+
'amount' => '500',
|
2742
|
+
'orderSource'=>'ecommerce',
|
2743
|
+
'card'=>
|
2744
|
+
{
|
2745
|
+
'type'=>'VI',
|
2746
|
+
'number' =>'4100000000000001',
|
2747
|
+
'expDate' =>'1210'
|
2748
|
+
}
|
2749
|
+
}
|
2750
|
+
|
2751
|
+
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<load reportGroup="Planets"><orderId>11<\/orderId><amount>500<\/amount><orderSource>ecommerce<\/orderSource><card><type>VI<\/type><number>4100000000000001<\/number><expDate>1210<\/expDate><\/card><\/load>.*/m), is_a(Hash))
|
2752
|
+
LitleOnlineRequest.new.load_request(hash)
|
2753
|
+
end
|
2754
|
+
|
2755
|
+
def test_unload
|
2756
|
+
hash = {
|
2757
|
+
'merchantId' => '101',
|
2758
|
+
'version'=>'8.8',
|
2759
|
+
'reportGroup'=>'Planets',
|
2760
|
+
'orderId' => '11',
|
2761
|
+
'amount' => '500',
|
2762
|
+
'orderSource'=>'ecommerce',
|
2763
|
+
'card'=>
|
2764
|
+
{
|
2765
|
+
'type'=>'VI',
|
2766
|
+
'number' =>'4100000000000001',
|
2767
|
+
'expDate' =>'1210'
|
2768
|
+
}
|
2769
|
+
}
|
2770
|
+
|
2771
|
+
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<unload reportGroup="Planets"><orderId>11<\/orderId><amount>500<\/amount><orderSource>ecommerce<\/orderSource><card><type>VI<\/type><number>4100000000000001<\/number><expDate>1210<\/expDate><\/card><\/unload>.*/m), is_a(Hash))
|
2772
|
+
LitleOnlineRequest.new.unload_request(hash)
|
2773
|
+
end
|
2774
|
+
|
2775
|
+
def test_balanceInquiry
|
2776
|
+
hash = {
|
2777
|
+
'merchantId' => '101',
|
2778
|
+
'version'=>'8.8',
|
2779
|
+
'reportGroup'=>'Planets',
|
2780
|
+
'orderId' => '11',
|
2781
|
+
'orderSource'=>'ecommerce',
|
2782
|
+
'card'=>
|
2783
|
+
{
|
2784
|
+
'type'=>'VI',
|
2785
|
+
'number' =>'4100000000000001',
|
2786
|
+
'expDate' =>'1210'
|
2787
|
+
}
|
2788
|
+
}
|
2789
|
+
|
2790
|
+
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<balanceInquiry reportGroup="Planets"><orderId>11<\/orderId><orderSource>ecommerce<\/orderSource><card><type>VI<\/type><number>4100000000000001<\/number><expDate>1210<\/expDate><\/card><\/balanceInquiry>.*/m), is_a(Hash))
|
2791
|
+
LitleOnlineRequest.new.balance_inquiry(hash)
|
2792
|
+
end
|
2793
|
+
|
2794
|
+
def test_createPlan
|
2795
|
+
hash ={
|
2796
|
+
'merchantId' => '101',
|
2797
|
+
'version'=>'8.8',
|
2798
|
+
'reportGroup'=>'Planets',
|
2799
|
+
'planCode'=>'planCodeString',
|
2800
|
+
'name'=>'nameString',
|
2801
|
+
'description'=>'descriptionString',
|
2802
|
+
'intervalType'=>'ANNUAL',
|
2803
|
+
'amount'=>'500',
|
2804
|
+
'numberOfPayments'=>'2',
|
2805
|
+
'trialNumberOfIntervals'=>'1',
|
2806
|
+
'trialIntervalType'=>'MONTH',
|
2807
|
+
'active'=>'true'
|
2808
|
+
}
|
2809
|
+
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<createPlan><planCode>planCodeString<\/planCode><name>nameString<\/name><description>descriptionString<\/description><intervalType>ANNUAL<\/intervalType><amount>500<\/amount><numberOfPayments>2<\/numberOfPayments><trialNumberOfIntervals>1<\/trialNumberOfIntervals><trialIntervalType>MONTH<\/trialIntervalType><active>true<\/active><\/createPlan>.*/m), is_a(Hash))
|
2810
|
+
LitleOnlineRequest.new.create_plan(hash)
|
2811
|
+
end
|
2812
|
+
|
2813
|
+
def test_updatePlan
|
2814
|
+
hash={
|
2815
|
+
'merchantId' => '101',
|
2816
|
+
'version'=>'8.8',
|
2817
|
+
'reportGroup'=>'Planets',
|
2818
|
+
'planCode'=>'planCodeString',
|
2819
|
+
'active'=>'true'
|
2820
|
+
}
|
2821
|
+
|
2822
|
+
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<updatePlan><planCode>planCodeString<\/planCode><active>true<\/active><\/updatePlan>.*/m), is_a(Hash))
|
2823
|
+
LitleOnlineRequest.new.update_plan(hash)
|
2824
|
+
end
|
2825
|
+
|
2826
|
+
def test_virtualGiftCard
|
2827
|
+
hash={
|
2828
|
+
'merchantId' => '101',
|
2829
|
+
'version'=>'8.8',
|
2830
|
+
'reportGroup'=>'Planets',
|
2831
|
+
'accountNumberLength'=>'13',
|
2832
|
+
'giftCardBin'=>'giftCardBinString'
|
2833
|
+
}
|
2834
|
+
|
2835
|
+
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<virtualGiftCard><accountNumberLength>13<\/accountNumberLength><giftCardBin>giftCardBinString<\/giftCardBin><\/virtualGiftCard>.*/m), is_a(Hash))
|
2836
|
+
LitleOnlineRequest.new.virtual_giftcard(hash)
|
2837
|
+
end
|
2838
|
+
|
2839
|
+
def test_activateReversal
|
2840
|
+
hash={
|
2841
|
+
'merchantId' => '101',
|
2842
|
+
'version'=>'8.8',
|
2843
|
+
'reportGroup'=>'Planets',
|
2844
|
+
'litleTxnId'=>'111'
|
2845
|
+
}
|
2846
|
+
|
2847
|
+
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<activateReversal reportGroup="Planets"><litleTxnId>111<\/litleTxnId><\/activateReversal>.*/m), is_a(Hash))
|
2848
|
+
LitleOnlineRequest.new.activate_reversal(hash)
|
2849
|
+
end
|
2850
|
+
|
2851
|
+
def test_depositReversal
|
2852
|
+
hash={
|
2853
|
+
'merchantId' => '101',
|
2854
|
+
'version'=>'8.8',
|
2855
|
+
'reportGroup'=>'Planets',
|
2856
|
+
'litleTxnId'=>'111'
|
2857
|
+
}
|
2858
|
+
|
2859
|
+
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<depositReversal reportGroup="Planets"><litleTxnId>111<\/litleTxnId><\/depositReversal>.*/m), is_a(Hash))
|
2860
|
+
LitleOnlineRequest.new.deposit_reversal(hash)
|
2861
|
+
end
|
2862
|
+
|
2863
|
+
def test_refundReversal
|
2864
|
+
hash={
|
2865
|
+
'merchantId' => '101',
|
2866
|
+
'version'=>'8.8',
|
2867
|
+
'reportGroup'=>'Planets',
|
2868
|
+
'litleTxnId'=>'111'
|
2869
|
+
}
|
2870
|
+
|
2871
|
+
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<refundReversal reportGroup="Planets"><litleTxnId>111<\/litleTxnId><\/refundReversal>.*/m), is_a(Hash))
|
2872
|
+
LitleOnlineRequest.new.refund_reversal(hash)
|
2873
|
+
end
|
2874
|
+
|
2875
|
+
def test_deactivateReversal
|
2876
|
+
hash={
|
2877
|
+
'merchantId' => '101',
|
2878
|
+
'version'=>'8.8',
|
2879
|
+
'reportGroup'=>'Planets',
|
2880
|
+
'litleTxnId'=>'111'
|
2881
|
+
}
|
2882
|
+
|
2883
|
+
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<deactivateReversal reportGroup="Planets"><litleTxnId>111<\/litleTxnId><\/deactivateReversal>.*/m), is_a(Hash))
|
2884
|
+
LitleOnlineRequest.new.deactivate_reversal(hash)
|
2885
|
+
end
|
2886
|
+
|
2887
|
+
def test_loadReversal
|
2888
|
+
hash={
|
2889
|
+
'merchantId' => '101',
|
2890
|
+
'version'=>'8.8',
|
2891
|
+
'reportGroup'=>'Planets',
|
2892
|
+
'litleTxnId'=>'111'
|
2893
|
+
}
|
2894
|
+
|
2895
|
+
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<loadReversal reportGroup="Planets"><litleTxnId>111<\/litleTxnId><\/loadReversal>.*/m), is_a(Hash))
|
2896
|
+
LitleOnlineRequest.new.load_reversal(hash)
|
2897
|
+
end
|
2898
|
+
|
2899
|
+
def test_unloadReversal
|
2900
|
+
hash={
|
2901
|
+
'merchantId' => '101',
|
2902
|
+
'version'=>'8.8',
|
2903
|
+
'reportGroup'=>'Planets',
|
2904
|
+
'litleTxnId'=>'111'
|
2905
|
+
}
|
2906
|
+
|
2907
|
+
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<unloadReversal reportGroup="Planets"><litleTxnId>111<\/litleTxnId><\/unloadReversal>.*/m), is_a(Hash))
|
2908
|
+
LitleOnlineRequest.new.unload_reversal(hash)
|
2909
|
+
end
|
2910
|
+
|
2911
|
+
def test_mpos_type
|
2912
|
+
hash = {
|
2913
|
+
'merchantId' => '101',
|
2914
|
+
'version'=>'8.8',
|
2915
|
+
'reportGroup'=>'Planets',
|
2916
|
+
'mpos'=>
|
2917
|
+
{
|
2918
|
+
'ksn'=>'ksnString',
|
2919
|
+
'formatId'=>'30',
|
2920
|
+
'encryptedTrack'=>'encryptedTrackString',
|
2921
|
+
'track1Status'=>'0',
|
2922
|
+
'track2Status'=>'0'
|
2923
|
+
}
|
2924
|
+
}
|
2925
|
+
|
2926
|
+
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<mpos><ksn>ksnString<\/ksn><formatId>30<\/formatId><encryptedTrack>encryptedTrackString<\/encryptedTrack><track1Status>0<\/track1Status><track2Status>0<\/track2Status><\/mpos>.*/m), is_a(Hash))
|
2927
|
+
LitleOnlineRequest.new.authorization(hash)
|
2928
|
+
end
|
2534
2929
|
end
|
2535
2930
|
end
|