CnpOnline 11.4.0 → 12.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (142) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +4 -164
  3. data/CHANGELOG~ +0 -0
  4. data/CONTRIBUTORS +0 -2
  5. data/DESCRIPTION +1 -1
  6. data/LICENSE +0 -0
  7. data/README.md +13 -15
  8. data/Rakefile +3 -2
  9. data/Rakefile~ +4 -3
  10. data/SETUP.md +13 -10
  11. data/bin/Setup.rb +26 -22
  12. data/bin/sample_batch_driver.rb +15 -15
  13. data/bin/sample_driver.rb +5 -5
  14. data/lib/{LitleBatchRequest.rb → CnpBatchRequest.rb} +68 -66
  15. data/lib/{LitleListeners.rb → CnpListeners.rb} +48 -40
  16. data/lib/{LitleOnline.rb → CnpOnline.rb} +8 -7
  17. data/lib/{LitleOnlineRequest.rb → CnpOnlineRequest.rb} +53 -53
  18. data/lib/{LitleRequest.rb → CnpRequest.rb} +186 -192
  19. data/lib/{LitleTransaction.rb → CnpTransaction.rb} +53 -52
  20. data/lib/{LitleXmlMapper.rb → CnpXmlMapper.rb} +7 -7
  21. data/lib/Communications.rb +8 -7
  22. data/lib/Configuration.rb +7 -6
  23. data/lib/EnvironmentVariables.rb +2 -2
  24. data/lib/XMLFields.rb +98 -108
  25. data/lib/cacert.pem +0 -0
  26. data/samples/Auth/CnpAuthReversalTransaction.rb +15 -0
  27. data/samples/Auth/{LitleAuthorizationTransaction.rb → CnpAuthorizationTransaction.rb} +4 -4
  28. data/samples/Auth/{LitlePaymentFullLifeCycle.rb → CnpPaymentFullLifeCycle.rb} +11 -11
  29. data/samples/Batch/AccountUpdate.rb +11 -11
  30. data/samples/Batch/SampleBatchDriver.rb +16 -16
  31. data/samples/Capture/{LitleCaptureGivenAuthTransaction.rb → CnpCaptureGivenAuthTransaction.rb} +4 -4
  32. data/samples/Capture/CnpCaptureTransaction.rb +14 -0
  33. data/samples/Capture/{LitleForceCaptureTransaction.rb → CnpForceCaptureTransaction.rb} +5 -5
  34. data/samples/Capture/CnpPartialCapture.rb +16 -0
  35. data/samples/Credit/CnpCreditTransaction.rb +16 -0
  36. data/samples/Credit/{LitleRefundTransaction.rb → CnpRefundTransaction.rb} +4 -4
  37. data/samples/Other/{LitleAvsTransaction.rb → CnpAvsTransaction.rb} +4 -4
  38. data/samples/Other/CnpVoidTransaction.rb +19 -0
  39. data/samples/Paypage/FullPaypageLifeCycle.rb +16 -16
  40. data/samples/Run_all.rb +12 -12
  41. data/samples/Sale/{LitleSaleTransaction.rb → CnpSaleTransaction.rb} +4 -4
  42. data/samples/Sale/SampleSaleTransaction.rb +5 -5
  43. data/test/certification/certTest1_base.rb +104 -103
  44. data/test/certification/certTest2_authenhanced.rb +90 -88
  45. data/test/certification/certTest3_authreversal.rb +29 -28
  46. data/test/certification/certTest4_echeck.rb +22 -20
  47. data/test/certification/certTest5_token.rb +51 -49
  48. data/test/certification/certTest_batchAll.rb +60 -60
  49. data/test/certification/ts_all.rb +1 -1
  50. data/test/functional/test_activate.rb +9 -8
  51. data/test/functional/test_activateReversal.rb +5 -5
  52. data/test/functional/test_auth.rb +31 -30
  53. data/test/functional/test_authReversal.rb +8 -8
  54. data/test/functional/test_balanceInquiry.rb +6 -6
  55. data/test/functional/test_batch.rb +32 -32
  56. data/test/functional/test_batchStream.rb +14 -14
  57. data/test/functional/test_cancelSubscription.rb +4 -4
  58. data/test/functional/test_capture.rb +14 -14
  59. data/test/functional/test_captureGivenAuth.rb +16 -16
  60. data/test/functional/test_configuration.rb +26 -26
  61. data/test/functional/test_createPlan.rb +5 -5
  62. data/test/functional/test_credit.rb +13 -33
  63. data/test/functional/test_deactivate.rb +6 -6
  64. data/test/functional/test_deactivateReversal.rb +5 -5
  65. data/test/functional/test_depositReversal.rb +5 -5
  66. data/test/functional/test_echeckCredit.rb +20 -20
  67. data/test/functional/test_echeckRedeposit.rb +16 -16
  68. data/test/functional/test_echeckSale.rb +35 -35
  69. data/test/functional/test_echeckVerification.rb +17 -17
  70. data/test/functional/test_echeckVoid.rb +4 -4
  71. data/test/functional/test_forceCapture.rb +21 -21
  72. data/test/functional/test_fraudCheck.rb +6 -5
  73. data/test/functional/test_giftCardAuthReversal.rb +5 -5
  74. data/test/functional/test_giftCardCapture.rb +5 -5
  75. data/test/functional/test_giftCardCredit.rb +5 -5
  76. data/test/functional/test_litle_requests.rb +101 -99
  77. data/test/functional/test_load.rb +6 -6
  78. data/test/functional/test_loadReversal.rb +5 -5
  79. data/test/functional/test_override.rb +9 -9
  80. data/test/functional/{test_pgp_litle_requests.rb → test_pgp_cnp_requests.rb} +61 -60
  81. data/test/functional/test_queryTransaction.rb +10 -10
  82. data/test/functional/test_refundReversal.rb +5 -5
  83. data/test/functional/test_sale.rb +36 -36
  84. data/test/functional/test_token.rb +10 -10
  85. data/test/functional/test_unload.rb +6 -6
  86. data/test/functional/test_unloadReversal.rb +5 -5
  87. data/test/functional/test_updateCardValidationNumOnToken.rb +4 -4
  88. data/test/functional/test_updatePlan.rb +4 -4
  89. data/test/functional/test_updateSubscription.rb +5 -5
  90. data/test/functional/test_wallet.rb +5 -5
  91. data/test/functional/test_xmlfields.rb +29 -69
  92. data/test/functional/ts_all.rb +2 -2
  93. data/test/unit/test_LitleAUBatch.rb +15 -15
  94. data/test/unit/test_LitleBatchRequest.rb +42 -76
  95. data/test/unit/test_LitleOnlineRequest.rb +38 -38
  96. data/test/unit/test_LitleRequest.rb +47 -47
  97. data/test/unit/test_LitleTransaction.rb +34 -34
  98. data/test/unit/test_LitleXmlMapper.rb +27 -27
  99. data/test/unit/test_activate.rb +8 -8
  100. data/test/unit/test_activateReversal.rb +5 -5
  101. data/test/unit/test_auth.rb +43 -43
  102. data/test/unit/test_authReversal.rb +14 -14
  103. data/test/unit/test_balanceInquiry.rb +4 -4
  104. data/test/unit/test_cancelSubscription.rb +4 -4
  105. data/test/unit/test_capture.rb +20 -20
  106. data/test/unit/test_captureGivenAuth.rb +22 -22
  107. data/test/unit/test_createPlan.rb +4 -4
  108. data/test/unit/test_credit.rb +43 -43
  109. data/test/unit/test_deactivate.rb +6 -6
  110. data/test/unit/test_deactivateReversal.rb +5 -5
  111. data/test/unit/test_depositReversal.rb +5 -5
  112. data/test/unit/test_echeckCredit.rb +16 -16
  113. data/test/unit/test_echeckRedeposit.rb +19 -19
  114. data/test/unit/test_echeckSale.rb +16 -16
  115. data/test/unit/test_echeckVerification.rb +11 -11
  116. data/test/unit/test_echeckVoid.rb +8 -8
  117. data/test/unit/test_forceCapture.rb +19 -19
  118. data/test/unit/test_fraudCheck.rb +4 -4
  119. data/test/unit/test_giftCardAuthReversal.rb +5 -5
  120. data/test/unit/test_giftCardCapture.rb +5 -5
  121. data/test/unit/test_giftCardCredit.rb +5 -5
  122. data/test/unit/test_load.rb +4 -4
  123. data/test/unit/test_loadReversal.rb +5 -5
  124. data/test/unit/{test_pgp_LitleRequest → test_pgp_CnpRequest.rb} +32 -32
  125. data/test/unit/test_queryTransaction.rb +8 -8
  126. data/test/unit/test_refundReversal.rb +5 -5
  127. data/test/unit/test_sale.rb +64 -64
  128. data/test/unit/test_token.rb +13 -13
  129. data/test/unit/test_unload.rb +4 -4
  130. data/test/unit/test_unloadReversal.rb +5 -5
  131. data/test/unit/test_updateCardValidationNumOnToken.rb +16 -16
  132. data/test/unit/test_updatePlan.rb +4 -4
  133. data/test/unit/test_updateSubscription.rb +11 -11
  134. data/test/unit/test_wallet.rb +13 -13
  135. data/test/unit/test_xmlfields.rb +119 -119
  136. data/test/unit/ts_unit.rb +6 -6
  137. metadata +35 -26
  138. data/samples/Auth/LitleAuthReversalTransaction.rb +0 -15
  139. data/samples/Capture/LitleCaptureTransaction.rb +0 -14
  140. data/samples/Capture/LitlePartialCapture.rb +0 -16
  141. data/samples/Credit/LitleCreditTransaction.rb +0 -16
  142. data/samples/Other/LitleVoidTransaction.rb +0 -19
