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
@@ -19,15 +19,15 @@ 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 'fileutils'
25
25
 
26
- module LitleOnline
27
- class TestLitleBatchStream < Test::Unit::TestCase
26
+ module CnpOnline
27
+ class TestCnpBatchStream < Test::Unit::TestCase
28
28
 
29
29
  def setup
30
- dir = '/tmp/litle-sdk-for-ruby-test'
30
+ dir = '/tmp/cnp-sdk-for-ruby-test'
31
31
  FileUtils.rm_rf dir
32
32
  Dir.mkdir dir
33
33
  end
@@ -47,10 +47,10 @@ module LitleOnline
47
47
 
48
48
  dir = '/tmp'
49
49
 
50
- request = LitleRequest.new()
51
- request.create_new_litle_request(dir + '/litle-sdk-for-ruby-test')
50
+ request = CnpRequest.new()
51
+ request.create_new_cnp_request(dir + '/cnp-sdk-for-ruby-test')
52
52
 
53
- entries = Dir.entries(dir + '/litle-sdk-for-ruby-test')
53
+ entries = Dir.entries(dir + '/cnp-sdk-for-ruby-test')
54
54
  entries.sort!
55
55
 
56
56
  assert_equal 4,entries.size
@@ -59,8 +59,8 @@ module LitleOnline
59
59
 
60
60
  #create five batches, each with 10 sales
61
61
 
62
- batch = LitleBatchRequest.new
63
- batch.create_new_batch(dir + '/litle-sdk-for-ruby-test')
62
+ batch = CnpBatchRequest.new
63
+ batch.create_new_batch(dir + '/cnp-sdk-for-ruby-test')
64
64
 
65
65
  cancelSubscriptionHash =
