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
@@ -24,112 +24,112 @@ 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
 
31
- module LitleOnline
32
- class TestLitleXmlMapper < Test::Unit::TestCase
31
+ module CnpOnline
32
+ class TestCnpXmlMapper < Test::Unit::TestCase
33
33
 
34
- def test_LitleXmlMapper_request_xml_response_0
34
+ def test_CnpXmlMapper_request_xml_response_0
35
35
  hash =
36
36
  {
37
37
  'merchantId' => '101',
38
38
  'id' => 'test',
39
39
  'version'=>'8.8',
40
40
  'reportGroup'=>'Planets',
41
- 'litleTxnId'=>'123456',
41
+ 'cnpTxnId'=>'123456',
42
42
  }
43
- Communications.expects(:http_post).returns("<litleOnlineResponse version=\"1.0\" xmlns=\"http://www.litle.com/schema/online\" response=\"0\" message=\"Invalid credentials. Contact support@litle.com.\"></litleOnlineResponse>")
44
- response = LitleXmlMapper.request("","")
43
+ Communications.expects(:http_post).returns("<cnpOnlineResponse version=\"1.0\" xmlns=\"http://www.vantivcnp.com/schema/online\" response=\"0\" message=\"Invalid credentials. Contact support@cnp.com.\"></cnpOnlineResponse>")
44
+ response = CnpXmlMapper.request("","")
45
45
  assert_equal('0',response.response)
46
46
  end
47
47
 
48
- def test_LitleXmlMapper_request_xml_response_1
48
+ def test_CnpXmlMapper_request_xml_response_1
49
49
  hash =
50
50
  {
51
51
  'merchantId' => '101',
52
52
  'id' => 'test',
53
53
  'version'=>'8.8',
54
54
  'reportGroup'=>'Planets',
55
- 'litleTxnId'=>'123456',
55
+ 'cnpTxnId'=>'123456',
56
56
  }
57
- Communications.expects(:http_post).returns("<litleOnlineResponse version=\"1.0\" xmlns=\"http://www.litle.com/schema/online\" response=\"1\" message=\"Invalid credentials. Contact support@litle.com.\"></litleOnlineResponse>")
57
+ Communications.expects(:http_post).returns("<cnpOnlineResponse version=\"1.0\" xmlns=\"http://www.vantivcnp.com/schema/online\" response=\"1\" message=\"Invalid credentials. Contact support@cnp.com.\"></cnpOnlineResponse>")
58
58
  #Get exceptions
59
59
  exception = assert_raise(RuntimeError){
60
- LitleXmlMapper.request("","")
60
+ CnpXmlMapper.request("","")
61
61
  }
62
62
  #Test
63
63
  assert(exception.message =~ /Error with http response, code: 1/)
64
64
  end
65
65
 
66
- def test_LitleXmlMapper_request_xml_response_2
66
+ def test_CnpXmlMapper_request_xml_response_2
67
67
  hash =
68
68
  {
69
69
  'merchantId' => '101',
70
70
  'id' => 'test',
71
71
  'version'=>'8.8',
72
72
  'reportGroup'=>'Planets',
73
- 'litleTxnId'=>'123456',
73
+ 'cnpTxnId'=>'123456',
74
74
  }
75
- Communications.expects(:http_post).returns("<litleOnlineResponse version=\"1.0\" xmlns=\"http://www.litle.com/schema/online\" response=\"2\" message=\"Invalid credentials. Contact support@litle.com.\"></litleOnlineResponse>")
75
+ Communications.expects(:http_post).returns("<cnpOnlineResponse version=\"1.0\" xmlns=\"http://www.vantivcnp.com/schema/online\" response=\"2\" message=\"Invalid credentials. Contact support@cnp.com.\"></cnpOnlineResponse>")
76
76
  #Get exceptions
77
77
  exception = assert_raise(RuntimeError){
78
- LitleXmlMapper.request("","")
78
+ CnpXmlMapper.request("","")
79
79
  }
80
80
  #Test
81
81
  assert(exception.message =~ /Error with http response, code: 2/)
82
82
  end
83
83
 
84
- def test_LitleXmlMapper_request_xml_response_3
84
+ def test_CnpXmlMapper_request_xml_response_3
85
85
  hash =
