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 TestDeactivate < Test::Unit::TestCase
30
30
 
31
31
  def test_simple
@@ -43,8 +43,8 @@ module LitleOnline
43
43
  }
44
44
  }
45
45
 
46
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<deactivate reportGroup="Planets"><orderId>11<\/orderId><orderSource>ecommerce<\/orderSource><card><type>GC<\/type><number>4100000000000001<\/number><expDate>1210<\/expDate><\/card><\/deactivate>.*/m), is_a(Hash))
47
- LitleOnlineRequest.new.deactivate(hash)
46
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<deactivate reportGroup="Planets"><orderId>11<\/orderId><orderSource>ecommerce<\/orderSource><card><type>GC<\/type><number>4100000000000001<\/number><expDate>1210<\/expDate><\/card><\/deactivate>.*/m), is_a(Hash))
47
+ CnpOnlineRequest.new.deactivate(hash)
48
48
  end
49
49
 
50
50
  def test_simple
@@ -62,8 +62,8 @@ module LitleOnline
62
62
  }
63
63
  }
64
64
 
65
- 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))
66
- LitleOnlineRequest.new.deactivate(hash)
65
+ 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))
66
+ CnpOnlineRequest.new.deactivate(hash)
67
67
  end
68
68
 
69
69
  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 TestDeactivateReversal < 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,18 +22,18 @@ 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 TestDepositReversal < Test::Unit::TestCase
31
31
  def test_simple
32
32
  hash = {
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,22 +22,22 @@ 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 Test_echeckCredit < Test::Unit::TestCase
31
31
  def test_echeck_credit_with_both
32
32
  hash = {
33
33
  'merchantId' => '101',
34
34
  'version'=>'8.8',
35
35
  'reportGroup'=>'Planets',
36
- 'litleTxnId'=>'123456',
37
- 'echeckToken' => {'accType'=>'Checking','litleToken'=>'1234565789012','routingNum'=>'123456789','checkNum'=>'123455'},
36
+ 'cnpTxnId'=>'123456',
37
+ 'echeckToken' => {'accType'=>'Checking','cnpToken'=>'1234565789012','routingNum'=>'123456789','checkNum'=>'123455'},
38
38
  'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'}
39
39
  }
40
- exception = assert_raise(RuntimeError){LitleOnlineRequest.new.echeck_credit(hash)}
40
+ exception = assert_raise(RuntimeError){CnpOnlineRequest.new.echeck_credit(hash)}
41
41
  assert_match /Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!/, exception.message
42
42
  end
43
43
 
@@ -48,11 +48,11 @@ module LitleOnline
48
48
  'merchantId' => '101',
49
49
  'version'=>'8.8',
50
50
  'reportGroup'=>'Planets',
51
- 'litleTxnId'=>'123456',
51
+ 'cnpTxnId'=>'123456',
52
52
  'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'}
53
53
  }
54
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*(loggedInUser="gdake".*merchantSdk="Ruby;8.14.0")|(merchantSdk="Ruby;8.14.0".*loggedInUser="gdake").*/m), is_a(Hash))
55
- LitleOnlineRequest.new.echeck_credit(hash)
54
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*(loggedInUser="gdake".*merchantSdk="Ruby;8.14.0")|(merchantSdk="Ruby;8.14.0".*loggedInUser="gdake").*/m), is_a(Hash))
55
+ CnpOnlineRequest.new.echeck_credit(hash)
56
56
  end
57
57
 
58
58
  def test_echeck_credit_with_orderId_secondary_amount
@@ -63,8 +63,8 @@ module LitleOnline
63
63
  'orderSource' => 'ecommerce',
64
64
  'reportGroup' => 'Planets'
65
65
  }
66
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<amount>2<\/amount><secondaryAmount>1<\/secondaryAmount><orderSource>ecommerce<\/orderSource>.*/m), is_a(Hash))
67
- LitleOnlineRequest.new.echeck_credit(hash)
66
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<amount>2<\/amount><secondaryAmount>1<\/secondaryAmount><orderSource>ecommerce<\/orderSource>.*/m), is_a(Hash))
67
+ CnpOnlineRequest.new.echeck_credit(hash)
68
68
  end