66
66
  {
@@ -105,12 +105,12 @@ module LitleOnline
105
105
  batch.close_batch()
106
106
 
107
107
 
108
- #add the batch to the LitleRequest
108
+ #add the batch to the CnpRequest
109
109
  request.commit_batch(batch)
110
110
 
111
- #finish the Litle Request, indicating we plan to add no more batches
111
+ #finish the Cnp Request, indicating we plan to add no more batches
112
112
  request.finish_request
113
- entries = Dir.entries(dir + '/litle-sdk-for-ruby-test')
113
+ entries = Dir.entries(dir + '/cnp-sdk-for-ruby-test')
114
114
  assert_equal 3, entries.length
115
115
  entries.sort!
116
116
  assert_not_nil entries[2] =~ /request_\d+.complete\z/
@@ -118,7 +118,7 @@ module LitleOnline
118
118
  #send the batch files at the given directory over sFTP
119
119
  count = 1
120
120
  begin
121
- request.send_to_litle_stream
121
+ request.send_to_cnp_stream
122
122
  rescue
123
123
  if (count < 3) then
124
124
  count = count + 1
@@ -127,7 +127,7 @@ module LitleOnline
127
127
  raise
128
128
  end
129
129
  end
130
- request.process_responses({:transaction_listener => LitleOnline::DefaultLitleListener.new do |transaction|
130
+ request.process_responses({:transaction_listener => CnpOnline::DefaultCnpListener.new do |transaction|
131
131
  type = transaction["type"]
132
132
 
133
133
  if(type == "cancelSubscriptionResponse") then
@@ -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
 
28
28
  #test Authorization Transaction
29
- module LitleOnline
29
+ module CnpOnline
30
30
  class TestCancelSubscription < Test::Unit::TestCase
31
31
  def test_simple_happy
32
32
  hash = {
@@ -36,7 +36,7 @@ module LitleOnline
36
36
  'subscriptionId' =>'1001'
37
37
  }
38
38
 
39
- response= LitleOnlineRequest.new.cancel_subscription(hash)
39
+ response= CnpOnlineRequest.new.cancel_subscription(hash)
40
40
  assert_equal('Valid Format', response.message)
41
41
  end
42
42
 
@@ -48,7 +48,7 @@ module LitleOnline
48
48
  }
49
49
 
50
50
  #Get exceptions
51
- exception = assert_raise(RuntimeError){LitleOnlineRequest.new.cancel_subscription(hash)}
51
+ exception = assert_raise(RuntimeError){CnpOnlineRequest.new.cancel_subscription(hash)}
52
52
  #Test
53
53
  assert(exception.message =~ /Error validating xml data against the schema/)
54
54
  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
 
28
- module LitleOnline
28
+ module CnpOnline
29
29
  class Test_capture < Test::Unit::TestCase
30
30
  def test_simple_capture
31
31
  hash = {
@@ -33,10 +33,10 @@ module LitleOnline
33
33
  'version'=>'8.8',
34
34
  'id'=>'test',
35
35
  'reportGroup'=>'Planets',
36
- 'litleTxnId'=>'123456000',
36
+ 'cnpTxnId'=>'123456000',
37
37
  'amount'=>'106',
38
38
  }
39
- response= LitleOnlineRequest.new.capture(hash)
39
+ response= CnpOnlineRequest.new.capture(hash)
40
40
  assert_equal('Valid Format', response.message)
41
41
  end
42
42
 
@@ -47,10 +47,10 @@ module LitleOnline
47
47
  'id'=>'test',
48
48
  'reportGroup'=>'Planets',
49
49
  'partial'=>'true',
50
- 'litleTxnId'=>'123456000',
50
+ 'cnpTxnId'=>'123456000',
51
51
  'amount'=>'106',
52
52
  }
53
- response= LitleOnlineRequest.new.capture(hash)
53
+ response= CnpOnlineRequest.new.capture(hash)
54
54
  assert_equal('Valid Format', response.message)
55
55
  end
56
56
 
@@ -60,15 +60,15 @@ module LitleOnline
60
60
  'version'=>'8.8',
61
61
  'id'=>'test',
62
62
  'reportGroup'=>'Planets',
63
- 'litleTxnId'=>'123456000',
63
+ 'cnpTxnId'=>'123456000',
64
64
  'amount'=>'106',
65
65
  'enhancedData'=>{
66
- 'customerReference'=>'Litle',
66
+ 'customerReference'=>'Cnp',
67
67
  'salesTax'=>'50',
68
68
  'deliveryType'=>'TBD'},
69
69
  'payPalOrderComplete'=>'true'
70
70
  }
71
- response= LitleOnlineRequest.new.capture(hash)
71
+ response= CnpOnlineRequest.new.capture(hash)
72
72
  assert_equal('Valid Format', response.message)
73
73
  end
74
74
 
@@ -81,7 +81,7 @@ module LitleOnline
81
81
  'pin'=>'3333'
82
82
  }
83
83
  #Get exceptions
84
- exception = assert_raise(RuntimeError){LitleOnlineRequest.new.capture(hash)}
84
+ exception = assert_raise(RuntimeError){CnpOnlineRequest.new.capture(hash)}
85
85
  #Test
86
86
  assert(exception.message =~ /Error validating xml data against the schema/)
87
87
  end
@@ -93,12 +93,12 @@ module LitleOnline
93
93
  'reportGroup'=>'Planets',
94
94
  'amount'=>'106',
95
95
  'secondaryAmount'=>'20',
96
- 'litleTxnId'=>'1234',
96
+ 'cnpTxnId'=>'1234',
97
97
  'customBilling'=>{
98
98
  'city' =>'boston',
99
99
  'descriptor' => 'card was present',
100
100
  }}
101
- response= LitleOnlineRequest.new.capture(hash)
101
+ response= CnpOnlineRequest.new.capture(hash)
102
102
  assert_equal('Valid Format', response.message)
103
103
  end
104
104
 
@@ -109,10 +109,10 @@ module LitleOnline
109
109
  'reportGroup'=>'Planets',
110
110
  'amount'=>'106',
111
111
  'secondaryAmount'=>'20',
112
- 'litleTxnId'=>'123456000',
112
+ 'cnpTxnId'=>'123456000',
113
113
  'pin'=>'1234'
114
114
  }
