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,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
 
31
31
  class TestForceCapture < Test::Unit::TestCase
32
32
  def test_both_choices_card_and_token
@@ -34,7 +34,7 @@ module LitleOnline
34
34
  'merchantId' => '101',
35
35
  'version'=>'8.8',
36
36
  'reportGroup'=>'Planets',
37
- 'litleTxnId'=>'123456',
37
+ 'cnpTxnId'=>'123456',
38
38
  'orderId'=>'12344',
39
39
  'amount'=>'106',
40
40
  'orderSource'=>'ecommerce',
@@ -46,12 +46,12 @@ module LitleOnline
46
46
  'expDate' =>'1210'
47
47
  },
48
48
  'token'=> {
49
- 'litleToken'=>'1234567890123',
49
+ 'cnpToken'=>'1234567890123',
50
50
  'expDate'=>'1210',
51
51
  'cardValidationNum'=>'555',
52
52
  'type'=>'VI'
53
53
  }}
54
- exception = assert_raise(RuntimeError){LitleOnlineRequest.new.force_capture(hash)}
54
+ exception = assert_raise(RuntimeError){CnpOnlineRequest.new.force_capture(hash)}
55
55
  assert_match /Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!/, exception.message
56
56
  end
57
57
 
@@ -60,7 +60,7 @@ module LitleOnline
60
60
  'merchantId' => '101',
61
61
  'version'=>'8.8',
62
62
  'reportGroup'=>'Planets',
63
- 'litleTxnId'=>'123456',
63
+ 'cnpTxnId'=>'123456',
64
64
  'orderId'=>'12344',
65
65
  'amount'=>'106',
66
66
  'orderSource'=>'ecommerce',
@@ -77,12 +77,12 @@ module LitleOnline
77
77
  'cardValidationNum'=>'555',
78
78
  'type'=>'VI'},
79
79
  'token'=> {
80
- 'litleToken'=>'1234567890123',
80
+ 'cnpToken'=>'1234567890123',
81
81
  'expDate'=>'1210',
82
82
  'cardValidationNum'=>'555',
83
83
  'type'=>'VI'
84
84
  }}
85
- exception = assert_raise(RuntimeError){LitleOnlineRequest.new.force_capture(hash)}
85
+ exception = assert_raise(RuntimeError){CnpOnlineRequest.new.force_capture(hash)}
86
86
  assert_match /Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!/, exception.message
87
87
  end
88
88
 
@@ -93,7 +93,7 @@ module LitleOnline
93
93
  'merchantId' => '101',
94
94
  'version'=>'8.8',
95
95
  'reportGroup'=>'Planets',
96
- 'litleTxnId'=>'123456',
96
+ 'cnpTxnId'=>'123456',
97
97
  'orderId'=>'12344',
98
98
  'amount'=>'106',
99
99
  'orderSource'=>'ecommerce',
@@ -104,8 +104,8 @@ module LitleOnline
104
104
  'number' =>'4100000000000001',
105
105
  'expDate' =>'1210'
106
106
  }}
107
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*(loggedInUser="gdake".*merchantSdk="Ruby;8.14.0")|(merchantSdk="Ruby;8.14.0".*loggedInUser="gdake").*/m), is_a(Hash))
108
- LitleOnlineRequest.new.force_capture(hash)
107
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*(loggedInUser="gdake".*merchantSdk="Ruby;8.14.0")|(merchantSdk="Ruby;8.14.0".*loggedInUser="gdake").*/m), is_a(Hash))
108
+ CnpOnlineRequest.new.force_capture(hash)
109
109
  end
110
110
 
111
111
  def test_secondary_amount
@@ -115,8 +115,8 @@ def test_secondary_amount
115
115
  'orderSource' => 'ecommerce',
116
116
  'reportGroup' => 'Planets'
117
117
  }
118
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<amount>2<\/amount><secondaryAmount>1<\/secondaryAmount><orderSource>ecommerce<\/orderSource>.*/m), is_a(Hash))
119
- LitleOnlineRequest.new.force_capture(hash)
118
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<amount>2<\/amount><secondaryAmount>1<\/secondaryAmount><orderSource>ecommerce<\/orderSource>.*/m), is_a(Hash))
119
+ CnpOnlineRequest.new.force_capture(hash)
120
120
  end