69
69
 
70
70
  def test_echeck_credit_with_txnId_secondaryAmount
@@ -72,12 +72,12 @@ module LitleOnline
72
72
  'merchantId' => '101',
73
73
  'version'=>'8.8',
74
74
  'reportGroup'=>'Planets',
75
- 'litleTxnId'=>'123456789101112',
75
+ 'cnpTxnId'=>'123456789101112',
76
76
  'amount'=>'12',
77
77
  'secondaryAmount'=>'1'
78
78
  }
79
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<litleTxnId>123456789101112<\/litleTxnId>.*?<amount>12<\/amount><secondaryAmount>1<\/secondaryAmount>.*/m), is_a(Hash))
80
- LitleOnlineRequest.new.echeck_credit(hash)
79
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<cnpTxnId>123456789101112<\/cnpTxnId>.*?<amount>12<\/amount><secondaryAmount>1<\/secondaryAmount>.*/m), is_a(Hash))
80
+ CnpOnlineRequest.new.echeck_credit(hash)
81
81
  end
82
82
 
83
83
  def test_echeck_credit_with_customIdentifier
@@ -91,12 +91,12 @@ module LitleOnline
91
91
  'orderId'=>'12345',
92
92
  'orderSource'=>'ecommerce',
93
93
  'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455','ccdPaymentInformation'=>'12345678901234567890123456789012345678901234567890123456789012345678901234567890'},
94
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'},
94
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'cnp.com'},
95
95
  'merchantData'=>{'campaign'=>'camping'},
96
96
  'customIdentifier' =>'identifier',
97
97
  }
98
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<customIdentifier>identifier<\/customIdentifier>.*/m), is_a(Hash))
99
- LitleOnlineRequest.new.echeck_credit(hash)
98
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<customIdentifier>identifier<\/customIdentifier>.*/m), is_a(Hash))
99
+ CnpOnlineRequest.new.echeck_credit(hash)
100
100
  end
101
101
 
102
102
  end
@@ -22,21 +22,21 @@ 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 Test_echeckRedeposit < Test::Unit::TestCase
30
30
  def test_echeck_redeposit_with_both
31
31
  hash = {
32
32
  'merchantId' => '101',
33
33
  'version'=>'8.8',
34
34
  'reportGroup'=>'Planets',
35
- 'litleTxnId'=>'123456',
36
- 'echeckToken' => {'accType'=>'Checking','litleToken'=>'1234565789012','routingNum'=>'123456789','checkNum'=>'123455'},
35
+ 'cnpTxnId'=>'123456',
36
+ 'echeckToken' => {'accType'=>'Checking','cnpToken'=>'1234565789012','routingNum'=>'123456789','checkNum'=>'123455'},
37
37
  'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'}
38
38
  }
39
- exception = assert_raise(RuntimeError){LitleOnlineRequest.new.echeck_redeposit(hash)}
39
+ exception = assert_raise(RuntimeError){CnpOnlineRequest.new.echeck_redeposit(hash)}
40
40
  assert_match /Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!/, exception.message
41
41
  end
42
42
 
@@ -45,10 +45,10 @@ module LitleOnline
45
45
  'merchantId' => '101',
46
46
  'version'=>'8.8',
47
47
  'reportGroup'=>'Planets',
48
- 'litleTxnId'=>'123456',
48
+ 'cnpTxnId'=>'123456',
49
49
  'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','checkNum'=>'123455'}
50
50
  }
51
- exception = assert_raise(RuntimeError) {LitleOnlineRequest.new.echeck_redeposit(hash)}
51
+ exception = assert_raise(RuntimeError) {CnpOnlineRequest.new.echeck_redeposit(hash)}
52
52
  assert_match /If echeck is specified, it must have a routingNum/, exception.message
53
53
  end
54
54
 
@@ -57,10 +57,10 @@ module LitleOnline
57
57
  'merchantId' => '101',
58
58
  'version'=>'8.8',
59
59
  'reportGroup'=>'Planets',