115
- response= LitleOnlineRequest.new.capture(hash)
115
+ response= CnpOnlineRequest.new.capture(hash)
116
116
  assert_equal('Valid Format', response.message)
117
117
  end
118
118
 
@@ -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
 
28
- module LitleOnline
28
+ module CnpOnline
29
29
  class TestcaptureGivenAuth < Test::Unit::TestCase
30
30
  def test_simple_capture_given_auth_with_card
31
31
  hash = {
@@ -45,7 +45,7 @@ module LitleOnline
45
45
  'number' =>'4100000000000000',
46
46
  'expDate' =>'1210'
47
47
  }}
48
- response= LitleOnlineRequest.new.capture_given_auth(hash)
48
+ response= CnpOnlineRequest.new.capture_given_auth(hash)
49
49
  assert_equal('Valid Format', response.message)
50
50
  end
51
51
 
@@ -63,12 +63,12 @@ module LitleOnline
63
63
  'amount'=>'106',
64
64
  'orderSource'=>'ecommerce',
65
65
  'token'=> {
66
- 'litleToken'=>'123456789101112',
66
+ 'cnpToken'=>'123456789101112',
67
67
  'expDate'=>'1210',
68
68
  'cardValidationNum'=>'555',
69
69
  'type'=>'VI'
70
70
  }}
71
- response= LitleOnlineRequest.new.capture_given_auth(hash)
71
+ response= CnpOnlineRequest.new.capture_given_auth(hash)
72
72
  assert_equal('Valid Format', response.message)
73
73
  end
74
74
 
@@ -91,7 +91,7 @@ module LitleOnline
91
91
  'reportGroup'=>'Planets',
92
92
  'orderId'=>'12344'
93
93
  }
94
- response= LitleOnlineRequest.new.capture_given_auth(hash)
94
+ response= CnpOnlineRequest.new.capture_given_auth(hash)
95
95
  assert_equal('Valid Format', response.message)
96
96
  end
97
97
 
@@ -114,7 +114,7 @@ module LitleOnline
114
114
  'number' =>'4100000000000000',
115
115
  'expDate' =>'1210'
116
116
  }}
117
- response= LitleOnlineRequest.new.capture_given_auth(hash)
117
+ response= CnpOnlineRequest.new.capture_given_auth(hash)
118
118
  assert_equal('Valid Format', response.message)
119
119
  end
120
120
 
@@ -130,7 +130,7 @@ module LitleOnline
130
130
  'authDate'=>'2002-10-09','authCode'=>'543216',
131
131
  'authAmount'=>'12345'
132
132
  },
133
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'},
133
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'cnp.com'},
134
134
  'processingInstructions'=>{'bypassVelocityCheck'=>'true'},
135
135
  'orderSource'=>'ecommerce',
136
136
  'card'=>{
@@ -138,7 +138,7 @@ module LitleOnline
138
138
  'number' =>'4100000000000000',
139
139
  'expDate' =>'1210'
140
140
  }}
141
- response= LitleOnlineRequest.new.capture_given_auth(hash)
141
+ response= CnpOnlineRequest.new.capture_given_auth(hash)
142
142
  assert_equal('Valid Format', response.message)
143
143
  end
144
144
 
@@ -166,7 +166,7 @@ module LitleOnline
166
166
  'number' =>'4100000000000000',
167
167
  'expDate' =>'1210'
168
168
  }}
169
- response= LitleOnlineRequest.new.capture_given_auth(hash)
169
+ response= CnpOnlineRequest.new.capture_given_auth(hash)
170
170
  assert_equal('Valid Format', response.message)
171
171
  end
172
172
 
@@ -188,7 +188,7 @@ module LitleOnline
188
188
  'expDate' =>'1210'
189
189
  }}
190
190
  #Get exceptions
191
- exception = assert_raise(RuntimeError){LitleOnlineRequest.new.capture_given_auth(hash)}
191
+ exception = assert_raise(RuntimeError){CnpOnlineRequest.new.capture_given_auth(hash)}
192
192
  #Test
193
193
  assert(exception.message =~ /Error validating xml data against the schema/)
194
194
  end