@@ -22,10 +22,10 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22
22
  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23
23
  OTHER DEALINGS IN THE SOFTWARE.
24
24
  =end
25
- require File.expand_path("../../../lib/LitleOnline",__FILE__)
25
+ require File.expand_path("../../../lib/CnpOnline",__FILE__)
26
26
  require 'test/unit'
27
27
  require 'mocha/setup'
28
- module LitleOnline
28
+ module CnpOnline
29
29
  class TestUnload < Test::Unit::TestCase
30
30
 
31
31
  def test_simple
@@ -44,8 +44,8 @@ module LitleOnline
44
44
  }
45
45
  }
46
46
 
47
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<unload reportGroup="Planets"><orderId>11<\/orderId><amount>500<\/amount><orderSource>ecommerce<\/orderSource><card><type>GC<\/type><number>4100000000000001<\/number><expDate>1210<\/expDate><\/card><\/unload>.*/m), is_a(Hash))
48
- LitleOnlineRequest.new.unload_request(hash)
47
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<unload reportGroup="Planets"><orderId>11<\/orderId><amount>500<\/amount><orderSource>ecommerce<\/orderSource><card><type>GC<\/type><number>4100000000000001<\/number><expDate>1210<\/expDate><\/card><\/unload>.*/m), is_a(Hash))
48
+ CnpOnlineRequest.new.unload_request(hash)
49
49
  end
50
50
 
51
51
  end
@@ -22,10 +22,10 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22
22
  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23
23
  OTHER DEALINGS IN THE SOFTWARE.
24
24
  =end
25
- require File.expand_path("../../../lib/LitleOnline",__FILE__)
25
+ require File.expand_path("../../../lib/CnpOnline",__FILE__)
26
26
  require 'test/unit'
27
27
  require 'mocha/setup'
28
- module LitleOnline
28
+ module CnpOnline
29
29
  class TestUnloadReversal < Test::Unit::TestCase
30
30
 
31
31
  def test_simple
@@ -33,7 +33,7 @@ module LitleOnline
33
33
  'merchantId' => '101',
34
34
  'version'=>'8.8',
35
35
  'reportGroup'=>'Planets',
36
- 'litleTxnId' => '5000',
36
+ 'cnpTxnId' => '5000',
37
37
  'card'=>{
38
38
  'type'=>'GC',
39
39
  'number' =>'400000000000001',
@@ -48,8 +48,8 @@ module LitleOnline
48
48
  'originalSequenceNumber' => '111111',
49
49
  }
50
50
 
51
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<litleTxnId>5000<\/litleTxnId><card><type>GC<\/type><number>400000000000001<\/number><expDate>0150<\/expDate><cardValidationNum>411<\/cardValidationNum><pin>1234<\/pin><\/card>.*/m), is_a(Hash))
52
- LitleOnlineRequest.new.deposit_reversal(hash)
51
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<cnpTxnId>5000<\/cnpTxnId><card><type>GC<\/type><number>400000000000001<\/number><expDate>0150<\/expDate><cardValidationNum>411<\/cardValidationNum><pin>1234<\/pin><\/card>.*/m), is_a(Hash))
52
+ CnpOnlineRequest.new.deposit_reversal(hash)
53
53
  end
54
54
  end
55
55
 
@@ -22,45 +22,45 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22
22
  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23
23
  OTHER DEALINGS IN THE SOFTWARE.
24
24
  =end
25
- require File.expand_path("../../../lib/LitleOnline",__FILE__)
25
+ require File.expand_path("../../../lib/CnpOnline",__FILE__)
26
26
  require 'test/unit'
27
27
  require 'mocha/setup'
28
- module LitleOnline
28
+ module CnpOnline
29
29
  class TestUpdateCardValidationNumOnToken < Test::Unit::TestCase
30
30
  def test_simple
31
31
  hash = {
32
32
  'orderId'=>'12344',
33
- 'litleToken'=>'1233456789101112',
33
+ 'cnpToken'=>'1233456789101112',
34
34
  'cardValidationNum'=>'123'
35
35
  }
36
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<orderId>1.*<litleToken>1233456789101112.*<cardValidationNum>123.*/m), is_a(Hash))
37
- LitleOnlineRequest.new.update_card_validation_num_on_token(hash)
36
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<orderId>1.*<cnpToken>1233456789101112.*<cardValidationNum>123.*/m), is_a(Hash))
37
+ CnpOnlineRequest.new.update_card_validation_num_on_token(hash)
38
38
  end
39
39
 
40
40
  def test_order_id_is_optional
41
41
  hash = {
42
- 'litleToken'=>'1233456789101112',
42
+ 'cnpToken'=>'1233456789101112',
43
43
  'cardValidationNum'=>'123'
44
44
  }
45
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<litleToken>1233456789101112.*<cardValidationNum>123.*/m), is_a(Hash))
46
- LitleOnlineRequest.new.update_card_validation_num_on_token(hash)
45
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<cnpToken>1233456789101112.*<cardValidationNum>123.*/m), is_a(Hash))
46
+ CnpOnlineRequest.new.update_card_validation_num_on_token(hash)
47
47
  end
48
48
 
49
- def test_litle_token_is_required
49
+ def test_cnp_token_is_required
50
50
  hash = {
51
51
  'orderId'=>'12344',
52
52
  'cardValidationNum'=>'123'
53
53
  }
54
- exception = assert_raise(RuntimeError){LitleOnlineRequest.new.update_card_validation_num_on_token(hash)}
55
- assert_match /If updateCardValidationNumOnToken is specified, it must have a litleToken/, exception.message
54
+ exception = assert_raise(RuntimeError){CnpOnlineRequest.new.update_card_validation_num_on_token(hash)}
55
+ assert_match /If updateCardValidationNumOnToken is specified, it must have a cnpToken/, exception.message
56
56
  end
57
57
 
58
58
  def test_card_validation_num_is_required
59
59
  hash = {
60
60
  'orderId'=>'12344',
61
- 'litleToken'=>'1233456789101112'
61
+ 'cnpToken'=>'1233456789101112'
62
62
  }
63
- exception = assert_raise(RuntimeError){LitleOnlineRequest.new.update_card_validation_num_on_token(hash)}
63
+ exception = assert_raise(RuntimeError){CnpOnlineRequest.new.update_card_validation_num_on_token(hash)}
64
64
  assert_match /If updateCardValidationNumOnToken is specified, it must have a cardValidationNum/, exception.message
65
65
  end
66
66
 
@@ -69,11 +69,11 @@ module LitleOnline
69
69
  'loggedInUser' => 'gdake',
70
70
  'merchantSdk' => 'Ruby;8.14.0',
71
71
  'orderId'=>'12344',
72
- 'litleToken'=>'1233456789101112',
72
+ 'cnpToken'=>'1233456789101112',
73
73
  'cardValidationNum'=>'123'
74
74
  }