60
- 'litleTxnId'=>'123456',
61
- 'echeckToken' => {'accType'=>'Checking','litleToken'=>'1234565789012','checkNum'=>'123455'}
60
+ 'cnpTxnId'=>'123456',
61
+ 'echeckToken' => {'accType'=>'Checking','cnpToken'=>'1234565789012','checkNum'=>'123455'}
62
62
  }
63
- exception = assert_raise(RuntimeError) {LitleOnlineRequest.new.echeck_redeposit(hash)}
63
+ exception = assert_raise(RuntimeError) {CnpOnlineRequest.new.echeck_redeposit(hash)}
64
64
  assert_match /If echeckToken is specified, it must have a routingNum/, exception.message
65
65
  end
66
66
 
@@ -71,11 +71,11 @@ module LitleOnline
71
71
  'merchantId' => '101',
72
72
  'version'=>'8.8',
73
73
  'reportGroup'=>'Planets',
74
- 'litleTxnId'=>'123456',
74
+ 'cnpTxnId'=>'123456',
75
75
  'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'}
76
76
  }
77
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*(loggedInUser="gdake".*merchantSdk="Ruby;8.14.0")|(merchantSdk="Ruby;8.14.0".*loggedInUser="gdake").*/m), is_a(Hash))
78
- LitleOnlineRequest.new.echeck_redeposit(hash)
77
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*(loggedInUser="gdake".*merchantSdk="Ruby;8.14.0")|(merchantSdk="Ruby;8.14.0".*loggedInUser="gdake").*/m), is_a(Hash))
78
+ CnpOnlineRequest.new.echeck_redeposit(hash)
79
79
  end
80
80
 
81
81
  def test_merchant_data
@@ -84,11 +84,11 @@ module LitleOnline
84
84
  'merchantId' => '101',
85
85
  'version'=>'8.8',
86
86
  'reportGroup'=>'Planets',
87
- 'litleTxnId'=>'123456',
87
+ 'cnpTxnId'=>'123456',
88
88
  'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'}
89
89
  }
90
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<\/echeck>.*<merchantData>.*<campaign>camping<\/campaign>.*<\/merchantData>/m), is_a(Hash))
91
- LitleOnlineRequest.new.echeck_redeposit(hash)
90
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<\/echeck>.*<merchantData>.*<campaign>camping<\/campaign>.*<\/merchantData>/m), is_a(Hash))
91
+ CnpOnlineRequest.new.echeck_redeposit(hash)
92
92
  end
93
93
 
94
94
  def test_customIdentifier
@@ -98,11 +98,11 @@ module LitleOnline
98
98
  'merchantId' => '101',
99
99
  'version'=>'8.8',
100
100
  'reportGroup'=>'Planets',
101
- 'litleTxnId'=>'123456',
101
+ 'cnpTxnId'=>'123456',
102
102
  'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'}
103
103
  }
104
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<customIdentifier>identifier<\/customIdentifier>.*/m), is_a(Hash))
105
- LitleOnlineRequest.new.echeck_redeposit(hash)
104
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<customIdentifier>identifier<\/customIdentifier>.*/m), is_a(Hash))
105
+ CnpOnlineRequest.new.echeck_redeposit(hash)
106
106
  end
107
107
 
108
108
  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 Test_echeckSale < Test::Unit::TestCase
30
30
 
31
31
  def test_echeck_sale_with_both
@@ -33,11 +33,11 @@ module LitleOnline
33
33
  'merchantId' => '101',
34
34
  'version'=>'8.8',
35
35
  'reportGroup'=>'Planets',
36
- 'litleTxnId'=>'123456',
37
- 'echeckToken' => {'accType'=>'Checking','litleToken'=>'1234565789012','routingNum'=>'123456789','checkNum'=>'123455'},
36
+ 'cnpTxnId'=>'123456',
37
+ 'echeckToken' => {'accType'=>'Checking','cnpToken'=>'1234565789012','routingNum'=>'123456789','checkNum'=>'123455'},
38
38
  'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'}
39
39
  }
40
- exception = assert_raise(RuntimeError){LitleOnlineRequest.new.echeck_sale(hash)}
40
+ exception = assert_raise(RuntimeError){CnpOnlineRequest.new.echeck_sale(hash)}
41
41
  assert_match /Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!/, exception.message