@@ -215,7 +215,7 @@ module LitleOnline
215
215
  'track2Status'=>'0'
216
216
  }
217
217
  }
218
- response= LitleOnlineRequest.new.capture_given_auth(hash)
218
+ response= CnpOnlineRequest.new.capture_given_auth(hash)
219
219
  assert_equal('Valid Format', response.message)
220
220
  end
221
221
 
@@ -234,12 +234,12 @@ module LitleOnline
234
234
  'secondaryAmount'=>'50',
235
235
  'orderSource'=>'ecommerce',
236
236
  'token'=> {
237
- 'litleToken'=>'123456789101112',
237
+ 'cnpToken'=>'123456789101112',
238
238
  'expDate'=>'1210',
239
239
  'cardValidationNum'=>'555',
240
240
  'type'=>'VI'
241
241
  }}
242
- response= LitleOnlineRequest.new.capture_given_auth(hash)
242
+ response= CnpOnlineRequest.new.capture_given_auth(hash)
243
243
  assert_equal('Valid Format', response.message)
244
244
  end
245
245
 
@@ -262,7 +262,7 @@ module LitleOnline
262
262
  'number' =>'4100000000000001',
263
263
  'expDate' =>'1210'
264
264
  }}
265
- response= LitleOnlineRequest.new.capture_given_auth(hash)
265
+ response= CnpOnlineRequest.new.capture_given_auth(hash)
266
266
  assert_equal('Valid Format', response.message)
267
267
  end
268
268
 
@@ -287,7 +287,7 @@ module LitleOnline
287
287
  'originalNetworkTransactionId'=>'987654321098765432109876543210',
288
288
  'originalTransactionAmount'=>'10661'
289
289
  }
290
- response= LitleOnlineRequest.new.capture_given_auth(hash)
290
+ response= CnpOnlineRequest.new.capture_given_auth(hash)
291
291
  assert_equal('Valid Format', response.message)
292
292
  end
293
293
 
@@ -20,11 +20,11 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20
20
  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21
21
  OTHER DEALINGS IN THE SOFTWARE.
22
22
  =end
23
- require File.expand_path("../../../lib/LitleOnline",__FILE__)
23
+ require File.expand_path("../../../lib/CnpOnline",__FILE__)
24
24
  require 'test/unit'
25
25
 
26
26
 
27
- module LitleOnline
27
+ module CnpOnline
28
28
  class TestConfiguration < Test::Unit::TestCase
29
29
  #the flag is to judge the data in config file exist or not
30
30
  @@flag=false
@@ -42,47 +42,47 @@ module LitleOnline
42
42
 
43
43
  def test_configuration_mix_file_env
44
44
  #check the env variable override
45
- ENV['litle_timeout']='80'
45
+ ENV['cnp_timeout']='80'
46
46
  @config_hash = Configuration.new.config
47
47
  assert_equal('80',@config_hash['timeout'])
48
- ENV['litle_timeout']=nil
48
+ ENV['cnp_timeout']=nil
49
49
  end
50
50
 
51
51
 
52
52
 
53
53
  def test_configuration_without_file
54
54
  #set up Env variable
55
- ENV['litle_user']='isola'
56
- ENV['litle_password']='vinicius'
57
- ENV['litle_currency_merchant_map']='0180'
58
- ENV['litle_url']='basketball@gmail.com'
59
- ENV['litle_proxy_addr']='iwp1.lowell.litle.com'
60
- ENV['litle_proxy_port']='8080'
61
- ENV['litle_sftp_username']='sdkFire'
62
- ENV['litle_sftp_password']='fire is comming'
63
- ENV['litle_fast_url']='prelive.litle.com'
64
- ENV['litle_fast_port']='15000'
55
+ ENV['cnp_user']='isola'
56
+ ENV['cnp_password']='vinicius'
57
+ ENV['cnp_currency_merchant_map']='0180'
58
+ ENV['cnp_url']='basketball@gmail.com'
59
+ ENV['cnp_proxy_addr']='iwp1.lowell.cnp.com'
60
+ ENV['cnp_proxy_port']='8080'
61
+ ENV['cnp_sftp_username']='sdkFire'
62
+ ENV['cnp_sftp_password']='fire is comming'
63
+ ENV['cnp_fast_url']='prelive.cnp.com'
64
+ ENV['cnp_fast_port']='15000'
65
65
  @config_hash = Configuration.new.config