75
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*(loggedInUser="gdake".*merchantSdk="Ruby;8.14.0")|(merchantSdk="Ruby;8.14.0".*loggedInUser="gdake").*/m), is_a(Hash))
76
- LitleOnlineRequest.new.update_card_validation_num_on_token(hash)
75
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*(loggedInUser="gdake".*merchantSdk="Ruby;8.14.0")|(merchantSdk="Ruby;8.14.0".*loggedInUser="gdake").*/m), is_a(Hash))
76
+ CnpOnlineRequest.new.update_card_validation_num_on_token(hash)
77
77
  end
78
78
  end
79
79
 
@@ -22,10 +22,10 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22
22
  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23
23
  OTHER DEALINGS IN THE SOFTWARE.
24
24
  =end
25
- require File.expand_path("../../../lib/LitleOnline",__FILE__)
25
+ require File.expand_path("../../../lib/CnpOnline",__FILE__)
26
26
  require 'test/unit'
27
27
  require 'mocha/setup'
28
- module LitleOnline
28
+ module CnpOnline
29
29
  class TestUpdatePlan < Test::Unit::TestCase
30
30
 
31
31
  def test_simple
@@ -36,8 +36,8 @@ module LitleOnline
36
36
  'planCode'=>'planCodeString',
37
37
  'active'=>'true'
38
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)
39
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<updatePlan><planCode>planCodeString<\/planCode><active>true<\/active><\/updatePlan>.*/m), is_a(Hash))
40
+ CnpOnlineRequest.new.update_plan(hash)
41
41
  end
42
42
 
43
43
  end
@@ -22,11 +22,11 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22
22
  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23
23
  OTHER DEALINGS IN THE SOFTWARE.
24
24
  =end
25
- require File.expand_path("../../../lib/LitleOnline",__FILE__)
25
+ require File.expand_path("../../../lib/CnpOnline",__FILE__)
26
26
  require 'test/unit'
27
27
  require 'mocha/setup'
28
28
 
29
- module LitleOnline
29
+ module CnpOnline
30
30
  class TestUpdateSubscription < Test::Unit::TestCase
31
31
 
32
32
  def test_simple
@@ -35,8 +35,8 @@ module LitleOnline
35
35
  'merchantId' => '101',
36
36
  'version'=>'8.8',
37
37
  }
38
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<updateSubscription><subscriptionId>100<\/subscriptionId><\/updateSubscription>.*/m), is_a(Hash))
39
- LitleOnlineRequest.new.update_subscription(hash)
38
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<updateSubscription><subscriptionId>100<\/subscriptionId><\/updateSubscription>.*/m), is_a(Hash))
39
+ CnpOnlineRequest.new.update_subscription(hash)
40
40
  end
41
41
 
42
42
  def test_allFields
@@ -58,8 +58,8 @@ module LitleOnline
58
58
  },
59
59
  'billingDate' =>'2014-03-11'
60
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)
61
+ CnpXmlMapper.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
+ CnpOnlineRequest.new.update_subscription(hash)
63
63
  end
64
64
 
65
65
  def test_update_subscription_token
@@ -75,7 +75,7 @@ module LitleOnline
75
75
  },
76
76
  'token'=>
77
77
  {
78
- 'litleToken'=>'litleTokenString'
78
+ 'cnpToken'=>'cnpTokenString'
79
79
  },
80
80
  'billingDate' =>'2014-03-11',
81
81
  'createDiscount'=>[
@@ -111,8 +111,8 @@ module LitleOnline
111
111
  }],
112
112
  'deleteAddOn'=>[{'addOnCode'=>'addOnCode3'}]
113
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)
114
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<updateSubscription><subscriptionId>1000<\/subscriptionId><planCode>planCodeString<\/planCode><billToAddress><name>nameString<\/name><\/billToAddress><token><cnpToken>cnpTokenString<\/cnpToken><\/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
+ CnpOnlineRequest.new.update_subscription(hash)
116
116
  end
117
117
 
118
118
  def test_update_subscription_paypage
@@ -164,8 +164,8 @@ module LitleOnline
164
164
  'addOnCode'=>'addOnCode2',
165
165
  }],
166
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)
167
+ CnpXmlMapper.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
+ CnpOnlineRequest.new.update_subscription(hash)
169
169
  end
170
170
  end
171
171
 
@@ -24,7 +24,7 @@ OTHER DEALINGS IN THE SOFTWARE.
24
24
  =end
25
25
 
26
26
 
27
- require File.expand_path("../../../lib/LitleOnline",__FILE__)
27
+ require File.expand_path("../../../lib/CnpOnline",__FILE__)
28
28
  require 'test/unit'
29
29
  require 'mocha/setup'
30
30
 
@@ -32,7 +32,7 @@ require 'mocha/setup'
32
32
  # TYPE 1 - Success Scenarios
33
33
  # TYPE 2 - Error Scenarios
34
34
 
35
- module LitleOnline
35
+ module CnpOnline
36
36
  =begin
37
37
  Definition: Class Definition for the Testing Class TestWallet
38
38
  Created on: 01-29-2016
@@ -54,7 +54,7 @@ class TestWallet < Test::Unit::TestCase
54
54
  'id' => 'test',
55
55
  'version'=>'8.8',
56
56
  'reportGroup'=>'Planets',
57
- 'litleTxnId'=>'123456',
57
+ 'cnpTxnId'=>'123456',
58
58
  'orderId'=>'12344',
59
59
  'amount'=>'106',
60
60
  'orderSource'=>'ecommerce',
@@ -70,7 +70,7 @@ class TestWallet < Test::Unit::TestCase
70
70
  }
71
71
  }
72
72
 
73
- exception = assert_raise(RuntimeError){LitleOnlineRequest.new.sale(hash)}
73
+ exception = assert_raise(RuntimeError){CnpOnlineRequest.new.sale(hash)}
74
74
  assert_match /If wallet is specified, it must have a walletSourceType/, exception.message
75
75
 
76
76
  end
@@ -88,7 +88,7 @@ class TestWallet < Test::Unit::TestCase
88
88
  'id' => 'test',
89
89
  'version'=>'8.8',
90
90
  'reportGroup'=>'Planets',
91
- 'litleTxnId'=>'123456',
91
+ 'cnpTxnId'=>'123456',
92
92
  'orderId'=>'12344',
93
93
  'amount'=>'106',
94
94
  'orderSource'=>'ecommerce',
@@ -105,7 +105,7 @@ class TestWallet < Test::Unit::TestCase
105
105
  }
106
106
  }
107
107
 
108
- exception = assert_raise(RuntimeError){LitleOnlineRequest.new.sale(hash)}
108
+ exception = assert_raise(RuntimeError){CnpOnlineRequest.new.sale(hash)}
109
109
  assert_match /If wallet is specified, it must have a walletSourceTypeId/, exception.message
110
110
 
111
111
  end
@@ -124,7 +124,7 @@ class TestWallet < Test::Unit::TestCase
124
124
  'id' => 'test',
125
125
  'version'=>'8.8',
126
126
  'reportGroup'=>'Planets',
127
- 'litleTxnId'=>'123456',
127
+ 'cnpTxnId'=>'123456',
128
128
  'orderId'=>'12344',
129
129
  'amount'=>'106',
130
130
  'orderSource'=>'ecommerce',
@@ -142,8 +142,8 @@ class TestWallet < Test::Unit::TestCase
142
142
  }
143
143
  }
144
144
 
145
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*?<litleOnlineRequest.*?<sale.*?<wallet>.*?<walletSourceType>MasterPass<\/walletSourceType>.*?<\/wallet>.*?<\/sale>.*?/m), is_a(Hash))
146
- LitleOnlineRequest.new.sale(hash)
145
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*?<cnpOnlineRequest.*?<sale.*?<wallet>.*?<walletSourceType>MasterPass<\/walletSourceType>.*?<\/wallet>.*?<\/sale>.*?/m), is_a(Hash))
146
+ CnpOnlineRequest.new.sale(hash)
147
147
  end
148
148
 
149
149
 
@@ -187,8 +187,8 @@ class TestWallet < Test::Unit::TestCase
187
187
  }
188
188
  }
189
189
 