86
86
  {
87
87
  'merchantId' => '101',
88
88
  'id' => 'test',
89
89
  'version'=>'8.8',
90
90
  'reportGroup'=>'Planets',
91
- 'litleTxnId'=>'123456',
91
+ 'cnpTxnId'=>'123456',
92
92
  }
93
- Communications.expects(:http_post).returns("<litleOnlineResponse version=\"1.0\" xmlns=\"http://www.litle.com/schema/online\" response=\"3\" message=\"Invalid credentials. Contact support@litle.com.\"></litleOnlineResponse>")
93
+ Communications.expects(:http_post).returns("<cnpOnlineResponse version=\"1.0\" xmlns=\"http://www.vantivcnp.com/schema/online\" response=\"3\" message=\"Invalid credentials. Contact support@cnp.com.\"></cnpOnlineResponse>")
94
94
  #Get exceptions
95
95
  exception = assert_raise(RuntimeError){
96
- LitleXmlMapper.request("","")
96
+ CnpXmlMapper.request("","")
97
97
  }
98
98
  #Test
99
99
  assert(exception.message =~ /Error with http response, code: 3/)
100
100
  end
101
101
 
102
- def test_LitleXmlMapper_request_xml_response_4
102
+ def test_CnpXmlMapper_request_xml_response_4
103
103
  hash =
104
104
  {
105
105
  'merchantId' => '101',
106
106
  'id' => 'test',
107
107
  'version'=>'8.8',
108
108
  'reportGroup'=>'Planets',
109
- 'litleTxnId'=>'123456',
109
+ 'cnpTxnId'=>'123456',
110
110
  }
111
- Communications.expects(:http_post).returns("<litleOnlineResponse version=\"1.0\" xmlns=\"http://www.litle.com/schema/online\" response=\"4\" message=\"Invalid credentials. Contact support@litle.com.\"></litleOnlineResponse>")
111
+ Communications.expects(:http_post).returns("<cnpOnlineResponse version=\"1.0\" xmlns=\"http://www.vantivcnp.com/schema/online\" response=\"4\" message=\"Invalid credentials. Contact support@cnp.com.\"></cnpOnlineResponse>")
112
112
  #Get exceptions
113
113
  exception = assert_raise(RuntimeError){
114
- LitleXmlMapper.request("","")
114
+ CnpXmlMapper.request("","")
115
115
  }
116
116
  #Test
117
117
  assert(exception.message =~ /Error with http response, code: 4/)
118
118
  end
119
119
 
120
- def test_LitleXmlMapper_request_xml_response_5
120
+ def test_CnpXmlMapper_request_xml_response_5
121
121
  hash =
122
122
  {
123
123
  'merchantId' => '101',
124
124
  'id' => 'test',
125
125
  'version'=>'8.8',
126
126
  'reportGroup'=>'Planets',
127
- 'litleTxnId'=>'123456',
127
+ 'cnpTxnId'=>'123456',
128
128
  }
129
- Communications.expects(:http_post).returns("<litleOnlineResponse version=\"1.0\" xmlns=\"http://www.litle.com/schema/online\" response=\"5\" message=\"Invalid credentials. Contact support@litle.com.\"></litleOnlineResponse>")
129
+ Communications.expects(:http_post).returns("<cnpOnlineResponse version=\"1.0\" xmlns=\"http://www.vantivcnp.com/schema/online\" response=\"5\" message=\"Invalid credentials. Contact support@cnp.com.\"></cnpOnlineResponse>")
130
130
  #Get exceptions
131
131
  exception = assert_raise(RuntimeError){
132
- LitleXmlMapper.request("","")
132
+ CnpXmlMapper.request("","")
133
133
  }
134
134
  #Test
135
135
  assert(exception.message =~ /Error with http response, code: 5/)
@@ -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 TestActivate < Test::Unit::TestCase
30
30
 
31
31
  def test_simple_card
@@ -44,8 +44,8 @@ module LitleOnline
44
44
  }
45
45
  }
46
46
 