121
121
 
122
122
  def test_surcharge_amount
@@ -126,8 +126,8 @@ def test_secondary_amount
126
126
  'orderSource' => 'ecommerce',
127
127
  'reportGroup' => 'Planets'
128
128
  }
129
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<amount>2<\/amount><surchargeAmount>1<\/surchargeAmount><orderSource>ecommerce<\/orderSource>.*/m), is_a(Hash))
130
- LitleOnlineRequest.new.force_capture(hash)
129
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<amount>2<\/amount><surchargeAmount>1<\/surchargeAmount><orderSource>ecommerce<\/orderSource>.*/m), is_a(Hash))
130
+ CnpOnlineRequest.new.force_capture(hash)
131
131
  end
132
132
 
133
133
  def test_surcharge_amount_optional
@@ -136,8 +136,8 @@ def test_secondary_amount
136
136
  'orderSource' => 'ecommerce',
137
137
  'reportGroup' => 'Planets'
138
138
  }
139
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<amount>2<\/amount><orderSource>ecommerce<\/orderSource>.*/m), is_a(Hash))
140
- LitleOnlineRequest.new.force_capture(hash)
139
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<amount>2<\/amount><orderSource>ecommerce<\/orderSource>.*/m), is_a(Hash))
140
+ CnpOnlineRequest.new.force_capture(hash)
141
141
  end
142
142
 
143
143
  def test_processing_type
@@ -154,8 +154,8 @@ def test_secondary_amount
154
154
  'number' =>'4100000000000001',
155
155
  'expDate' =>'1210'
156
156
  }}
157
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<processingType>accountFunding<\/processingType>.*/m), is_a(Hash))
158
- LitleOnlineRequest.new.force_capture(hash)
157
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<processingType>accountFunding<\/processingType>.*/m), is_a(Hash))
158
+ CnpOnlineRequest.new.force_capture(hash)
159
159
  end
160
160
 
161
161
  end
@@ -22,12 +22,12 @@ 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 FraudCheck Transaction
30
- module LitleOnline
30
+ module CnpOnline
31
31
  class TestFraudCheck < Test::Unit::TestCase
32
32
  def test_success_fraud_check
33
33
  hash = {
@@ -38,8 +38,8 @@ module LitleOnline
38
38
  'advancedFraudChecks' => {'threatMetrixSessionId' => 'test2-BXXXXXX003'},
39
39
  }
40
40
 
41
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<threatMetrixSessionId>test2-BXXXXXX003<\/threatMetrixSessionId>.*/m), is_a(Hash))
42
- LitleOnlineRequest.new.fraud_check_request(hash)
41
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<threatMetrixSessionId>test2-BXXXXXX003<\/threatMetrixSessionId>.*/m), is_a(Hash))
42
+ CnpOnlineRequest.new.fraud_check_request(hash)
43
43
  end
44
44
  end
45
45
  end
@@ -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 TestGiftCardAuthReversal < Test::Unit::TestCase
31
31
  def test_simple
32
32
  hash = {
33
33
  'merchantId' => '101',
34
34
  'version'=>'8.8',
35
35
 
36
- 'litleTxnId' => '5000',
36
+ 'cnpTxnId' => '5000',
37
37
  'card'=>{
38
38
  'type'=>'GC',
39
39
  'number' =>'400000000000001',
@@ -50,8 +50,8 @@ module LitleOnline
50
50
 
51
51
  }
52
52
 
53
- 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))
54
- LitleOnlineRequest.new.giftCardAuth_reversal(hash)
53
+ 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))
54
+ CnpOnlineRequest.new.giftCardAuth_reversal(hash)
55
55
  end
56
56
  end
57
57
 
@@ -22,17 +22,17 @@ 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 TestGiftCardCapture < Test::Unit::TestCase
31
31
  def test_simple