190
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*?<litleOnlineRequest.*?<authorization.*?<wallet>.*?<walletSourceType>MasterPass<\/walletSourceType><walletSourceTypeId>102<\/walletSourceTypeId>.*?<\/wallet>.*?<\/authorization>.*?/m), is_a(Hash))
191
- LitleOnlineRequest.new.authorization(hash)
190
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*?<cnpOnlineRequest.*?<authorization.*?<wallet>.*?<walletSourceType>MasterPass<\/walletSourceType><walletSourceTypeId>102<\/walletSourceTypeId>.*?<\/wallet>.*?<\/authorization>.*?/m), is_a(Hash))
191
+ CnpOnlineRequest.new.authorization(hash)
192
192
  end
193
193
 
194
194
  =begin
@@ -221,7 +221,7 @@ def test_auth_wallet_no_sourcetype
221
221
  }
222
222
  }
223
223
 
224
- exception = assert_raise(RuntimeError){LitleOnlineRequest.new.sale(hash)}
224
+ exception = assert_raise(RuntimeError){CnpOnlineRequest.new.sale(hash)}
225
225
  assert_match /If wallet is specified, it must have a walletSourceType/, exception.message
226
226
  end
227
227
 
@@ -255,7 +255,7 @@ def test_auth_wallet_no_sourcetype
255
255
  }
256
256
  }
257
257
 
258
- exception = assert_raise(RuntimeError){LitleOnlineRequest.new.sale(hash)}
258
+ exception = assert_raise(RuntimeError){CnpOnlineRequest.new.sale(hash)}
259
259
  assert_match /If wallet is specified, it must have a walletSourceTypeId/, exception.message
260
260
  end
261
261
  end
@@ -22,28 +22,28 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22
22
  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23
23
  OTHER DEALINGS IN THE SOFTWARE.
24
24
  =end
25
- require File.expand_path("../../../lib/LitleOnline",__FILE__)
25
+ require File.expand_path("../../../lib/CnpOnline",__FILE__)
26
26
  require 'test/unit'
27
27
  require 'mocha/setup'
28
28
 
29
- module LitleOnline
29
+ module CnpOnline
30
30
  class TestXmlfields < Test::Unit::TestCase
31
31
  def test_custom_billing_with_two_choices
32
32
  hash = {
33
33
  'merchantId' => '101',
34
34
  'version'=>'8.8',
35
35
  'reportGroup'=>'Planets',
36
- 'litleTxnId'=>'123456',
36
+ 'cnpTxnId'=>'123456',
37
37
  'orderId'=>'12344',
38
38
  'amount'=>'106',
39
39
  'orderSource'=>'ecommerce',
40
- 'customBilling'=>{'phone'=>'1234567890','url'=>'www.litle.com'},
40
+ 'customBilling'=>{'phone'=>'1234567890','url'=>'www.cnp.com'},
41
41
  'card'=>{
42
42
  'type'=>'VI',
43
43
  'number' =>'4100000000000001',
44
44
  'expDate' =>'1210'
45
45
  }}
46
- exception = assert_raise(RuntimeError){LitleOnlineRequest.new.sale(hash)}
46
+ exception = assert_raise(RuntimeError){CnpOnlineRequest.new.sale(hash)}
47
47
  assert_match /Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!/, exception.message
48
48
  end
49
49
 
@@ -52,17 +52,17 @@ module LitleOnline
52
52
  'merchantId' => '101',
53
53
  'version'=>'8.8',
54
54
  'reportGroup'=>'Planets',
55
- 'litleTxnId'=>'123456',
55
+ 'cnpTxnId'=>'123456',
56
56
  'orderId'=>'12344',
57
57
  'amount'=>'106',
58
58
  'orderSource'=>'ecommerce',
59
- 'customBilling'=>{'phone'=>'123456789','url'=>'www.litle.com','city'=>'lowell'},
59
+ 'customBilling'=>{'phone'=>'123456789','url'=>'www.cnp.com','city'=>'lowell'},
60
60
  'card'=>{
61
61
  'type'=>'VI',
62
62
  'number' =>'4100000000000001',
63
63
  'expDate' =>'1210'
64
64
  }}
65
- exception = assert_raise(RuntimeError){LitleOnlineRequest.new.sale(hash)}
65
+ exception = assert_raise(RuntimeError){CnpOnlineRequest.new.sale(hash)}
66
66
  assert_match /Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!/, exception.message
67
67
  end
68
68
 
@@ -80,8 +80,8 @@ module LitleOnline
80
80
  }
81
81
  }
82
82
 
83
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<enhancedData>.*<lineItemData>.*<itemSequenceNumber>1<\/itemSequenceNumber>.*<itemDescription>desc1<\/itemDescription>.*<\/lineItemData>.*<lineItemData>.*<itemSequenceNumber>2<\/itemSequenceNumber>.*<itemDescription>desc2<\/itemDescription>.*<\/lineItemData>.*<\/enhancedData>.*/m), is_a(Hash))
84
- LitleOnlineRequest.new.authorization(hash)
83
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<enhancedData>.*<lineItemData>.*<itemSequenceNumber>1<\/itemSequenceNumber>.*<itemDescription>desc1<\/itemDescription>.*<\/lineItemData>.*<lineItemData>.*<itemSequenceNumber>2<\/itemSequenceNumber>.*<itemDescription>desc2<\/itemDescription>.*<\/lineItemData>.*<\/enhancedData>.*/m), is_a(Hash))
84
+ CnpOnlineRequest.new.authorization(hash)
85
85
  end
86
86
 
87
87
  def test_detail_tax
@@ -98,8 +98,8 @@ module LitleOnline
98
98
  }
99
99
  }
100
100
 
101
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<enhancedData>.*<detailTax>.*<taxIncludedInTotal>true<\/taxIncludedInTotal>.*<taxTypeIdentifier>00<\/taxTypeIdentifier>.*<\/detailTax>.*<detailTax>.*<taxIncludedInTotal>false<\/taxIncludedInTotal>.*<taxTypeIdentifier>01<\/taxTypeIdentifier>.*<\/detailTax>.*<\/enhancedData>.*/m), is_a(Hash))
102
- LitleOnlineRequest.new.authorization(hash)
101
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<enhancedData>.*<detailTax>.*<taxIncludedInTotal>true<\/taxIncludedInTotal>.*<taxTypeIdentifier>00<\/taxTypeIdentifier>.*<\/detailTax>.*<detailTax>.*<taxIncludedInTotal>false<\/taxIncludedInTotal>.*<taxTypeIdentifier>01<\/taxTypeIdentifier>.*<\/detailTax>.*<\/enhancedData>.*/m), is_a(Hash))
102
+ CnpOnlineRequest.new.authorization(hash)
103
103
  end
104
104
 
105
105
  def test_detail_tax_in_lineItem
@@ -124,8 +124,8 @@ module LitleOnline
124
124
  ]}
125
125
  }
126
126
 
127
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<enhancedData>.*<detailTax>.*<taxAmount>5<\/taxAmount>.*<\/detailTax>.*<detailTax>.*<taxAmount>6<\/taxAmount>.*<\/detailTax>.*<lineItemData>.*<itemSequenceNumber>1<\/itemSequenceNumber>.*<itemDescription>desc1<\/itemDescription>.*<detailTax>.*<taxAmount>1<\/taxAmount>.*<\/detailTax>.*<detailTax>.*<taxAmount>2<\/taxAmount>.*<\/detailTax>.*<\/lineItemData>.*<lineItemData>.*<itemSequenceNumber>2<\/itemSequenceNumber>.*<itemDescription>desc2<\/itemDescription>.*<detailTax>.*<taxAmount>3<\/taxAmount>.*<\/detailTax>.*<detailTax>.*<taxAmount>4<\/taxAmount>.*<\/detailTax>.*<\/lineItemData>.*<\/enhancedData>.*/m), is_a(Hash))
128
- LitleOnlineRequest.new.authorization(hash)
127
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<enhancedData>.*<detailTax>.*<taxAmount>5<\/taxAmount>.*<\/detailTax>.*<detailTax>.*<taxAmount>6<\/taxAmount>.*<\/detailTax>.*<lineItemData>.*<itemSequenceNumber>1<\/itemSequenceNumber>.*<itemDescription>desc1<\/itemDescription>.*<detailTax>.*<taxAmount>1<\/taxAmount>.*<\/detailTax>.*<detailTax>.*<taxAmount>2<\/taxAmount>.*<\/detailTax>.*<\/lineItemData>.*<lineItemData>.*<itemSequenceNumber>2<\/itemSequenceNumber>.*<itemDescription>desc2<\/itemDescription>.*<detailTax>.*<taxAmount>3<\/taxAmount>.*<\/detailTax>.*<detailTax>.*<taxAmount>4<\/taxAmount>.*<\/detailTax>.*<\/lineItemData>.*<\/enhancedData>.*/m), is_a(Hash))
128
+ CnpOnlineRequest.new.authorization(hash)
129
129
  end