66
66
  assert_equal('isola',@config_hash['user'])
67
67
  assert_equal('vinicius',@config_hash['password'])
68
68
  assert_equal('0180',@config_hash['currency_merchant_map'])
69
69
  assert_equal('basketball@gmail.com',@config_hash['url'])
70
- assert_equal('iwp1.lowell.litle.com',@config_hash['proxy_addr'])
70
+ assert_equal('iwp1.lowell.cnp.com',@config_hash['proxy_addr'])
71
71
  assert_equal('8080',@config_hash['proxy_port'])
72
72
  assert_equal('sdkFire',@config_hash['sftp_username'])
73
73
  assert_equal('fire is comming',@config_hash['sftp_password'])
74
- assert_equal('prelive.litle.com',@config_hash['fast_url'])
74
+ assert_equal('prelive.cnp.com',@config_hash['fast_url'])
75
75
  assert_equal('15000',@config_hash['fast_port'])
76
- ENV['litle_user']=nil
77
- ENV['litle_password']=nil
78
- ENV['litle_currency_merchant_map']=nil
79
- ENV['litle_url']=nil
80
- ENV['litle_proxy_addr']=nil
81
- ENV['litle_proxy_port']=nil
82
- ENV['litle_sftp_username']=nil
83
- ENV['litle_sftp_password']=nil
84
- ENV['litle_fast_url']=nil
85
- ENV['litle_fast_port']=nil
76
+ ENV['cnp_user']=nil
77
+ ENV['cnp_password']=nil
78
+ ENV['cnp_currency_merchant_map']=nil
79
+ ENV['cnp_url']=nil
80
+ ENV['cnp_proxy_addr']=nil
81
+ ENV['cnp_proxy_port']=nil
82
+ ENV['cnp_sftp_username']=nil
83
+ ENV['cnp_sftp_password']=nil
84
+ ENV['cnp_fast_url']=nil
85
+ ENV['cnp_fast_port']=nil
86
86
  end
87
87
 
88
88
  end
@@ -22,11 +22,11 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22
22
  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23
23
  OTHER DEALINGS IN THE SOFTWARE.
24
24
  =end
25
- require File.expand_path("../../../lib/LitleOnline",__FILE__)
25
+ require File.expand_path("../../../lib/CnpOnline",__FILE__)
26
26
  require 'test/unit'
27
27
 
28
28
  #test Activate Transaction
29
- module LitleOnline
29
+ module CnpOnline
30
30
  class TestCreatePlan < Test::Unit::TestCase
31
31
 
32
32
  def test_simple_happy
@@ -45,7 +45,7 @@ def test_simple_happy
45
45
  'active'=>'true'
46
46
  }
47
47
 
48
- response= LitleOnlineRequest.new.create_plan(hash)
48
+ response= CnpOnlineRequest.new.create_plan(hash)
49
49
  assert_equal('Valid Format', response.message)
50
50
  end
51
51
 
@@ -65,7 +65,7 @@ def test_simple_happy
65
65
  'active'=>'true'
66
66
  }
67
67
 
68
- response= LitleOnlineRequest.new.create_plan(hash)
68
+ response= CnpOnlineRequest.new.create_plan(hash)
69
69
  assert_equal('Valid Format', response.message)
70
70
  end
71
71
 
@@ -79,7 +79,7 @@ def test_simple_happy
79
79
  }
80
80
 
81
81
  #Get exceptions
82
- exception = assert_raise(RuntimeError){LitleOnlineRequest.new.create_plan(hash)}
82
+ exception = assert_raise(RuntimeError){CnpOnlineRequest.new.create_plan(hash)}
83
83
  #Test
84
84
  assert(exception.message =~ /Error validating xml data against the schema/)
85
85
  end