32
32
  hash = {
33
33
  'merchantId' => '101',
34
34
  'version'=>'8.8',
35
- 'litleTxnId' => '5000',
35
+ 'cnpTxnId' => '5000',
36
36
  'card'=>{
37
37
  'type'=>'GC',
38
38
  'number' =>'400000000000001',
@@ -49,8 +49,8 @@ module LitleOnline
49
49
 
50
50
  }
51
51
 
52
- 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))
53
- LitleOnlineRequest.new.giftCardCapture(hash)
52
+ 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))
53
+ CnpOnlineRequest.new.giftCardCapture(hash)
54
54
  end
55
55
  end
56
56
 
@@ -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 TestGiftCardCredit < Test::Unit::TestCase
31
31
  def test_simple
32
32
  hash = {
@@ -38,7 +38,7 @@ module LitleOnline
38
38
  'originalTxnTime' => '2017-01-24T09:00:00',
39
39
  'originalSystemTraceId' => '33',
40
40
  'originalSequenceNumber' => '111111',
41
- 'litleTxnId' => '5000',
41
+ 'cnpTxnId' => '5000',
42
42
  'creditAmount' =>'1000',
43
43
  'card'=>{
44
44
  'type'=>'GC',
@@ -49,8 +49,8 @@ module LitleOnline
49
49
  },
50
50
  }
51
51
 
52
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<creditAmount>1000<\/creditAmount><card><type>GC<\/type><number>400000000000001<\/number><expDate>0150<\/expDate><cardValidationNum>411<\/cardValidationNum><pin>1234<\/pin><\/card>.*/m), is_a(Hash))
53
- LitleOnlineRequest.new.giftCardCredit(hash)
52
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<creditAmount>1000<\/creditAmount><card><type>GC<\/type><number>400000000000001<\/number><expDate>0150<\/expDate><cardValidationNum>411<\/cardValidationNum><pin>1234<\/pin><\/card>.*/m), is_a(Hash))
53
+ CnpOnlineRequest.new.giftCardCredit(hash)
54
54
  end
55
55
  end
56
56
 
@@ -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 TestLoad < 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(/.*<load reportGroup="Planets"><orderId>11<\/orderId><amount>500<\/amount><orderSource>ecommerce<\/orderSource><card><type>GC<\/type><number>4100000000000001<\/number><expDate>1210<\/expDate><\/card><\/load>.*/m), is_a(Hash))
48
- LitleOnlineRequest.new.load_request(hash)
47
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*<load reportGroup="Planets"><orderId>11<\/orderId><amount>500<\/amount><orderSource>ecommerce<\/orderSource><card><type>GC<\/type><number>4100000000000001<\/number><expDate>1210<\/expDate><\/card><\/load>.*/m), is_a(Hash))
48
+ CnpOnlineRequest.new.load_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 TestLoadReversal < 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
 
@@ -19,35 +19,35 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19
19
  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20
20
  OTHER DEALINGS IN THE SOFTWARE.
21
21
  =end
22
- require File.expand_path("../../../lib/LitleOnline",__FILE__)
22
+ require File.expand_path("../../../lib/CnpOnline",__FILE__)
23
23
  require 'test/unit'
24
24
  require 'mocha/setup'
25
25
  require 'fileutils'
26
26
 
27
- LITLE_SDK_TEST_FOLDER = '/litle-sdk-for-ruby-test'
27
+ CNP_SDK_TEST_FOLDER = '/cnp-sdk-for-ruby-test'
28
28
 
29
- module LitleOnline
29
+ module CnpOnline
30
30
 
31
- class TestPgpLitleRequest < Test::Unit::TestCase
31
+ class TestPgpCnpRequest < Test::Unit::TestCase
32
32
 
33
33
  def setup
34
- dir = '/tmp' + LITLE_SDK_TEST_FOLDER
34
+ dir = '/tmp' + CNP_SDK_TEST_FOLDER
35
35
  FileUtils.rm_rf dir
36
36
  Dir.mkdir dir
37
37
 
38
38
  end
39
39
 
40
40
  def test_noPublicKey
41
- config_dir = ENV['LITLE_CONFIG_DIR']
42
- ENV['LITLE_CONFIG_DIR'] = '/tmp/pgp_ruby'
41
+ config_dir = ENV['CNP_CONFIG_DIR']
42
+ ENV['CNP_CONFIG_DIR'] = '/tmp/pgp_ruby'
43
43
  dir = '/tmp'