130
130
 
131
131
  def test_customerinfo_employerName_xml
@@ -139,8 +139,8 @@ module LitleOnline
139
139
  }
140
140
  }
141
141
 
142
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<customerInfo>.*<employerName>Greg<\/employerName>.*<\/customerInfo>.*.*/m), is_a(Hash))
143
- LitleOnlineRequest.new.authorization(hash)
142
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<customerInfo>.*<employerName>Greg<\/employerName>.*<\/customerInfo>.*.*/m), is_a(Hash))
143
+ CnpOnlineRequest.new.authorization(hash)
144
144
  end
145
145
 
146
146
  def test_billMeLaterRequest_bmlProductType_xml
@@ -154,8 +154,8 @@ module LitleOnline
154
154
  }
155
155
  }
156
156
 
157
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<billMeLaterRequest>.*<bmlProductType>12<\/bmlProductType>.*<\/billMeLaterRequest>.*.*/m), is_a(Hash))
158
- LitleOnlineRequest.new.authorization(hash)
157
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<billMeLaterRequest>.*<bmlProductType>12<\/bmlProductType>.*<\/billMeLaterRequest>.*.*/m), is_a(Hash))
158
+ CnpOnlineRequest.new.authorization(hash)
159
159
  end
160
160
 
161
161
 
@@ -2050,58 +2050,58 @@ module LitleOnline
2050
2050
  assert_equal "If card cardValidationNum is specified, it must be between 1 and 4 characters long", exception.message
2051
2051
  end
2052
2052
 
2053
- def test_cardToken_litleToken
2054
- assert_equal("abcdefghijklm", CardToken.from_hash({'cardToken'=>{'litleToken'=>'abcdefghijklm'}}).litleToken)
2055
- assert_equal("1234567890123", CardToken.from_hash({'cardToken'=>{'litleToken'=>'1234567890123'}}).litleToken)
2056
- assert_equal("1234567890123456789012345", CardToken.from_hash({'cardToken'=>{'litleToken'=>'1234567890123456789012345'}}).litleToken)
2053
+ def test_cardToken_cnpToken
2054
+ assert_equal("abcdefghijklm", CardToken.from_hash({'cardToken'=>{'cnpToken'=>'abcdefghijklm'}}).cnpToken)
2055
+ assert_equal("1234567890123", CardToken.from_hash({'cardToken'=>{'cnpToken'=>'1234567890123'}}).cnpToken)
2056
+ assert_equal("1234567890123456789012345", CardToken.from_hash({'cardToken'=>{'cnpToken'=>'1234567890123456789012345'}}).cnpToken)
2057
2057
  exception = assert_raise(RuntimeError){
2058
- CardToken.from_hash({ 'cardToken'=>{'litleToken'=>'12345678901234567890123456'}})
2058
+ CardToken.from_hash({ 'cardToken'=>{'cnpToken'=>'12345678901234567890123456'}})
2059
2059
  }
2060
- assert_equal "If cardToken litleToken is specified, it must be between 13 and 25 characters long", exception.message
2060
+ assert_equal "If cardToken cnpToken is specified, it must be between 13 and 25 characters long", exception.message
2061
2061
  exception = assert_raise(RuntimeError){
2062
2062
  CardToken.from_hash({ 'cardToken'=>{}})
2063
2063
  }
2064
- assert_equal "If cardToken is specified, it must have a litleToken", exception.message
2064
+ assert_equal "If cardToken is specified, it must have a cnpToken", exception.message
2065
2065
  end
2066
2066
 
2067
2067
  def test_cardToken_expDate
2068
- assert_equal(nil, CardToken.from_hash({'cardToken'=>{'litleToken'=>'1234567890123'}}).expDate)
2069
- assert_equal("abcd", CardToken.from_hash({'cardToken'=>{'expDate'=>'abcd','litleToken'=>'1234567890123'}}).expDate)
2070
- assert_equal("1234", CardToken.from_hash({'cardToken'=>{'expDate'=>'1234','litleToken'=>'1234567890123'}}).expDate)
2068
+ assert_equal(nil, CardToken.from_hash({'cardToken'=>{'cnpToken'=>'1234567890123'}}).expDate)
2069
+ assert_equal("abcd", CardToken.from_hash({'cardToken'=>{'expDate'=>'abcd','cnpToken'=>'1234567890123'}}).expDate)
2070
+ assert_equal("1234", CardToken.from_hash({'cardToken'=>{'expDate'=>'1234','cnpToken'=>'1234567890123'}}).expDate)
2071
2071
  exception = assert_raise(RuntimeError){
2072
- CardToken.from_hash({ 'cardToken'=>{'expDate'=>'123','litleToken'=>'1234567890123'}})
2072
+ CardToken.from_hash({ 'cardToken'=>{'expDate'=>'123','cnpToken'=>'1234567890123'}})
2073
2073
  }
2074
2074
  assert_equal "If cardToken expDate is specified, it must be between 4 and 4 characters long", exception.message
2075
2075
  exception = assert_raise(RuntimeError){
2076
- CardToken.from_hash({ 'cardToken'=>{'expDate'=>'12345','litleToken'=>'1234567890123'}})
2076
+ CardToken.from_hash({ 'cardToken'=>{'expDate'=>'12345','cnpToken'=>'1234567890123'}})
2077
2077
  }
2078
2078
  assert_equal "If cardToken expDate is specified, it must be between 4 and 4 characters long", exception.message
2079
2079
  end
2080
2080
 
2081
2081
  def test_cardToken_cardValidationNum
2082
- assert_equal(nil, CardToken.from_hash({'cardToken'=>{'litleToken'=>'1234567890123'}}).cardValidationNum)
2083
- assert_equal("a", CardToken.from_hash({'cardToken'=>{'cardValidationNum'=>'a','litleToken'=>'1234567890123'}}).cardValidationNum)
2084
- assert_equal("1234", CardToken.from_hash({'cardToken'=>{'cardValidationNum'=>'1234','litleToken'=>'1234567890123'}}).cardValidationNum)
2082
+ assert_equal(nil, CardToken.from_hash({'cardToken'=>{'cnpToken'=>'1234567890123'}}).cardValidationNum)
2083
+ assert_equal("a", CardToken.from_hash({'cardToken'=>{'cardValidationNum'=>'a','cnpToken'=>'1234567890123'}}).cardValidationNum)
2084
+ assert_equal("1234", CardToken.from_hash({'cardToken'=>{'cardValidationNum'=>'1234','cnpToken'=>'1234567890123'}}).cardValidationNum)
2085
2085
  exception = assert_raise(RuntimeError){
2086
- CardToken.from_hash({ 'cardToken'=>{'cardValidationNum'=>'12345','litleToken'=>'1234567890123'}})
2086
+ CardToken.from_hash({ 'cardToken'=>{'cardValidationNum'=>'12345','cnpToken'=>'1234567890123'}})
2087
2087
  }
2088
2088
  assert_equal "If cardToken cardValidationNum is specified, it must be between 1 and 4 characters long", exception.message
2089
2089
  end
2090
2090
 
2091
2091
  def test_cardToken_mop