47
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<activate reportGroup="Planets"><orderId>11<\/orderId><amount>500<\/amount><orderSource>ecommerce<\/orderSource><card><type>GC<\/type><number>4100000000000001<\/number><expDate>1210<\/expDate><\/card><\/activate>.*/m), is_a(Hash))
48
- LitleOnlineRequest.new.activate(hash)
47
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<activate reportGroup="Planets"><orderId>11<\/orderId><amount>500<\/amount><orderSource>ecommerce<\/orderSource><card><type>GC<\/type><number>4100000000000001<\/number><expDate>1210<\/expDate><\/card><\/activate>.*/m), is_a(Hash))
48
+ CnpOnlineRequest.new.activate(hash)
49
49
  end
50
50
 
51
51
  def test_simple_card1
@@ -64,8 +64,8 @@ module LitleOnline
64
64
  }
65
65
  }
66
66
 
67
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<activate reportGroup="Planets"><orderId>11<\/orderId><amount>500<\/amount><orderSource>ecommerce<\/orderSource><card><type>GC<\/type><number>4100000000000001<\/number><expDate>1210<\/expDate><\/card><\/activate>.*/m), is_a(Hash))
68
- LitleOnlineRequest.new.activate(hash)
67
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<activate reportGroup="Planets"><orderId>11<\/orderId><amount>500<\/amount><orderSource>ecommerce<\/orderSource><card><type>GC<\/type><number>4100000000000001<\/number><expDate>1210<\/expDate><\/card><\/activate>.*/m), is_a(Hash))
68
+ CnpOnlineRequest.new.activate(hash)
69
69
  end
70
70
 
71
71
  def test_simple_virtualGiftcard
@@ -83,8 +83,8 @@ module LitleOnline
83
83
  }
84
84
  }
85
85
 
86
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<activate reportGroup="Planets"><orderId>11<\/orderId><amount>500<\/amount><orderSource>ecommerce<\/orderSource><virtualGiftCard><accountNumberLength>13<\/accountNumberLength><giftCardBin>giftCardBinString<\/giftCardBin><\/virtualGiftCard><\/activate>.*/m), is_a(Hash))
87
- LitleOnlineRequest.new.activate(hash)
86
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<activate reportGroup="Planets"><orderId>11<\/orderId><amount>500<\/amount><orderSource>ecommerce<\/orderSource><virtualGiftCard><accountNumberLength>13<\/accountNumberLength><giftCardBin>giftCardBinString<\/giftCardBin><\/virtualGiftCard><\/activate>.*/m), is_a(Hash))
87
+ CnpOnlineRequest.new.activate(hash)
88
88
  end
89
89
 
90
90
  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 TestActivateReversal < 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,23 +22,23 @@ 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
29
  #test Authorization Transaction
30
- module LitleOnline
30
+ module CnpOnline
31
31
  class TestAuth < Test::Unit::TestCase
32
32
  def test_success_re_auth
33
33
  hash = {
34
34
  'merchantId' => '101',
35
35
  'version'=>'8.8',
36
36
  'reportGroup'=>'Planets',
37
- 'litleTxnId'=>'123456'
37
+ 'cnpTxnId'=>'123456'
38
38
  }
39
39
 
40
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<litleTxnId>123456<\/litleTxnId>.*/m), is_a(Hash))
41
- LitleOnlineRequest.new.authorization(hash)
40
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<cnpTxnId>123456<\/cnpTxnId>.*/m), is_a(Hash))
41
+ CnpOnlineRequest.new.authorization(hash)
42
42
  end
43
43
 
44
44
  def test_success_applepay
@@ -62,8 +62,8 @@ module LitleOnline
62
62
  }
63
63
  }
64
64
 
65
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*?<litleOnlineRequest.*?<authorization.*?<applepay>.*?<data>user<\/data>.*?<\/applepay>.*?<\/authorization>.*?/m), is_a(Hash))
66
- LitleOnlineRequest.new.authorization(hash)
65
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*?<cnpOnlineRequest.*?<authorization.*?<applepay>.*?<data>user<\/data>.*?<\/applepay>.*?<\/authorization>.*?/m), is_a(Hash))
66
+ CnpOnlineRequest.new.authorization(hash)
67
67
  end
68
68
 
69
69
  def test_both_choices_card_and_applepay
@@ -91,7 +91,7 @@ module LitleOnline
91
91
  'version' =>'10000'