44
44
 
45
45
  test = ''
46
- request = LitleRequest.new()
47
- ENV['LITLE_CONFIG_DIR'] = config_dir
48
- request.create_new_litle_request(dir + LITLE_SDK_TEST_FOLDER)
46
+ request = CnpRequest.new()
47
+ ENV['CNP_CONFIG_DIR'] = config_dir
48
+ request.create_new_cnp_request(dir + CNP_SDK_TEST_FOLDER)
49
49
  request.finish_request
50
- request.send_to_litle(dir + LITLE_SDK_TEST_FOLDER, {'vantivPublicKeyID' => ''})
50
+ request.send_to_cnp(dir + CNP_SDK_TEST_FOLDER, {'vantivPublicKeyID' => ''})
51
51
 
52
52
  rescue RuntimeError => e
53
53
  test = e.message
@@ -57,16 +57,16 @@ module LitleOnline
57
57
  end
58
58
 
59
59
  def test_incorrectPublicKey
60
- config_dir = ENV['LITLE_CONFIG_DIR']
61
- ENV['LITLE_CONFIG_DIR'] = '/tmp/pgp_ruby'
60
+ config_dir = ENV['CNP_CONFIG_DIR']
61
+ ENV['CNP_CONFIG_DIR'] = '/tmp/pgp_ruby'
62
62
  dir = '/tmp'
63
63
 
64
64
  test = ''
65
- request = LitleRequest.new()
66
- ENV['LITLE_CONFIG_DIR'] = config_dir
67
- request.create_new_litle_request(dir + LITLE_SDK_TEST_FOLDER)
65
+ request = CnpRequest.new()
66
+ ENV['CNP_CONFIG_DIR'] = config_dir
67
+ request.create_new_cnp_request(dir + CNP_SDK_TEST_FOLDER)
68
68
  request.finish_request
69
- request.send_to_litle(dir + LITLE_SDK_TEST_FOLDER, {'vantivPublicKeyID' => '7E25EB2X'})
69
+ request.send_to_cnp(dir + CNP_SDK_TEST_FOLDER, {'vantivPublicKeyID' => '7E25EB2X'})
70
70
 
71
71
 
72
72
  rescue ArgumentError => e
@@ -76,16 +76,16 @@ module LitleOnline
76
76
  end
77
77
 
78
78
  def test_noPassphrase
79
- config_dir = ENV['LITLE_CONFIG_DIR']
80
- ENV['LITLE_CONFIG_DIR'] = '/tmp/pgp_ruby'
79
+ config_dir = ENV['CNP_CONFIG_DIR']
80
+ ENV['CNP_CONFIG_DIR'] = '/tmp/pgp_ruby'
81
81
  dir = '/tmp'
82
82
 
83
83
  test = ''
84
- request = LitleRequest.new()
85
- ENV['LITLE_CONFIG_DIR'] = config_dir
86
- request.create_new_litle_request(dir + LITLE_SDK_TEST_FOLDER)
84
+ request = CnpRequest.new()
85
+ ENV['CNP_CONFIG_DIR'] = config_dir
86
+ request.create_new_cnp_request(dir + CNP_SDK_TEST_FOLDER)
87
87
  request.finish_request
88
- request.send_to_litle
88
+ request.send_to_cnp
89
89
  request.get_responses_from_server({'passphrase' => ''})
90
90
 
91
91
  rescue RuntimeError => e
@@ -96,16 +96,16 @@ module LitleOnline
96
96
  end
97
97
 
98
98
  def test_incorrectPassphrase
99
- config_dir = ENV['LITLE_CONFIG_DIR']
100
- ENV['LITLE_CONFIG_DIR'] = '/tmp/pgp_ruby'
99
+ config_dir = ENV['CNP_CONFIG_DIR']
100
+ ENV['CNP_CONFIG_DIR'] = '/tmp/pgp_ruby'
101
101
  dir = '/tmp'
102
102
 
103
103
  test = ''