2092
- assert_equal(nil, CardToken.from_hash({'cardToken'=>{'litleToken'=>'1234567890123'}}).mop)
2093
- assert_equal("", CardToken.from_hash({'cardToken'=>{'type'=>'','litleToken'=>'1234567890123'}}).mop)
2094
- assert_equal("MC", CardToken.from_hash({'cardToken'=>{'type'=>'MC','litleToken'=>'1234567890123'}}).mop)
2095
- assert_equal("VI", CardToken.from_hash({'cardToken'=>{'type'=>'VI','litleToken'=>'1234567890123'}}).mop)
2096
- assert_equal("AX", CardToken.from_hash({'cardToken'=>{'type'=>'AX','litleToken'=>'1234567890123'}}).mop)
2097
- assert_equal("DC", CardToken.from_hash({'cardToken'=>{'type'=>'DC','litleToken'=>'1234567890123'}}).mop)
2098
- assert_equal("DI", CardToken.from_hash({'cardToken'=>{'type'=>'DI','litleToken'=>'1234567890123'}}).mop)
2099
- assert_equal("PP", CardToken.from_hash({'cardToken'=>{'type'=>'PP','litleToken'=>'1234567890123'}}).mop)
2100
- assert_equal("JC", CardToken.from_hash({'cardToken'=>{'type'=>'JC','litleToken'=>'1234567890123'}}).mop)
2101
- assert_equal("BL", CardToken.from_hash({'cardToken'=>{'type'=>'BL','litleToken'=>'1234567890123'}}).mop)
2102
- assert_equal("EC", CardToken.from_hash({'cardToken'=>{'type'=>'EC','litleToken'=>'1234567890123'}}).mop)
2103
- exception = assert_raise(RuntimeError){
2104
- CardToken.from_hash({ 'cardToken'=>{'type'=>'ZZ','litleToken'=>'1234567890123'}})
2092
+ assert_equal(nil, CardToken.from_hash({'cardToken'=>{'cnpToken'=>'1234567890123'}}).mop)
2093
+ assert_equal("", CardToken.from_hash({'cardToken'=>{'type'=>'','cnpToken'=>'1234567890123'}}).mop)
2094
+ assert_equal("MC", CardToken.from_hash({'cardToken'=>{'type'=>'MC','cnpToken'=>'1234567890123'}}).mop)
2095
+ assert_equal("VI", CardToken.from_hash({'cardToken'=>{'type'=>'VI','cnpToken'=>'1234567890123'}}).mop)
2096
+ assert_equal("AX", CardToken.from_hash({'cardToken'=>{'type'=>'AX','cnpToken'=>'1234567890123'}}).mop)
2097
+ assert_equal("DC", CardToken.from_hash({'cardToken'=>{'type'=>'DC','cnpToken'=>'1234567890123'}}).mop)
2098
+ assert_equal("DI", CardToken.from_hash({'cardToken'=>{'type'=>'DI','cnpToken'=>'1234567890123'}}).mop)
2099
+ assert_equal("PP", CardToken.from_hash({'cardToken'=>{'type'=>'PP','cnpToken'=>'1234567890123'}}).mop)
2100
+ assert_equal("JC", CardToken.from_hash({'cardToken'=>{'type'=>'JC','cnpToken'=>'1234567890123'}}).mop)
2101
+ assert_equal("BL", CardToken.from_hash({'cardToken'=>{'type'=>'BL','cnpToken'=>'1234567890123'}}).mop)
2102
+ assert_equal("EC", CardToken.from_hash({'cardToken'=>{'type'=>'EC','cnpToken'=>'1234567890123'}}).mop)
2103
+ exception = assert_raise(RuntimeError){
2104
+ CardToken.from_hash({ 'cardToken'=>{'type'=>'ZZ','cnpToken'=>'1234567890123'}})
2105
2105
  }
2106
2106
  assert_equal "If cardToken type is specified, it must be in [\"\", \"MC\", \"VI\", \"AX\", \"DC\", \"DI\", \"PP\", \"JC\", \"BL\", \"EC\"]", exception.message
2107
2107
  end
@@ -2431,61 +2431,61 @@ module LitleOnline
2431
2431
  assert_equal "If echeck checkNum is specified, it must be between 1 and 15 characters long", exception.message
2432
2432
  end
2433
2433
 
2434
- def test_echeckToken_litleToken
2435
- assert_equal("abcdefhijklmn", EcheckToken.from_hash({'echeckToken'=>{'accType'=>'Checking','litleToken'=>'abcdefhijklmn','routingNum'=>'123456789'}}).litleToken)
2436
- assert_equal("1234567890123456789012345", EcheckToken.from_hash({'echeckToken'=>{'accType'=>'Checking','litleToken'=>'1234567890123456789012345','routingNum'=>'123456789'}}).litleToken)
2434
+ def test_echeckToken_cnpToken
2435
+ assert_equal("abcdefhijklmn", EcheckToken.from_hash({'echeckToken'=>{'accType'=>'Checking','cnpToken'=>'abcdefhijklmn','routingNum'=>'123456789'}}).cnpToken)
2436
+ assert_equal("1234567890123456789012345", EcheckToken.from_hash({'echeckToken'=>{'accType'=>'Checking','cnpToken'=>'1234567890123456789012345','routingNum'=>'123456789'}}).cnpToken)
2437
2437
  exception = assert_raise(RuntimeError){
2438
- EcheckToken.from_hash({ 'echeckToken'=>{'litleToken'=>'123456789012','routingNum'=>'123456789','accType'=>'Checking'}})
2438
+ EcheckToken.from_hash({ 'echeckToken'=>{'cnpToken'=>'123456789012','routingNum'=>'123456789','accType'=>'Checking'}})
2439
2439
  }
2440
- assert_equal "If echeckToken litleToken is specified, it must be between 13 and 25 characters long", exception.message
2440
+ assert_equal "If echeckToken cnpToken is specified, it must be between 13 and 25 characters long", exception.message
2441
2441
  exception = assert_raise(RuntimeError){
2442
- EcheckToken.from_hash({ 'echeckToken'=>{'litleToken'=>'12345678901234567890123456','routingNum'=>'123456789','accType'=>'Checking'}})
2442
+ EcheckToken.from_hash({ 'echeckToken'=>{'cnpToken'=>'12345678901234567890123456','routingNum'=>'123456789','accType'=>'Checking'}})
2443
2443
  }
2444
- assert_equal "If echeckToken litleToken is specified, it must be between 13 and 25 characters long", exception.message
2444
+ assert_equal "If echeckToken cnpToken is specified, it must be between 13 and 25 characters long", exception.message
2445
2445
  exception = assert_raise(RuntimeError){
2446
2446
  EcheckToken.from_hash({ 'echeckToken'=>{'routingNum'=>'123456789','accType'=>'Checking'}})
2447
2447
  }
2448
- assert_equal "If echeckToken is specified, it must have a litleToken", exception.message
2448
+ assert_equal "If echeckToken is specified, it must have a cnpToken", exception.message
2449
2449
  end
2450
2450
 
2451
2451
  def test_echeckToken_routingNum
2452
- assert_equal("abcdefghi", EcheckToken.from_hash({'echeckToken'=>{'accType'=>'Checking','litleToken'=>'1234567890123','routingNum'=>'abcdefghi'}}).routingNum)
2453
- assert_equal("123456789", EcheckToken.from_hash({'echeckToken'=>{'accType'=>'Checking','litleToken'=>'1234567890123','routingNum'=>'123456789'}}).routingNum)
2452
+ assert_equal("abcdefghi", EcheckToken.from_hash({'echeckToken'=>{'accType'=>'Checking','cnpToken'=>'1234567890123','routingNum'=>'abcdefghi'}}).routingNum)
2453
+ assert_equal("123456789", EcheckToken.from_hash({'echeckToken'=>{'accType'=>'Checking','cnpToken'=>'1234567890123','routingNum'=>'123456789'}}).routingNum)
2454
2454
  exception = assert_raise(RuntimeError){
2455
- EcheckToken.from_hash({ 'echeckToken'=>{'litleToken'=>'1234567890123','routingNum'=>'1234567890','accType'=>'Checking'}})
2455
+ EcheckToken.from_hash({ 'echeckToken'=>{'cnpToken'=>'1234567890123','routingNum'=>'1234567890','accType'=>'Checking'}})
2456
2456
  }
2457
2457
  assert_equal "If echeckToken routingNum is specified, it must be between 9 and 9 characters long", exception.message
2458
2458
  exception = assert_raise(RuntimeError){
2459
- EcheckToken.from_hash({ 'echeckToken'=>{'litleToken'=>'1234567890123','routingNum'=>'12345678','accType'=>'Checking'}})
2459
+ EcheckToken.from_hash({ 'echeckToken'=>{'cnpToken'=>'1234567890123','routingNum'=>'12345678','accType'=>'Checking'}})
2460
2460
  }
2461
2461
  assert_equal "If echeckToken routingNum is specified, it must be between 9 and 9 characters long", exception.message
2462
2462
  exception = assert_raise(RuntimeError){
2463
- EcheckToken.from_hash({ 'echeckToken'=>{'litleToken'=>'1234567890123','accType'=>'Checking'}})
2463
+ EcheckToken.from_hash({ 'echeckToken'=>{'cnpToken'=>'1234567890123','accType'=>'Checking'}})
2464
2464
  }
2465
2465
  assert_equal "If echeckToken is specified, it must have a routingNum", exception.message
2466
2466
  end
2467
2467
 
2468
2468
  def test_echeckToken_accType
2469
- assert_equal("Checking", EcheckToken.from_hash({'echeckToken'=>{'accType'=>'Checking','litleToken'=>'1234567890123','routingNum'=>'123456789'}}).accType)
2470
- assert_equal("Savings", EcheckToken.from_hash({'echeckToken'=>{'accType'=>'Savings','litleToken'=>'1234567890123','routingNum'=>'123456789'}}).accType)
2471
- assert_equal("Corporate", EcheckToken.from_hash({'echeckToken'=>{'accType'=>'Corporate','litleToken'=>'1234567890123','routingNum'=>'123456789'}}).accType)
2472
- assert_equal("Corp Savings", EcheckToken.from_hash({'echeckToken'=>{'accType'=>'Corp Savings','litleToken'=>'1234567890123','routingNum'=>'123456789'}}).accType)
2469
+ assert_equal("Checking", EcheckToken.from_hash({'echeckToken'=>{'accType'=>'Checking','cnpToken'=>'1234567890123','routingNum'=>'123456789'}}).accType)
2470
+ assert_equal("Savings", EcheckToken.from_hash({'echeckToken'=>{'accType'=>'Savings','cnpToken'=>'1234567890123','routingNum'=>'123456789'}}).accType)
2471
+ assert_equal("Corporate", EcheckToken.from_hash({'echeckToken'=>{'accType'=>'Corporate','cnpToken'=>'1234567890123','routingNum'=>'123456789'}}).accType)
2472
+ assert_equal("Corp Savings", EcheckToken.from_hash({'echeckToken'=>{'accType'=>'Corp Savings','cnpToken'=>'1234567890123','routingNum'=>'123456789'}}).accType)
2473
2473
  exception = assert_raise(RuntimeError){
2474
- EcheckToken.from_hash({ 'echeckToken'=>{'litleToken'=>'1234567890123','routingNum'=>'123456789','accType'=>'Other'}})
2474
+ EcheckToken.from_hash({ 'echeckToken'=>{'cnpToken'=>'1234567890123','routingNum'=>'123456789','accType'=>'Other'}})
2475
2475
  }
2476
2476
  assert_equal "If echeckToken accType is specified, it must be in [\"Checking\", \"Savings\", \"Corporate\", \"Corp Savings\"]", exception.message
2477
2477
  exception = assert_raise(RuntimeError){
2478
- EcheckToken.from_hash({ 'echeckToken'=>{'litleToken'=>'1234567890123','routingNum'=>'123456789'}})
2478
+ EcheckToken.from_hash({ 'echeckToken'=>{'cnpToken'=>'1234567890123','routingNum'=>'123456789'}})
2479
2479
  }
2480
2480
  assert_equal "If echeckToken is specified, it must have a accType", exception.message
2481
2481
  end
2482
2482
 
2483
2483
  def test_echeckToken_checkNum
2484
- assert_equal(nil, EcheckToken.from_hash({'echeckToken'=>{'accType'=>'Checking','litleToken'=>'1234567890123','routingNum'=>'abcdefghi'}}).checkNum)
2485
- assert_equal("a", EcheckToken.from_hash({'echeckToken'=>{'accType'=>'Checking','litleToken'=>'1234567890123','routingNum'=>'abcdefghi','checkNum'=>'a'}}).checkNum)
2486
- assert_equal("123456789012345", EcheckToken.from_hash({'echeckToken'=>{'accType'=>'Checking','litleToken'=>'1234567890123','routingNum'=>'123456789','checkNum'=>'123456789012345'}}).checkNum)
2484
+ assert_equal(nil, EcheckToken.from_hash({'echeckToken'=>{'accType'=>'Checking','cnpToken'=>'1234567890123','routingNum'=>'abcdefghi'}}).checkNum)
2485
+ assert_equal("a", EcheckToken.from_hash({'echeckToken'=>{'accType'=>'Checking','cnpToken'=>'1234567890123','routingNum'=>'abcdefghi','checkNum'=>'a'}}).checkNum)
2486
+ assert_equal("123456789012345", EcheckToken.from_hash({'echeckToken'=>{'accType'=>'Checking','cnpToken'=>'1234567890123','routingNum'=>'123456789','checkNum'=>'123456789012345'}}).checkNum)
2487
2487
  exception = assert_raise(RuntimeError){
2488
- EcheckToken.from_hash({ 'echeckToken'=>{'litleToken'=>'1234567890123','routingNum'=>'123456789','accType'=>'Checking','checkNum'=>'1234567890123456'}})
2488
+ EcheckToken.from_hash({ 'echeckToken'=>{'cnpToken'=>'1234567890123','routingNum'=>'123456789','accType'=>'Checking','checkNum'=>'1234567890123456'}})
2489
2489
  }
2490
2490
  assert_equal "If echeckToken checkNum is specified, it must be between 1 and 15 characters long", exception.message
2491
2491
  end
@@ -2493,12 +2493,12 @@ module LitleOnline
2493
2493
  def test_recyclingRequest_recycleBy
2494
2494
  assert_equal(nil, RecyclingRequest.from_hash({'recyclingRequest'=>{}}).recycleBy)
2495
2495
  assert_equal("Merchant", RecyclingRequest.from_hash({'recyclingRequest'=>{'recycleBy'=>'Merchant'}}).recycleBy)
2496
- assert_equal("Litle", RecyclingRequest.from_hash({'recyclingRequest'=>{'recycleBy'=>'Litle'}}).recycleBy)
2496
+ assert_equal("Cnp", RecyclingRequest.from_hash({'recyclingRequest'=>{'recycleBy'=>'Cnp'}}).recycleBy)
2497
2497
  assert_equal("None", RecyclingRequest.from_hash({'recyclingRequest'=>{'recycleBy'=>'None'}}).recycleBy)
2498
2498
  exception = assert_raise(RuntimeError){
2499
2499
  RecyclingRequest.from_hash({ 'recyclingRequest'=>{'recycleBy'=>'Other' }})
2500
2500
  }
2501
- assert_equal "If recyclingRequest recycleBy is specified, it must be in [\"Merchant\", \"Litle\", \"None\"]", exception.message
2501
+ assert_equal "If recyclingRequest recycleBy is specified, it must be in [\"Merchant\", \"Cnp\", \"None\"]", exception.message
2502
2502
  end
2503
2503
 
2504
2504
  def test_recyclingRequest_recycleId
@@ -2527,8 +2527,8 @@ module LitleOnline
2527
2527
  }