92
92
  }}
93
93
 
94
- exception = assert_raise(RuntimeError){LitleOnlineRequest.new.authorization(hash)}
94
+ exception = assert_raise(RuntimeError){CnpOnlineRequest.new.authorization(hash)}
95
95
  assert_match /Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!/, exception.message
96
96
  end
97
97
 
@@ -114,7 +114,7 @@ module LitleOnline
114
114
  'transactionId'=>'123456'
115
115
  }}
116
116
 
117
- exception = assert_raise(RuntimeError){LitleOnlineRequest.new.authorization(hash)}
117
+ exception = assert_raise(RuntimeError){CnpOnlineRequest.new.authorization(hash)}
118
118
  assert_match /Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!/, exception.message
119
119
  end
120
120
 
@@ -141,7 +141,7 @@ module LitleOnline
141
141
  'token'=>'1234',
142
142
  'transactionId'=>'123456'
143
143
  }}
144
- exception = assert_raise(RuntimeError){LitleOnlineRequest.new.authorization(hash)}
144
+ exception = assert_raise(RuntimeError){CnpOnlineRequest.new.authorization(hash)}
145
145
  assert_match /Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!/, exception.message
146
146
  end
147
147
 
@@ -170,13 +170,13 @@ module LitleOnline
170
170
  'token'=>'1234',
171
171
  'transactionId'=>'123456'},
172
172
  'token'=> {
173
- 'litleToken'=>'1234567890123',
173
+ 'cnpToken'=>'1234567890123',
174
174
  'expDate'=>'1210',
175
175
  'cardValidationNum'=>'555',
176
176
  'type'=>'VI'
177
177
  }}
178
178
 
179
- exception = assert_raise(RuntimeError){LitleOnlineRequest.new.authorization(hash)}
179
+ exception = assert_raise(RuntimeError){CnpOnlineRequest.new.authorization(hash)}
180
180
  assert_match /Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!/, exception.message
181
181
  end
182
182
 
@@ -193,8 +193,8 @@ module LitleOnline
193
193
  }
194
194
  }
195
195
 
196
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<merchantData>.*?<campaign>foo<\/campaign>.*?<\/merchantData>.*/m), is_a(Hash))
197
- LitleOnlineRequest.new.authorization(hash)
196
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<merchantData>.*?<campaign>foo<\/campaign>.*?<\/merchantData>.*/m), is_a(Hash))
197
+ CnpOnlineRequest.new.authorization(hash)
198
198
  end
199
199
 
200
200
  def test_fraud_filter_override
@@ -208,8 +208,8 @@ module LitleOnline
208
208
  'fraudFilterOverride'=> 'true'
209
209
  }
210
210
 
211
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<authorization.*?<fraudFilterOverride>true<\/fraudFilterOverride>.*?<\/authorization>.*/m), is_a(Hash))
212
- LitleOnlineRequest.new.authorization(hash)
211
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<authorization.*?<fraudFilterOverride>true<\/fraudFilterOverride>.*?<\/authorization>.*/m), is_a(Hash))
212
+ CnpOnlineRequest.new.authorization(hash)
213
213
  end
214
214
 
215
215
 
@@ -229,7 +229,7 @@ module LitleOnline
229
229
  'number' =>'4100000000000001',
230
230
  'expDate' =>'1210'
231
231
  }}
232
- exception = assert_raise(RuntimeError){LitleOnlineRequest.new.authorization(hash)}
232
+ exception = assert_raise(RuntimeError){CnpOnlineRequest.new.authorization(hash)}
233
233
  assert_match /If pos is specified, it must have a capability/, exception.message
234
234
  end
235
235
 
@@ -245,7 +245,7 @@ module LitleOnline
245
245
  'token'=>'1234',
246
246
  'transactionId'=>'123456'
247
247
  }}
248
- exception = assert_raise(RuntimeError){LitleOnlineRequest.new.authorization(hash)}
248
+ exception = assert_raise(RuntimeError){CnpOnlineRequest.new.authorization(hash)}
249
249
  assert_match /If paypal is specified, it must have a payerId/, exception.message
250
250
  end
251
251
 
@@ -261,7 +261,7 @@ module LitleOnline
261
261
  'token'=>'1234',