42
42
  end
43
43
 
@@ -48,11 +48,11 @@ module LitleOnline
48
48
  'merchantId' => '101',
49
49
  'version'=>'8.8',
50
50
  'reportGroup'=>'Planets',
51
- 'litleTxnId'=>'123456',
51
+ 'cnpTxnId'=>'123456',
52
52
  'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'}
53
53
  }
54
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*(loggedInUser="gdake".*merchantSdk="Ruby;8.14.0")|(merchantSdk="Ruby;8.14.0".*loggedInUser="gdake").*/m), is_a(Hash))
55
- LitleOnlineRequest.new.echeck_sale(hash)
54
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*(loggedInUser="gdake".*merchantSdk="Ruby;8.14.0")|(merchantSdk="Ruby;8.14.0".*loggedInUser="gdake").*/m), is_a(Hash))
55
+ CnpOnlineRequest.new.echeck_sale(hash)
56
56
  end
57
57
 
58
58
  def test_secondary_amount
@@ -63,8 +63,8 @@ module LitleOnline
63
63
  'orderSource' => 'ecommerce',
64
64
  'reportGroup' => 'Planets'
65
65
  }
66
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<amount>2<\/amount><secondaryAmount>1<\/secondaryAmount><orderSource>ecommerce<\/orderSource>.*/m), is_a(Hash))
67
- LitleOnlineRequest.new.echeck_sale(hash)
66
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<amount>2<\/amount><secondaryAmount>1<\/secondaryAmount><orderSource>ecommerce<\/orderSource>.*/m), is_a(Hash))
67
+ CnpOnlineRequest.new.echeck_sale(hash)
68
68
  end
69
69
 
70
70
  def test_echeck_sale_with_secondaryAmount_ccd
@@ -78,10 +78,10 @@ module LitleOnline
78
78
  'orderId'=>'12345',
79
79
  'orderSource'=>'ecommerce',
80
80
  'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455','ccdPaymentInformation'=>'12345678901234567890123456789012345678901234567890123456789012345678901234567890'},
81
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
81
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'cnp.com'}
82
82
  }
83
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<amount>123<\/amount><secondaryAmount>1<\/secondaryAmount>.*?<echeck>.*?<ccdPaymentInformation>.*<\/ccdPaymentInformation><\/echeck>.*/m), is_a(Hash))
84
- LitleOnlineRequest.new.echeck_sale(hash)
83
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<amount>123<\/amount><secondaryAmount>1<\/secondaryAmount>.*?<echeck>.*?<ccdPaymentInformation>.*<\/ccdPaymentInformation><\/echeck>.*/m), is_a(Hash))
84
+ CnpOnlineRequest.new.echeck_sale(hash)
85
85
  end
86
86
 
87
87
  def test_echeck_sale_with_customIdentifier
@@ -95,12 +95,12 @@ module LitleOnline
95
95
  'orderId'=>'12345',
96
96
  'orderSource'=>'ecommerce',
97
97
  'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455','ccdPaymentInformation'=>'12345678901234567890123456789012345678901234567890123456789012345678901234567890'},
98
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'},
98
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'cnp.com'},
99
99
  'merchantData'=>{'campaign'=>'camping'},
100
100
  'customIdentifier' =>'identifier',
101
101
  }
102
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<customIdentifier>identifier<\/customIdentifier>.*/m), is_a(Hash))
103
- LitleOnlineRequest.new.echeck_sale(hash)
102
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<customIdentifier>identifier<\/customIdentifier>.*/m), is_a(Hash))
103
+ CnpOnlineRequest.new.echeck_sale(hash)
104
104
  end
105
105
 
106
106
  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 Test_echeckVerification < Test::Unit::TestCase
30
30
  def test_echeck_verification_with_both
31
31
  hash = {
@@ -33,11 +33,11 @@ module LitleOnline
33
33
  'version'=>'8.8',
34
34
  'reportGroup'=>'Planets',
35
35
  'id'=>'12345',
36
- #'litleTxnId'=>'123456',
37
- 'echeckToken' => {'accType'=>'Checking','litleToken'=>'1234565789012','routingNum'=>'123456789','checkNum'=>'123455'},
36
+ #'cnpTxnId'=>'123456',
37
+ 'echeckToken' => {'accType'=>'Checking','cnpToken'=>'1234565789012','routingNum'=>'123456789','checkNum'=>'123455'},
38
38
  'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'}