2528
2528
  }
2529
2529
 
2530
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<subscription>.*<planCode>planCodeString<\/planCode><numberOfPayments>10<\/numberOfPayments><startDate>2014-03-07<\/startDate><amount>100<\/amount><\/subscription>.*/m), is_a(Hash))
2531
- LitleOnlineRequest.new.authorization(hash)
2530
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<subscription>.*<planCode>planCodeString<\/planCode><numberOfPayments>10<\/numberOfPayments><startDate>2014-03-07<\/startDate><amount>100<\/amount><\/subscription>.*/m), is_a(Hash))
2531
+ CnpOnlineRequest.new.authorization(hash)
2532
2532
  end
2533
2533
 
2534
2534
  def test_subscription_type_discount_addOn
@@ -2570,8 +2570,8 @@ module LitleOnline
2570
2570
  }
2571
2571
  }
2572
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)
2573
+ CnpXmlMapper.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
+ CnpOnlineRequest.new.authorization(hash)
2575
2575
  end
2576
2576
 
2577
2577
  def test_cancel_subscription
@@ -2581,8 +2581,8 @@ module LitleOnline
2581
2581
  'reportGroup'=>'Planets',
2582
2582
  'subscriptionId' => '1000'
2583
2583
  }
2584
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<cancelSubscription><subscriptionId>1000<\/subscriptionId><\/cancelSubscription>.*/m), is_a(Hash))
2585
- LitleOnlineRequest.new.cancel_subscription(hash)
2584
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<cancelSubscription><subscriptionId>1000<\/subscriptionId><\/cancelSubscription>.*/m), is_a(Hash))
2585
+ CnpOnlineRequest.new.cancel_subscription(hash)
2586
2586
  end
2587
2587
 
2588
2588
  def test_update_subscription_card