262
262
  'payerId'=>'123456'
263
263
  }}
264
- exception = assert_raise(RuntimeError){LitleOnlineRequest.new.authorization(hash)}
264
+ exception = assert_raise(RuntimeError){CnpOnlineRequest.new.authorization(hash)}
265
265
  assert_match /If paypal is specified, it must have a transactionId/, exception.message
266
266
  end
267
267
 
@@ -279,7 +279,7 @@ module LitleOnline
279
279
  'number' =>'4100000000000001',
280
280
  'expDate' =>'1210'
281
281
  }}
282
- exception = assert_raise(RuntimeError){LitleOnlineRequest.new.authorization(hash)}
282
+ exception = assert_raise(RuntimeError){CnpOnlineRequest.new.authorization(hash)}
283
283
  assert_match /If pos is specified, it must have a entryMode/, exception.message
284
284
  end
285
285
 
@@ -296,8 +296,8 @@ module LitleOnline
296
296
  'fraudFilterOverride'=> 'true'
297
297
  }
298
298
 
299
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<authentication.*?<user>UNIT<\/user>.*?<\/authentication>.*/m), is_a(Hash))
300
- LitleOnlineRequest.new.authorization(hash)
299
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<authentication.*?<user>UNIT<\/user>.*?<\/authentication>.*/m), is_a(Hash))
300
+ CnpOnlineRequest.new.authorization(hash)
301
301
  end
302
302
 
303
303
  def test_auth_override_password
@@ -313,8 +313,8 @@ module LitleOnline
313
313
  'fraudFilterOverride'=> 'true'
314
314
  }
315
315
 
316
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<authentication.*?<password>TEST<\/password>.*?<\/authentication>.*/m), is_a(Hash))
317
- LitleOnlineRequest.new.authorization(hash)
316
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<authentication.*?<password>TEST<\/password>.*?<\/authentication>.*/m), is_a(Hash))
317
+ CnpOnlineRequest.new.authorization(hash)
318
318
  end
319
319
 
320
320
  def test_logged_in_user
@@ -323,12 +323,12 @@ module LitleOnline
323
323
  'merchantId' => '101',
324
324
  'version'=>'8.8',
325
325
  'reportGroup'=>'Planets',
326
- 'litleTxnId'=>'123456',
326
+ 'cnpTxnId'=>'123456',
327
327
  'loggedInUser'=>'gdake'
328
328
  }
329
329
 
330
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*(loggedInUser="gdake".*merchantSdk="Ruby;8.14.0")|(merchantSdk="Ruby;8.14.0".*loggedInUser="gdake").*/m), is_a(Hash))
331
- LitleOnlineRequest.new.authorization(hash)
330
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*(loggedInUser="gdake".*merchantSdk="Ruby;8.14.0")|(merchantSdk="Ruby;8.14.0".*loggedInUser="gdake").*/m), is_a(Hash))
331
+ CnpOnlineRequest.new.authorization(hash)
332
332
  end
333
333
 
334
334
  def test_surcharge_amount
@@ -339,8 +339,8 @@ module LitleOnline
339
339
  'orderSource' => 'ecommerce',
340
340
  'reportGroup' => 'Planets'
341
341
  }
342
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<amount>2<\/amount><surchargeAmount>1<\/surchargeAmount><orderSource>ecommerce<\/orderSource>.*/m), is_a(Hash))
343
- LitleOnlineRequest.new.authorization(hash)
342
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<amount>2<\/amount><surchargeAmount>1<\/surchargeAmount><orderSource>ecommerce<\/orderSource>.*/m), is_a(Hash))
343
+ CnpOnlineRequest.new.authorization(hash)
344
344
  end
345
345
 
346
346
  def test_secondary_amount
@@ -351,8 +351,8 @@ module LitleOnline
351
351
  'orderSource' => 'ecommerce',
352
352
  'reportGroup' => 'Planets'
353
353
  }
354
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<amount>2<\/amount><secondaryAmount>1<\/secondaryAmount><orderSource>ecommerce<\/orderSource>.*/m), is_a(Hash))
355
- LitleOnlineRequest.new.authorization(hash)
354
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<amount>2<\/amount><secondaryAmount>1<\/secondaryAmount><orderSource>ecommerce<\/orderSource>.*/m), is_a(Hash))
355
+ CnpOnlineRequest.new.authorization(hash)
356
356
  end