39
39
  }
40
- exception = assert_raise(RuntimeError){LitleOnlineRequest.new.echeck_verification(hash)}
40
+ exception = assert_raise(RuntimeError){CnpOnlineRequest.new.echeck_verification(hash)}
41
41
  assert_match /Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!/, exception.message
42
42
  end
43
43
 
@@ -49,11 +49,11 @@ module LitleOnline
49
49
  'version'=>'8.8',
50
50
  'reportGroup'=>'Planets',
51
51
  'id'=>'12345',
52
- #'litleTxnId'=>'123456',
52
+ #'cnpTxnId'=>'123456',
53
53
  'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'}
54
54
  }
55
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*(loggedInUser="gdake".*merchantSdk="Ruby;8.14.0")|(merchantSdk="Ruby;8.14.0".*loggedInUser="gdake").*/m), is_a(Hash))
56
- LitleOnlineRequest.new.echeck_verification(hash)
55
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*(loggedInUser="gdake".*merchantSdk="Ruby;8.14.0")|(merchantSdk="Ruby;8.14.0".*loggedInUser="gdake").*/m), is_a(Hash))
56
+ CnpOnlineRequest.new.echeck_verification(hash)
57
57
  end
58
58
 
59
59
  def test_merchant_data
@@ -63,11 +63,11 @@ module LitleOnline
63
63
  'version'=>'8.8',
64
64
  'reportGroup'=>'Planets',
65
65
  'id'=>'12345',
66
- #'litleTxnId'=>'123456',
66
+ #'cnpTxnId'=>'123456',
67
67
  'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'}
68
68
  }
69
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<\/echeck>.*<merchantData>.*<campaign>camping<\/campaign>.*<\/merchantData>/m), is_a(Hash))
70
- LitleOnlineRequest.new.echeck_verification(hash)
69
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<\/echeck>.*<merchantData>.*<campaign>camping<\/campaign>.*<\/merchantData>/m), is_a(Hash))
70
+ CnpOnlineRequest.new.echeck_verification(hash)
71
71
  end
72
72
 
73
73
  end
@@ -22,20 +22,20 @@ 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 Test_echeckVoid < Test::Unit::TestCase
30
30
  def test_echeck_void
31
31
  hash = {
32
32
  'merchantId' => '101',
33
33
  'version'=>'8.8',
34
34
  'reportGroup'=>'Planets',
35
- 'litleTxnId'=>'123456',
35
+ 'cnpTxnId'=>'123456',
36
36
  }
37
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<echeckVoid.*<litleTxnId>123456<\/litleTxnId>.*/m), is_a(Hash))
38
- LitleOnlineRequest.new.echeck_void(hash)
37
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<echeckVoid.*<cnpTxnId>123456<\/cnpTxnId>.*/m), is_a(Hash))
38
+ CnpOnlineRequest.new.echeck_void(hash)
39
39
  end
40
40
  def test_logged_in_user
41
41
  hash = {
@@ -44,10 +44,10 @@ module LitleOnline
44
44
  'merchantId' => '101',
45
45
  'version'=>'8.8',
46
46
  'reportGroup'=>'Planets',
47
- 'litleTxnId'=>'123456',
47
+ 'cnpTxnId'=>'123456',
48
48
  }
49
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*(loggedInUser="gdake".*merchantSdk="Ruby;8.14.0")|(merchantSdk="Ruby;8.14.0".*loggedInUser="gdake").*/m), is_a(Hash))
50
- LitleOnlineRequest.new.echeck_void(hash)
49
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*(loggedInUser="gdake".*merchantSdk="Ruby;8.14.0")|(merchantSdk="Ruby;8.14.0".*loggedInUser="gdake").*/m), is_a(Hash))
50
+ CnpOnlineRequest.new.echeck_void(hash)
51
51
  end
52
52
 
53
53
  end