@@ -2636,8 +2636,8 @@ module LitleOnline
2636
2636
  'addOnCode'=>'addOnCode2',
2637
2637
  }],
2638
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)
2639
+ CnpXmlMapper.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
+ CnpOnlineRequest.new.update_subscription(hash)
2641
2641
  end
2642
2642
 
2643
2643
  def test_update_subscription_token
@@ -2653,7 +2653,7 @@ module LitleOnline
2653
2653
  },
2654
2654
  'token'=>
2655
2655
  {
2656
- 'litleToken'=>'litleTokenString'
2656
+ 'cnpToken'=>'cnpTokenString'
2657
2657
  },
2658
2658
  'billingDate' =>'2014-03-11',
2659
2659
  'createDiscount'=>[
@@ -2689,8 +2689,8 @@ module LitleOnline
2689
2689
  }],
2690
2690
  'deleteAddOn'=>[{'addOnCode'=>'addOnCode3'}]
2691
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)
2692
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<updateSubscription><subscriptionId>1000<\/subscriptionId><planCode>planCodeString<\/planCode><billToAddress><name>nameString<\/name><\/billToAddress><token><cnpToken>cnpTokenString<\/cnpToken><\/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
+ CnpOnlineRequest.new.update_subscription(hash)
2694
2694
  end
2695
2695
 
2696
2696
  def test_activate
@@ -2709,8 +2709,8 @@ module LitleOnline
2709
2709
  }
2710
2710
  }
2711
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)
2712
+ CnpXmlMapper.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
+ CnpOnlineRequest.new.activate(hash)
2714
2714
  end
2715
2715
 
2716
2716
  def test_deactivate
@@ -2728,8 +2728,8 @@ module LitleOnline
2728
2728
  }
2729
2729
  }
2730
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)
2731
+ CnpXmlMapper.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
+ CnpOnlineRequest.new.deactivate(hash)
2733
2733
  end
2734
2734
 
2735
2735
  def test_load
@@ -2748,8 +2748,8 @@ module LitleOnline
2748
2748
  }
2749
2749
  }
2750
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)
2751
+ CnpXmlMapper.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
+ CnpOnlineRequest.new.load_request(hash)
2753
2753
  end
2754
2754
 
2755
2755
  def test_unload
@@ -2768,8 +2768,8 @@ module LitleOnline
2768
2768
  }
2769
2769
  }
2770
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)
2771
+ CnpXmlMapper.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
+ CnpOnlineRequest.new.unload_request(hash)
2773
2773
  end
2774
2774
 
2775
2775
  def test_balanceInquiry
@@ -2787,8 +2787,8 @@ module LitleOnline
2787
2787
  }
2788
2788
  }
2789
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)
2790
+ CnpXmlMapper.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
+ CnpOnlineRequest.new.balance_inquiry(hash)
2792
2792
  end
2793
2793
 
2794
2794
  def test_createPlan
@@ -2806,8 +2806,8 @@ module LitleOnline
2806
2806
  'trialIntervalType'=>'MONTH',
2807
2807
  'active'=>'true'
2808
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)
2809
+ CnpXmlMapper.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
+ CnpOnlineRequest.new.create_plan(hash)
2811
2811
  end
2812
2812
 
2813
2813
  def test_updatePlan
@@ -2819,8 +2819,8 @@ module LitleOnline
2819
2819
  'active'=>'true'
2820
2820
  }
2821
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)
2822
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<updatePlan><planCode>planCodeString<\/planCode><active>true<\/active><\/updatePlan>.*/m), is_a(Hash))
2823
+ CnpOnlineRequest.new.update_plan(hash)
2824
2824
  end
2825
2825
 
2826
2826
  def test_virtualGiftCard
@@ -2832,8 +2832,8 @@ module LitleOnline
2832
2832
  'giftCardBin'=>'giftCardBinString'
2833
2833
  }
2834
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)
2835
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<virtualGiftCard><accountNumberLength>13<\/accountNumberLength><giftCardBin>giftCardBinString<\/giftCardBin><\/virtualGiftCard>.*/m), is_a(Hash))
2836
+ CnpOnlineRequest.new.virtual_giftcard(hash)
2837
2837
  end
2838
2838
 
2839
2839
  def test_activateReversal
@@ -2841,11 +2841,11 @@ module LitleOnline
2841
2841
  'merchantId' => '101',
2842
2842
  'version'=>'8.8',
2843
2843
  'reportGroup'=>'Planets',
2844
- 'litleTxnId'=>'111'
2844
+ 'cnpTxnId'=>'111'
2845
2845
  }
2846
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)
2847
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<activateReversal reportGroup="Planets"><cnpTxnId>111<\/cnpTxnId><\/activateReversal>.*/m), is_a(Hash))
2848
+ CnpOnlineRequest.new.activate_reversal(hash)
2849
2849
  end
2850
2850
 
2851
2851
  def test_depositReversal
@@ -2853,11 +2853,11 @@ module LitleOnline
2853
2853
  'merchantId' => '101',
2854
2854
  'version'=>'8.8',
2855
2855
  'reportGroup'=>'Planets',
2856
- 'litleTxnId'=>'111'
2856
+ 'cnpTxnId'=>'111'
2857
2857
  }
2858
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)
2859
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<depositReversal reportGroup="Planets"><cnpTxnId>111<\/cnpTxnId><\/depositReversal>.*/m), is_a(Hash))
2860
+ CnpOnlineRequest.new.deposit_reversal(hash)
2861
2861
  end
2862
2862
 
2863
2863
  def test_refundReversal
@@ -2865,11 +2865,11 @@ module LitleOnline
2865
2865
  'merchantId' => '101',
2866
2866
  'version'=>'8.8',
2867
2867
  'reportGroup'=>'Planets',
2868
- 'litleTxnId'=>'111'
2868
+ 'cnpTxnId'=>'111'
2869
2869
  }
2870
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)
2871
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<refundReversal reportGroup="Planets"><cnpTxnId>111<\/cnpTxnId><\/refundReversal>.*/m), is_a(Hash))
2872
+ CnpOnlineRequest.new.refund_reversal(hash)
2873
2873
  end
2874
2874
 
2875
2875
  def test_deactivateReversal
@@ -2877,11 +2877,11 @@ module LitleOnline
2877
2877
  'merchantId' => '101',
2878
2878
  'version'=>'8.8',
2879
2879
  'reportGroup'=>'Planets',
2880
- 'litleTxnId'=>'111'
2880
+ 'cnpTxnId'=>'111'
2881
2881
  }
2882
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)
2883
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<deactivateReversal reportGroup="Planets"><cnpTxnId>111<\/cnpTxnId><\/deactivateReversal>.*/m), is_a(Hash))
2884
+ CnpOnlineRequest.new.deactivate_reversal(hash)
2885
2885
  end
2886
2886
 
2887
2887
  def test_loadReversal
@@ -2889,11 +2889,11 @@ module LitleOnline
2889
2889
  'merchantId' => '101',
2890
2890
  'version'=>'8.8',
2891
2891
  'reportGroup'=>'Planets',
2892
- 'litleTxnId'=>'111'
2892
+ 'cnpTxnId'=>'111'
2893
2893
  }
2894
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)
2895
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<loadReversal reportGroup="Planets"><cnpTxnId>111<\/cnpTxnId><\/loadReversal>.*/m), is_a(Hash))
2896
+ CnpOnlineRequest.new.load_reversal(hash)
2897
2897
  end
2898
2898
 
2899
2899
  def test_unloadReversal
@@ -2901,11 +2901,11 @@ module LitleOnline
2901
2901
  'merchantId' => '101',
2902
2902
  'version'=>'8.8',
2903
2903
  'reportGroup'=>'Planets',
2904
- 'litleTxnId'=>'111'
2904
+ 'cnpTxnId'=>'111'
2905
2905
  }
2906
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)
2907
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<unloadReversal reportGroup="Planets"><cnpTxnId>111<\/cnpTxnId><\/unloadReversal>.*/m), is_a(Hash))
2908
+ CnpOnlineRequest.new.unload_reversal(hash)
2909
2909
  end
2910
2910
 
2911
2911
  def test_mpos_type
@@ -2923,8 +2923,8 @@ module LitleOnline
2923
2923
  }
2924
2924
  }
2925
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)
2926
+ CnpXmlMapper.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
+ CnpOnlineRequest.new.authorization(hash)
2928
2928
  end
2929
2929
  end
2930
2930
  end