104
- request = LitleRequest.new()
105
- ENV['LITLE_CONFIG_DIR'] = config_dir
106
- request.create_new_litle_request(dir + LITLE_SDK_TEST_FOLDER)
104
+ request = CnpRequest.new()
105
+ ENV['CNP_CONFIG_DIR'] = config_dir
106
+ request.create_new_cnp_request(dir + CNP_SDK_TEST_FOLDER)
107
107
  request.finish_request
108
- request.send_to_litle
108
+ request.send_to_cnp
109
109
  request.get_responses_from_server({'passphrase' => 'gameover:('})
110
110
 
111
111
  rescue ArgumentError => e
@@ -116,13 +116,13 @@ module LitleOnline
116
116
 
117
117
 
118
118
  def clear_outbound
119
- config_dir = ENV['LITLE_CONFIG_DIR']
120
- ENV['LITLE_CONFIG_DIR'] = '/tmp/pgp_ruby'
119
+ config_dir = ENV['CNP_CONFIG_DIR']
120
+ ENV['CNP_CONFIG_DIR'] = '/tmp/pgp_ruby'
121
121
  options = Configuration.new.config
122
122
  sftp_username = options['sftp_username']
123
123
  sftp_password = options['sftp_password']
124
124
  sftp_url = options['sftp_url']
125
- ENV['LITLE_CONFIG_DIR'] = config_dir
125
+ ENV['CNP_CONFIG_DIR'] = config_dir
126
126
 
127
127
  Net::SFTP.start(sftp_url, sftp_username, :password => sftp_password) do |sftp|
128
128
  handle = sftp.opendir!('/outbound/')
@@ -24,14 +24,14 @@ 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
31
  # TESTING THE QUERY TRANSACTION FEATURE
32
32
 
33
33
 
34
- module LitleOnline
34
+ module CnpOnline
35
35
  =begin
36
36
  Definition: Class Definition for the Testing Class TestQueryTransaction
37
37
  Created on: 01-29-2016
@@ -60,8 +60,8 @@ class TestQueryTransaction < Test::Unit::TestCase
60
60
  #'origAccountNumber' => '4000000000000001'
61
61
  }
62
62
 
63
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*?<litleOnlineRequest.*?<queryTransaction.*?<origId>834262<\/origId><origActionType>A<\/origActionType>.*?<\/queryTransaction>.*?/m), is_a(Hash))
64
- LitleOnlineRequest.new.query_Transaction(hash)
63
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*?<cnpOnlineRequest.*?<queryTransaction.*?<origId>834262<\/origId><origActionType>A<\/origActionType>.*?<\/queryTransaction>.*?/m), is_a(Hash))
64
+ CnpOnlineRequest.new.query_Transaction(hash)
65
65
  end
66
66
 
67
67
  =begin
@@ -82,8 +82,8 @@ class TestQueryTransaction < Test::Unit::TestCase
82
82
  'transactionId'=>'123456'
83
83
  }
84
84
 
85
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*?<litleOnlineRequest.*?<queryTransaction.*?<origId>834262<\/origId><origActionType>A<\/origActionType>.*?<\/queryTransaction>.*?/m), is_a(Hash))
86
- LitleOnlineRequest.new.query_Transaction(hash)
85
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*?<cnpOnlineRequest.*?<queryTransaction.*?<origId>834262<\/origId><origActionType>A<\/origActionType>.*?<\/queryTransaction>.*?/m), is_a(Hash))
86
+ CnpOnlineRequest.new.query_Transaction(hash)
87
87
  end
88
88
 
89
89
  def test_queryTransaction_no_origId1
@@ -98,8 +98,8 @@ class TestQueryTransaction < Test::Unit::TestCase
98
98
  'transactionId'=>'123456'
99
99
  }
100
100
 
101
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*?<litleOnlineRequest.*?<queryTransaction.*?<origActionType>A<\/origActionType>.*?<\/queryTransaction>.*?/m), is_a(Hash))
102
- LitleOnlineRequest.new.query_Transaction(hash)
101
+ CnpXmlMapper.expects(:request).with(regexp_matches(/.*?<cnpOnlineRequest.*?<queryTransaction.*?<origActionType>A<\/origActionType>.*?<\/queryTransaction>.*?/m), is_a(Hash))
102
+ CnpOnlineRequest.new.query_Transaction(hash)
103
103
  end
104
104
  end
105
105
  end