357
357
 
358
358
  def test_surcharge_amount_optional
@@ -362,8 +362,8 @@ module LitleOnline
362
362
  'orderSource' => 'ecommerce',
363
363
  'reportGroup' => 'Planets'
364
364
  }
365
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<amount>2<\/amount><orderSource>ecommerce<\/orderSource>.*/m), is_a(Hash))
366
- LitleOnlineRequest.new.authorization(hash)
365
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<amount>2<\/amount><orderSource>ecommerce<\/orderSource>.*/m), is_a(Hash))
366
+ CnpOnlineRequest.new.authorization(hash)
367
367
  end
368
368
 
369
369
  def test_method_of_payment_allows_giftcard
@@ -377,8 +377,8 @@ module LitleOnline
377
377
  'type' => 'GC'
378
378
  }
379
379
  }
380
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<card><type>GC<\/type><number>4141000000000000<\/number><expDate>1210<\/expDate><\/card>.*/m), is_a(Hash))
381
- LitleOnlineRequest.new.authorization(hash)
380
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<card><type>GC<\/type><number>4141000000000000<\/number><expDate>1210<\/expDate><\/card>.*/m), is_a(Hash))
381
+ CnpOnlineRequest.new.authorization(hash)
382
382
  end
383
383
 
384
384
  def test_advanced_fraud_check
@@ -393,8 +393,8 @@ module LitleOnline
393
393
  },
394
394
  'advancedFraudChecks' => {'threatMetrixSessionId'=>'1234'}
395
395
  }
396
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<advancedFraudChecks><threatMetrixSessionId>1234<\/threatMetrixSessionId><\/advancedFraudChecks>.*/m), is_a(Hash))
397
- LitleOnlineRequest.new.authorization(hash)
396
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<advancedFraudChecks><threatMetrixSessionId>1234<\/threatMetrixSessionId><\/advancedFraudChecks>.*/m), is_a(Hash))
397
+ CnpOnlineRequest.new.authorization(hash)
398
398
  end
399
399
 
400
400
  def test_mpos
@@ -411,8 +411,8 @@ module LitleOnline
411
411
  'track2Status'=>'0'
412
412
  }
413
413
  }
414
- 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))
415
- LitleOnlineRequest.new.authorization(hash)
414
+ 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))
415
+ CnpOnlineRequest.new.authorization(hash)
416
416
  end
417
417
 
418
418
  def test_processingType_originalNetworkTransactionId_originalTransactionAmount
@@ -429,8 +429,8 @@ module LitleOnline
429
429
  'originalNetworkTransactionId' => '9876543210',
430
430
  'originalTransactionAmount' => '536981'
431
431
  }
432
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<processingType>initialInstallment<\/processingType><originalNetworkTransactionId>9876543210<\/originalNetworkTransactionId><originalTransactionAmount>536981<\/originalTransactionAmount>.*/m), is_a(Hash))
433
- LitleOnlineRequest.new.authorization(hash)
432
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<processingType>initialInstallment<\/processingType><originalNetworkTransactionId>9876543210<\/originalNetworkTransactionId><originalTransactionAmount>536981<\/originalTransactionAmount>.*/m), is_a(Hash))
433
+ CnpOnlineRequest.new.authorization(hash)
434
434
  end
435
435
 
436
436
  def test_processingType_wallet
@@ -455,8 +455,8 @@ module LitleOnline
455
455
  'walletSourceTypeId' => 'VCIND'
456
456
  }
457
457
  }
458
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<wallet><walletSourceType>VisaCheckout<\/walletSourceType><walletSourceTypeId>VCIND<\/walletSourceTypeId><\/wallet>.*/m), is_a(Hash))
459
- LitleOnlineRequest.new.authorization(hash)
458
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<wallet><walletSourceType>VisaCheckout<\/walletSourceType><walletSourceTypeId>VCIND<\/walletSourceTypeId><\/wallet>.*/m), is_a(Hash))
459
+ CnpOnlineRequest.new.authorization(hash)
460
460
  end
461
461
 
462
462
  end