LitleOnline 9.12.0 → 10.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (129) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +7 -16
  3. data/CONTRIBUTORS +0 -0
  4. data/DESCRIPTION +2 -2
  5. data/LICENSE +1 -1
  6. data/README.md +9 -9
  7. data/Rakefile +9 -8
  8. data/SETUP.md +3 -3
  9. data/bin/Setup.rb +4 -4
  10. data/bin/sample_batch_driver.rb +1 -1
  11. data/bin/sample_driver.rb +1 -1
  12. data/lib/Communications.rb +7 -7
  13. data/lib/Configuration.rb +1 -1
  14. data/lib/EnvironmentVariables.rb +0 -0
  15. data/lib/LitleBatchRequest.rb +22 -8
  16. data/lib/LitleListeners.rb +9 -9
  17. data/lib/LitleOnline.rb +2 -2
  18. data/lib/LitleOnlineRequest.rb +16 -10
  19. data/lib/LitleRequest.rb +10 -10
  20. data/lib/LitleTransaction.rb +66 -64
  21. data/lib/LitleXmlMapper.rb +4 -9
  22. data/lib/XMLFields.rb +129 -116
  23. data/lib/cacert.pem +0 -0
  24. data/samples/Auth/LitleAuthReversalTransaction.rb +2 -2
  25. data/samples/Auth/LitleAuthorizationTransaction.rb +1 -0
  26. data/samples/Auth/LitlePaymentFullLifeCycle.rb +12 -6
  27. data/samples/Batch/AccountUpdate.rb +1 -0
  28. data/samples/Batch/SampleBatchDriver.rb +2 -1
  29. data/samples/Capture/LitleCaptureGivenAuthTransaction.rb +2 -1
  30. data/samples/Capture/LitleCaptureTransaction.rb +2 -2
  31. data/samples/Capture/LitleForceCaptureTransaction.rb +2 -1
  32. data/samples/Capture/LitlePartialCapture.rb +3 -3
  33. data/samples/Credit/LitleCreditTransaction.rb +2 -2
  34. data/samples/Credit/LitleRefundTransaction.rb +2 -1
  35. data/samples/Other/LitleAvsTransaction.rb +2 -1
  36. data/samples/Other/LitleVoidTransaction.rb +2 -1
  37. data/samples/Paypage/FullPaypageLifeCycle.rb +7 -2
  38. data/samples/Run_all.rb +0 -0
  39. data/samples/Sale/LitleSaleTransaction.rb +2 -1
  40. data/samples/Sale/SampleSaleTransaction.rb +2 -1
  41. data/test/certification/certTest1_base.rb +53 -52
  42. data/test/certification/certTest2_authenhanced.rb +16 -15
  43. data/test/certification/certTest3_authreversal.rb +16 -15
  44. data/test/certification/certTest4_echeck.rb +11 -10
  45. data/test/certification/certTest5_token.rb +2 -1
  46. data/test/certification/certTest_batchAll.rb +40 -16
  47. data/test/certification/ts_all.rb +1 -1
  48. data/test/functional/test_activate.rb +8 -9
  49. data/test/functional/test_activateReversal.rb +4 -7
  50. data/test/functional/test_auth.rb +50 -113
  51. data/test/functional/test_authReversal.rb +6 -5
  52. data/test/functional/test_balanceInquiry.rb +5 -5
  53. data/test/functional/test_batch.rb +1 -1
  54. data/test/functional/test_batchStream.rb +3 -5
  55. data/test/functional/test_cancelSubscription.rb +3 -5
  56. data/test/functional/test_capture.rb +6 -34
  57. data/test/functional/test_captureGivenAuth.rb +13 -55
  58. data/test/functional/test_configuration.rb +1 -1
  59. data/test/functional/test_createPlan.rb +3 -5
  60. data/test/functional/test_credit.rb +10 -17
  61. data/test/functional/test_deactivate.rb +5 -5
  62. data/test/functional/test_deactivateReversal.rb +4 -5
  63. data/test/functional/test_depositReversal.rb +5 -5
  64. data/test/functional/test_echeckCredit.rb +17 -13
  65. data/test/functional/test_echeckRedeposit.rb +7 -5
  66. data/test/functional/test_echeckSale.rb +42 -21
  67. data/test/functional/test_echeckVerification.rb +19 -20
  68. data/test/functional/test_echeckVoid.rb +3 -2
  69. data/test/functional/test_forceCapture.rb +16 -30
  70. data/test/functional/test_litle_requests.rb +5 -9
  71. data/test/functional/test_load.rb +5 -5
  72. data/test/functional/test_loadReversal.rb +4 -5
  73. data/test/functional/test_override.rb +3 -0
  74. data/test/functional/test_queryTransaction.rb +146 -0
  75. data/test/functional/test_refundReversal.rb +4 -5
  76. data/test/functional/test_sale.rb +94 -170
  77. data/test/functional/test_token.rb +9 -18
  78. data/test/functional/test_unload.rb +5 -5
  79. data/test/functional/test_unloadReversal.rb +5 -6
  80. data/test/functional/test_updateCardValidationNumOnToken.rb +2 -1
  81. data/test/functional/test_updatePlan.rb +4 -5
  82. data/test/functional/test_updateSubscription.rb +5 -5
  83. data/test/functional/test_wallet.rb +74 -0
  84. data/test/functional/test_xmlfields.rb +25 -10
  85. data/test/functional/ts_all.rb +4 -2
  86. data/test/unit/test_LitleAUBatch.rb +1 -1
  87. data/test/unit/test_LitleBatchRequest.rb +4 -4
  88. data/test/unit/test_LitleOnlineRequest.rb +54 -37
  89. data/test/unit/test_LitleRequest.rb +3 -4
  90. data/test/unit/test_LitleTransaction.rb +35 -6
  91. data/test/unit/test_activate.rb +21 -1
  92. data/test/unit/test_activateReversal.rb +1 -1
  93. data/test/unit/test_auth.rb +16 -55
  94. data/test/unit/test_authReversal.rb +1 -1
  95. data/test/unit/test_balanceInquiry.rb +1 -1
  96. data/test/unit/test_cancelSubscription.rb +1 -1
  97. data/test/unit/test_capture.rb +1 -27
  98. data/test/unit/test_captureGivenAuth.rb +18 -44
  99. data/test/unit/test_createPlan.rb +1 -1
  100. data/test/unit/test_credit.rb +3 -16
  101. data/test/unit/test_deactivate.rb +1 -1
  102. data/test/unit/test_deactivateReversal.rb +1 -1
  103. data/test/unit/test_depositReversal.rb +1 -1
  104. data/test/unit/test_echeckCredit.rb +1 -1
  105. data/test/unit/test_echeckRedeposit.rb +1 -1
  106. data/test/unit/test_echeckSale.rb +2 -2
  107. data/test/unit/test_echeckVerification.rb +1 -1
  108. data/test/unit/test_echeckVoid.rb +1 -1
  109. data/test/unit/test_forceCapture.rb +2 -20
  110. data/test/unit/test_load.rb +1 -1
  111. data/test/unit/test_loadReversal.rb +1 -1
  112. data/test/unit/test_queryTransaction.rb +122 -0
  113. data/test/unit/test_refundReversal.rb +1 -1
  114. data/test/unit/test_sale.rb +8 -73
  115. data/test/unit/test_token.rb +8 -15
  116. data/test/unit/test_unload.rb +1 -1
  117. data/test/unit/test_unloadReversal.rb +1 -1
  118. data/test/unit/test_updateCardValidationNumOnToken.rb +1 -1
  119. data/test/unit/test_updatePlan.rb +1 -1
  120. data/test/unit/test_updateSubscription.rb +1 -1
  121. data/test/unit/test_wallet.rb +262 -0
  122. data/test/unit/test_xmlfields.rb +1 -1
  123. data/test/unit/ts_unit.rb +3 -3
  124. metadata +15 -16
  125. data/temp.xml +0 -21
  126. data/test/functional/test_fraudCheck.rb +0 -77
  127. data/test/functional/test_utf8.rb +0 -44
  128. data/test/unit/test_LitleXmlMapper.rb +0 -136
  129. data/test/unit/test_fraudCheck.rb +0 -45
File without changes
@@ -2,7 +2,7 @@ require_relative '../../lib/LitleOnline'
2
2
 
3
3
  #Auth Reversal
4
4
  #litleTxnId contains the Litle Transaction Id returned on the authorization
5
- reversal_info = {'litleTxnId' => '100000000000000001'}
5
+ reversal_info = {'id'=>'test','litleTxnId' => '100000000000000001'}
6
6
  reversal_response = LitleOnline::LitleOnlineRequest.new.auth_reversal(reversal_info)
7
7
 
8
8
  #display results
@@ -10,6 +10,6 @@ puts "Response: " + reversal_response.authReversalResponse.response
10
10
  puts "Message: " + reversal_response.authReversalResponse.message
11
11
  puts "Litle Transaction ID: " + reversal_response .authReversalResponse.litleTxnId
12
12
 
13
- if (!reversal_response.authReversalResponse.message.eql?'Approved')
13
+ if (!reversal_response.authReversalResponse.message.eql?'Transaction Received')
14
14
  raise ArgumentError, "LitleAuthReversalTransaction has not been Approved", caller
15
15
  end
@@ -3,6 +3,7 @@ require_relative '../../lib/LitleOnline'
3
3
  #Authorization
4
4
  auth_info = {
5
5
  'orderId' => '1',
6
+ 'id'=>'test',
6
7
  'amount' => '10010',
7
8
  'orderSource'=>'ecommerce',
8
9
  'billToAddress'=>{
@@ -4,6 +4,7 @@ require_relative '../../lib/LitleOnline'
4
4
  #Puts a hold on the funds
5
5
  auth_hash = {
6
6
  'orderId' => '1',
7
+ 'id'=>'test',
7
8
  'amount' => '10010',
8
9
  'orderSource'=>'ecommerce',
9
10
  'billToAddress'=>{
@@ -23,25 +24,30 @@ auth_response = LitleOnline::LitleOnlineRequest.new.authorization(auth_hash)
23
24
 
24
25
  #Capture
25
26
  #Captures the authorization and results in money movement
26
- capture_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId}
27
+ capture_hash = {'id'=>auth_response.authorizationResponse.id,
28
+ 'litleTxnId' => auth_response.authorizationResponse.litleTxnId}
27
29
  capture_response = LitleOnline::LitleOnlineRequest.new.capture(capture_hash)
28
30
 
29
- if (!capture_response.captureResponse.message.eql?'Approved')
31
+ if (!capture_response.captureResponse.message.eql?'Transaction Received')
30
32
  raise ArgumentError, "LitlePaymentFullLifeCycle's Capture Transaction has not been Approved", caller
31
33
  end
32
34
  #Credit
33
35
  #Refund the customer
34
- credit_hash = {'litleTxnId' => capture_response.captureResponse.litleTxnId}
36
+ credit_hash = {'id'=>capture_response.captureResponse.id,
37
+ 'litleTxnId' => capture_response.captureResponse.litleTxnId}
38
+
35
39
  credit_response = LitleOnline::LitleOnlineRequest.new.credit(credit_hash)
36
40
 
37
- if (!credit_response.creditResponse.message.eql?'Approved')
41
+ if (!credit_response.creditResponse.message.eql?'Transaction Received')
38
42
  raise ArgumentError, "LitlePaymentFullLifeCycle's credit Transaction has not been Approved", caller
39
43
  end
40
44
  #Void
41
45
  #Cancel the refund, note that a deposit can be Voided as well
42
- void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
46
+ void_hash = {'id'=>credit_response.creditResponse.id,
47
+ 'litleTxnId' => credit_response.creditResponse.litleTxnId}
48
+
43
49
  void_response = LitleOnline::LitleOnlineRequest.new.void(void_hash)
44
50
 
45
- if (!void_response.voidResponse.message.eql?'Approved')
51
+ if (!void_response.voidResponse.message.eql?'Transaction Received')
46
52
  raise ArgumentError, "LitlePaymentFullLifeCycle's Void Transaction has not been Approved", caller
47
53
  end
@@ -24,6 +24,7 @@ saleHash = {
24
24
 
25
25
  authReversalHash = {
26
26
  'merchantId' => '101',
27
+ 'id' => '006',
27
28
  'version'=>'8.8',
28
29
  'reportGroup'=>'Planets',
29
30
  'litleTxnId'=>'12345678000',
@@ -83,7 +83,8 @@ request.process_responses({:transaction_listener => LitleOnline::DefaultLitleLis
83
83
 
84
84
  #grab a child element of a child element of the transation
85
85
  puts "AVS Result: " + transaction["fraudResult"]["avsResult"]
86
- puts "Token Response Message: " + transaction["tokenResponse"]["tokenMessage"]
86
+ puts transaction["message"]
87
+ # puts "Token Response Message: " + transaction["tokenResponse"]["tokenMessage"]
87
88
  if (!transaction["message"].eql?'Approved')
88
89
  raise ArgumentError, "SampleBatchDriver has not been Approved", caller
89
90
  end
@@ -2,6 +2,7 @@ require_relative '../../lib/LitleOnline'
2
2
  #Capture Given Auth
3
3
  capture_given_auth_info = {
4
4
  'merchantId' => '101',
5
+ 'id'=>'test',
5
6
  'version'=>'8.8',
6
7
  'reportGroup'=>'Planets',
7
8
  'orderId'=>'12344',
@@ -25,6 +26,6 @@ puts "Response: " + response.captureGivenAuthResponse.response
25
26
  puts "Message: " + response.captureGivenAuthResponse.message
26
27
  puts "Litle Transaction ID: " + response.captureGivenAuthResponse.litleTxnId
27
28
 
28
- if (!response.captureGivenAuthResponse.message.eql?'Approved')
29
+ if (!response.captureGivenAuthResponse.message.eql?'Transaction Received')
29
30
  raise ArgumentError, "LitleCaptureGivenAuthTransaction has not been Approved", caller
30
31
  end
@@ -1,7 +1,7 @@
1
1
  require_relative '../../lib/LitleOnline'
2
2
  #Capture
3
3
  #litleTxnId contains the Litle Transaction Id returned on the authorization
4
- capture_info = {'litleTxnId' => '100000000000000001'}
4
+ capture_info = {'id'=>'test','litleTxnId' => '100000000000000001'}
5
5
  capture_response = LitleOnline::LitleOnlineRequest.new.capture(capture_info)
6
6
 
7
7
  #display results
@@ -9,6 +9,6 @@ puts "Response: " + capture_response.captureResponse.response
9
9
  puts "Message: " + capture_response.captureResponse.message
10
10
  puts "Litle Transaction ID: " + capture_response .captureResponse.litleTxnId
11
11
 
12
- if (!capture_response.captureResponse.message.eql?'Approved')
12
+ if (!capture_response.captureResponse.message.eql?'Transaction Received')
13
13
  raise ArgumentError, "LitleCaptureTransaction has not been Approved", caller
14
14
  end
@@ -2,6 +2,7 @@ require_relative '../../lib/LitleOnline'
2
2
  #Force Capture
3
3
  force_capture_info = {
4
4
  'merchantId' => '101',
5
+ 'id'=>'test',
5
6
  'version'=>'8.8',
6
7
  'reportGroup'=>'Planets',
7
8
  'litleTxnId'=>'123456',
@@ -21,6 +22,6 @@ puts "Response: " + response.forceCaptureResponse.response
21
22
  puts "Message: " + response.forceCaptureResponse.message
22
23
  puts "Litle Transaction ID: " + response.forceCaptureResponse.litleTxnId
23
24
 
24
- if (!response.forceCaptureResponse.message.eql?'Approved')
25
+ if (!response.forceCaptureResponse.message.eql?'Transaction Received')
25
26
  raise ArgumentError, "LitleForceCaptureTransaction has not been Approved", caller
26
27
  end
@@ -3,7 +3,7 @@ require_relative '../../lib/LitleOnline'
3
3
  #litleTxnId contains the Litle Transaction Id returned as part of the authorization
4
4
  #submit the amount to capture which is less than the authorization amount
5
5
  #to generate a partial capture
6
- capture_info = {'litleTxnId' => '320000000000000001', 'amount' => '5005'}
6
+ capture_info = {'id'=>'test','litleTxnId' => '320000000000000001', 'amount' => '5005'}
7
7
  capture_response = LitleOnline::LitleOnlineRequest.new.capture(capture_info)
8
8
 
9
9
  #display results
@@ -11,6 +11,6 @@ puts "Response: " + capture_response.captureResponse.response
11
11
  puts "Message: " + capture_response.captureResponse.message
12
12
  puts "Litle Transaction ID: " + capture_response.captureResponse.litleTxnId
13
13
 
14
- if (!capture_response.captureResponse.message.eql?'Approved')
15
- raise ArgumentError, "LitlePartialCapture has not been Approved", caller
14
+ if (!capture_response.captureResponse.message.eql?'Transaction Received')
15
+ raise ArgumentError, "LitlePartialCapture has not been Recieved", caller
16
16
  end
@@ -3,7 +3,7 @@ require_relative '../../lib/LitleOnline'
3
3
  #litleTxnId contains the Litle Transaction Id returned on
4
4
  #the capture or sale transaction being credited
5
5
  #the amount is optional, if it isn't submitted the full amount will be credited
6
- credit_info = {'litleTxnId' => '100000000000000002', 'amount' => '1010'}
6
+ credit_info = {'id'=>'test','litleTxnId' => '100000000000000002', 'amount' => '1010'}
7
7
  credit_response = LitleOnline::LitleOnlineRequest.new.credit(credit_info)
8
8
 
9
9
  #display results
@@ -11,6 +11,6 @@ puts "Response: " + credit_response.creditResponse.response
11
11
  puts "Message: " + credit_response.creditResponse.message
12
12
  puts "Litle Transaction ID: " + credit_response.creditResponse.litleTxnId
13
13
 
14
- if (!credit_response.creditResponse.message.eql?'Approved')
14
+ if (!credit_response.creditResponse.message.eql?'Transaction Received')
15
15
  raise ArgumentError, "LitleCreditTransaction has not been Approved", caller
16
16
  end
@@ -2,6 +2,7 @@ require_relative '../../lib/LitleOnline'
2
2
  #Stand alone credit
3
3
  credit_info = {
4
4
  'orderId' => '1',
5
+ 'id'=>'test',
5
6
  'amount' => '1010',
6
7
  'orderSource'=>'ecommerce',
7
8
  'billToAddress'=>{
@@ -24,6 +25,6 @@ puts "Response: " + credit_response.creditResponse.response
24
25
  puts "Message: " + credit_response.creditResponse.response
25
26
  puts "Litle Transaction ID: " + credit_response.creditResponse.litleTxnId
26
27
 
27
- if (!credit_response.creditResponse.message.eql?'Approved')
28
+ if (!credit_response.creditResponse.message.eql?'Transaction Received')
28
29
  raise ArgumentError, "LitleRefundTransaction has not been Approved", caller
29
30
  end
@@ -1,6 +1,7 @@
1
1
  require_relative '../../lib/LitleOnline'
2
2
  @@merchant_hash = {'reportGroup'=>'Planets','id'=>'321','customerId'=>'123',
3
- 'merchantId'=>'101'
3
+ 'merchantId'=>'101',
4
+ 'id'=>'test'
4
5
  }
5
6
  #AVS Only
6
7
  auth_info = {
@@ -4,6 +4,7 @@ require_relative '../../lib/LitleOnline'
4
4
  void_info = {
5
5
  #litleTxnId contains the Litle Transaction Id returned on the deposit/refund
6
6
  'litleTxnId' => '100000000000000001',
7
+ 'id'=>'test'
7
8
  }
8
9
 
9
10
  response = LitleOnline::LitleOnlineRequest.new.void(void_info)
@@ -13,6 +14,6 @@ puts "Response: " + response.voidResponse.response
13
14
  puts "Message: " + response.voidResponse.message
14
15
  puts "Litle Transaction ID: " + response.voidResponse.litleTxnId
15
16
 
16
- if (!response.voidResponse.message.eql?'Approved')
17
+ if (!response.voidResponse.message.eql?'Transaction Received')
17
18
  raise ArgumentError, "LitleVoidTransaction has not been Approved", caller
18
19
  end
@@ -1,6 +1,7 @@
1
1
  require_relative '../../lib/LitleOnline'
2
2
  hash = {
3
3
  'orderId'=>'1234',
4
+ 'id'=>'test',
4
5
  'amount'=>'106',
5
6
  'orderSource'=>'ecommerce',
6
7
  'paypage'=>{
@@ -22,6 +23,7 @@ puts "Litle Token: " + auth_response.authorizationResponse.tokenResponse.litleTo
22
23
  end
23
24
  #Now, we capture the authorization
24
25
  hash = {
26
+ 'id'=>auth_response.authorizationResponse.id,
25
27
  'litleTxnId'=>auth_response.authorizationResponse.litleTxnId #Use the litleTxnId from the auth we want to capture
26
28
  }
27
29
  capture_response = LitleOnline::LitleOnlineRequest.new.capture(hash)
@@ -29,11 +31,12 @@ puts "Response: " + capture_response.captureResponse.response
29
31
  puts "Message: " + capture_response.captureResponse.message
30
32
  puts "Litle Transaction ID: " + capture_response.captureResponse.litleTxnId
31
33
 
32
- if (!capture_response.captureResponse.message.eql?'Approved')
34
+ if (!capture_response.captureResponse.message.eql?'Transaction Received')
33
35
  raise ArgumentError, "FullPaypageLifeCycle's capture has not been Approved", caller
34
36
  end
35
37
  #Now, we issue a refund against the capture
36
38
  hash = {
39
+ 'id'=>capture_response.captureResponse.id,
37
40
  'litleTxnId'=>capture_response.captureResponse.litleTxnId #Use the litleTxnId from the capture we want to refund against
38
41
  }
39
42
  credit_response = LitleOnline::LitleOnlineRequest.new.credit(hash)
@@ -43,6 +46,7 @@ puts "Litle Transaction ID: " + credit_response.creditResponse.litleTxnId
43
46
 
44
47
  #Now, we issue an auth reversal against the refund
45
48
  hash = {
49
+ 'id'=>credit_response.creditResponse.id,
46
50
  'litleTxnId'=>credit_response.creditResponse.litleTxnId #Use the litleTxnId from the capture we want to refund against
47
51
  }
48
52
  reversal_response = LitleOnline::LitleOnlineRequest.new.auth_reversal(hash)
@@ -50,12 +54,13 @@ puts "Response: " + reversal_response.authReversalResponse.response
50
54
  puts "Message: " + reversal_response.authReversalResponse.message
51
55
  puts "Litle Transaction ID: " + reversal_response.authReversalResponse.litleTxnId
52
56
 
53
- if (!reversal_response.authReversalResponse.message.eql?'Approved')
57
+ if (!reversal_response.authReversalResponse.message.eql?'Transaction Received')
54
58
  raise ArgumentError, "FullPaypageLifeCycle's reversal has not been Approved", caller
55
59
  end
56
60
  #Let's assume next month we want to create a sale for the same card as the original authorization. The paypageRegistrationId is expired, but we have the token and can use it
57
61
  hash = {
58
62
  'orderId'=>'4321',
63
+ 'id'=>'test',
59
64
  'amount'=>'106',
60
65
  'orderSource'=>'ecommerce',
61
66
  'token'=>{
File without changes
@@ -2,6 +2,7 @@ require_relative '../../lib/LitleOnline'
2
2
  #Sale
3
3
  my_sale_info = {
4
4
  'orderId' => '1',
5
+ 'id'=>'test',
5
6
  'amount' => '10010',
6
7
  'orderSource'=>'ecommerce',
7
8
  'billToAddress'=>{
@@ -24,6 +25,6 @@ puts "Response: " + sale_response.saleResponse.response
24
25
  puts "Message: " + sale_response.saleResponse.message
25
26
  puts "Litle Transaction ID: " + sale_response.saleResponse.litleTxnId
26
27
 
27
- if (!sale_response.saleResponse.message.eql?'Approved')
28
+ if (!sale_response.saleResponse.message.eql?'Transaction Received')
28
29
  raise ArgumentError, "LitleSaleTransaction has not been Approved", caller
29
30
  end
@@ -2,6 +2,7 @@ require_relative '../../lib/LitleOnline'
2
2
  # Visa $10 Sale
3
3
  litleSaleTxn = {
4
4
  'merchantId' => '087900',
5
+ 'id' => 'test',
5
6
  'reportGroup'=>'rpt_grp',
6
7
  'orderId'=>'1234567',
7
8
  'card'=>{
@@ -19,6 +20,6 @@ response = LitleOnline::LitleOnlineRequest.new.sale(litleSaleTxn)
19
20
  puts "Message: "+ response.message
20
21
  puts "Litle Transaction ID: "+ response.saleResponse.litleTxnId
21
22
 
22
- if (!response.saleResponse.message.eql?'Approved')
23
+ if (!response.saleResponse.message.eql?'Transaction Received')
23
24
  raise ArgumentError, "SampleSaleTransaction has not been Approved", caller
24
25
  end
@@ -5,7 +5,8 @@ require 'test/unit'
5
5
  module LitleOnline
6
6
  class Litle_certTest < Test::Unit::TestCase
7
7
  @@merchant_hash = {'reportGroup'=>'Planets',
8
- 'merchantId'=>'101'
8
+ 'merchantId'=>'101',
9
+ 'id'=>'test'
9
10
  }
10
11
 
11
12
  def test_1_auth
@@ -38,22 +39,22 @@ module LitleOnline
38
39
  capture_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId}
39
40
  hash1a = capture_hash.merge(@@merchant_hash)
40
41
  capture_response = LitleOnlineRequest.new.capture(hash1a)
41
- assert_equal('000', capture_response.captureResponse.response)
42
- assert_equal('Approved', capture_response.captureResponse.message)
42
+ assert_equal('001', capture_response.captureResponse.response)
43
+ assert_equal('Transaction Received', capture_response.captureResponse.message)
43
44
 
44
45
  #test 1B
45
46
  credit_hash = {'litleTxnId' => capture_response.captureResponse.litleTxnId}
46
47
  hash1b = credit_hash.merge(@@merchant_hash)
47
48
  credit_response = LitleOnlineRequest.new.credit(hash1b)
48
- assert_equal('000', credit_response.creditResponse.response)
49
- assert_equal('Approved', credit_response.creditResponse.message)
49
+ assert_equal('001', credit_response.creditResponse.response)
50
+ assert_equal('Transaction Received', credit_response.creditResponse.message)
50
51
 
51
52
  #test1C
52
53
  void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
53
54
  hash1c = void_hash.merge(@@merchant_hash)
54
55
  void_response = LitleOnlineRequest.new.void(hash1c)
55
- assert_equal('000', void_response.voidResponse.response)
56
- assert_equal('Approved', void_response.voidResponse.message)
56
+ assert_equal('001', void_response.voidResponse.response)
57
+ assert_equal('Transaction Received', void_response.voidResponse.message)
57
58
  end
58
59
 
59
60
  def test_1_AVS
@@ -113,15 +114,15 @@ module LitleOnline
113
114
  credit_hash = {'litleTxnId' => sale_response.saleResponse.litleTxnId}
114
115
  hash1b = credit_hash.merge(@@merchant_hash)
115
116
  credit_response = LitleOnlineRequest.new.credit(hash1b)
116
- assert_equal('000', credit_response.creditResponse.response)
117
- assert_equal('Approved', credit_response.creditResponse.message)
117
+ assert_equal('001', credit_response.creditResponse.response)
118
+ assert_equal('Transaction Received', credit_response.creditResponse.message)
118
119
 
119
120
  #test1C
120
121
  void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
121
122
  hash1c = void_hash.merge(@@merchant_hash)
122
123
  void_response = LitleOnlineRequest.new.void(hash1c)
123
- assert_equal('000', void_response.voidResponse.response)
124
- assert_equal('Approved', void_response.voidResponse.message)
124
+ assert_equal('001', void_response.voidResponse.response)
125
+ assert_equal('Transaction Received', void_response.voidResponse.message)
125
126
  end
126
127
 
127
128
  def test_2_auth
@@ -157,22 +158,22 @@ module LitleOnline
157
158
  capture_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId}
158
159
  hash2a = capture_hash.merge(@@merchant_hash)
159
160
  capture_response = LitleOnlineRequest.new.capture(hash2a)
160
- assert_equal('000', capture_response.captureResponse.response)
161
- assert_equal('Approved', capture_response.captureResponse.message)
161
+ assert_equal('001', capture_response.captureResponse.response)
162
+ assert_equal('Transaction Received', capture_response.captureResponse.message)
162
163
 
163
164
  #test 2B
164
165
  credit_hash = {'litleTxnId' => capture_response.captureResponse.litleTxnId}
165
166
  hash2b = credit_hash.merge(@@merchant_hash)
166
167
  credit_response = LitleOnlineRequest.new.credit(hash2b)
167
- assert_equal('000', credit_response.creditResponse.response)
168
- assert_equal('Approved', credit_response.creditResponse.message)
168
+ assert_equal('001', credit_response.creditResponse.response)
169
+ assert_equal('Transaction Received', credit_response.creditResponse.message)
169
170
 
170
171
  #test 2C
171
172
  void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
172
173
  hash2c = void_hash.merge(@@merchant_hash)
173
174
  void_response = LitleOnlineRequest.new.void(hash2c)
174
- assert_equal('000', void_response.voidResponse.response)
175
- assert_equal('Approved', void_response.voidResponse.message)
175
+ assert_equal('001', void_response.voidResponse.response)
176
+ assert_equal('Transaction Received', void_response.voidResponse.message)
176
177
  end
177
178
 
178
179
  def test_2_avs
@@ -238,15 +239,15 @@ module LitleOnline
238
239
  credit_hash = {'litleTxnId' => sale_response.saleResponse.litleTxnId}
239
240
  hash2b = credit_hash.merge(@@merchant_hash)
240
241
  credit_response = LitleOnlineRequest.new.credit(hash2b)
241
- assert_equal('000', credit_response.creditResponse.response)
242
- assert_equal('Approved', credit_response.creditResponse.message)
242
+ assert_equal('001', credit_response.creditResponse.response)
243
+ assert_equal('Transaction Received', credit_response.creditResponse.message)
243
244
 
244
245
  #test 2C
245
246
  void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
246
247
  hash2c = void_hash.merge(@@merchant_hash)
247
248
  void_response = LitleOnlineRequest.new.void(hash2c)
248
- assert_equal('000', void_response.voidResponse.response)
249
- assert_equal('Approved', void_response.voidResponse.message)
249
+ assert_equal('001', void_response.voidResponse.response)
250
+ assert_equal('Transaction Received', void_response.voidResponse.message)
250
251
  end
251
252
 
252
253
  def test_3_auth
@@ -279,22 +280,22 @@ module LitleOnline
279
280
  capture_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId}
280
281
  hash2a = capture_hash.merge(@@merchant_hash)
281
282
  capture_response = LitleOnlineRequest.new.capture(hash2a)
282
- assert_equal('000', capture_response.captureResponse.response)
283
- assert_equal('Approved', capture_response.captureResponse.message)
283
+ assert_equal('001', capture_response.captureResponse.response)
284
+ assert_equal('Transaction Received', capture_response.captureResponse.message)
284
285
 
285
286
  #test 3B
286
287
  credit_hash = {'litleTxnId' => capture_response.captureResponse.litleTxnId}
287
288
  hash2b = credit_hash.merge(@@merchant_hash)
288
289
  credit_response = LitleOnlineRequest.new.credit(hash2b)
289
- assert_equal('000', credit_response.creditResponse.response)
290
- assert_equal('Approved', credit_response.creditResponse.message)
290
+ assert_equal('001', credit_response.creditResponse.response)
291
+ assert_equal('Transaction Received', credit_response.creditResponse.message)
291
292
 
292
293
  #test 3C
293
294
  void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
294
295
  hash2c = void_hash.merge(@@merchant_hash)
295
296
  void_response = LitleOnlineRequest.new.void(hash2c)
296
- assert_equal('000', void_response.voidResponse.response)
297
- assert_equal('Approved', void_response.voidResponse.message)
297
+ assert_equal('001', void_response.voidResponse.response)
298
+ assert_equal('Transaction Received', void_response.voidResponse.message)
298
299
  end
299
300
 
300
301
  def test_3_avs
@@ -354,15 +355,15 @@ module LitleOnline
354
355
  credit_hash = {'litleTxnId' => sale_response.saleResponse.litleTxnId}
355
356
  hash2b = credit_hash.merge(@@merchant_hash)
356
357
  credit_response = LitleOnlineRequest.new.credit(hash2b)
357
- assert_equal('000', credit_response.creditResponse.response)
358
- assert_equal('Approved', credit_response.creditResponse.message)
358
+ assert_equal('001', credit_response.creditResponse.response)
359
+ assert_equal('Transaction Received', credit_response.creditResponse.message)
359
360
 
360
361
  #test 3C
361
362
  void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
362
363
  hash2c = void_hash.merge(@@merchant_hash)
363
364
  void_response = LitleOnlineRequest.new.void(hash2c)
364
- assert_equal('000', void_response.voidResponse.response)
365
- assert_equal('Approved', void_response.voidResponse.message)
365
+ assert_equal('001', void_response.voidResponse.response)
366
+ assert_equal('Transaction Received', void_response.voidResponse.message)
366
367
  end
367
368
 
368
369
  def test_4_auth
@@ -394,21 +395,21 @@ module LitleOnline
394
395
  capture_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId}
395
396
  hash2a = capture_hash.merge(@@merchant_hash)
396
397
  capture_response = LitleOnlineRequest.new.capture(hash2a)
397
- assert_equal('Approved', capture_response.captureResponse.message)
398
+ assert_equal('Transaction Received', capture_response.captureResponse.message)
398
399
 
399
400
  #test 4B
400
401
  credit_hash = {'litleTxnId' => capture_response.captureResponse.litleTxnId}
401
402
  hash2b = credit_hash.merge(@@merchant_hash)
402
403
  credit_response = LitleOnlineRequest.new.credit(hash2b)
403
- assert_equal('000', credit_response.creditResponse.response)
404
- assert_equal('Approved', credit_response.creditResponse.message)
404
+ assert_equal('001', credit_response.creditResponse.response)
405
+ assert_equal('Transaction Received', credit_response.creditResponse.message)
405
406
 
406
407
  #test 4C
407
408
  void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
408
409
  hash2c = void_hash.merge(@@merchant_hash)
409
410
  void_response = LitleOnlineRequest.new.void(hash2c)
410
- assert_equal('000', void_response.voidResponse.response)
411
- assert_equal('Approved', void_response.voidResponse.message)
411
+ assert_equal('001', void_response.voidResponse.response)
412
+ assert_equal('Transaction Received', void_response.voidResponse.message)
412
413
  end
413
414
 
414
415
  def test_4_avs
@@ -466,15 +467,15 @@ module LitleOnline
466
467
  credit_hash = {'litleTxnId' => sale_response.saleResponse.litleTxnId}
467
468
  hash2b = credit_hash.merge(@@merchant_hash)
468
469
  credit_response = LitleOnlineRequest.new.credit(hash2b)
469
- assert_equal('000', credit_response.creditResponse.response)
470
- assert_equal('Approved', credit_response.creditResponse.message)
470
+ assert_equal('001', credit_response.creditResponse.response)
471
+ assert_equal('Transaction Received', credit_response.creditResponse.message)
471
472
 
472
473
  #test 4C
473
474
  void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
474
475
  hash2c = void_hash.merge(@@merchant_hash)
475
476
  void_response = LitleOnlineRequest.new.void(hash2c)
476
- assert_equal('000', void_response.voidResponse.response)
477
- assert_equal('Approved', void_response.voidResponse.message)
477
+ assert_equal('001', void_response.voidResponse.response)
478
+ assert_equal('Transaction Received', void_response.voidResponse.message)
478
479
  end
479
480
 
480
481
  def test_5_auth
@@ -501,22 +502,22 @@ module LitleOnline
501
502
  capture_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId}
502
503
  hash2a = capture_hash.merge(@@merchant_hash)
503
504
  capture_response = LitleOnlineRequest.new.capture(hash2a)
504
- assert_equal('000', capture_response.captureResponse.response)
505
- assert_equal('Approved', capture_response.captureResponse.message)
505
+ assert_equal('001', capture_response.captureResponse.response)
506
+ assert_equal('Transaction Received', capture_response.captureResponse.message)
506
507
 
507
508
  #test 5B
508
509
  credit_hash = {'litleTxnId' => capture_response.captureResponse.litleTxnId}
509
510
  hash2b = credit_hash.merge(@@merchant_hash)
510
511
  credit_response = LitleOnlineRequest.new.credit(hash2b)
511
- assert_equal('000', credit_response.creditResponse.response)
512
- assert_equal('Approved', credit_response.creditResponse.message)
512
+ assert_equal('001', credit_response.creditResponse.response)
513
+ assert_equal('Transaction Received', credit_response.creditResponse.message)
513
514
 
514
515
  #test 5C
515
516
  void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
516
517
  hash2c = void_hash.merge(@@merchant_hash)
517
518
  void_response = LitleOnlineRequest.new.void(hash2c)
518
- assert_equal('000', void_response.voidResponse.response)
519
- assert_equal('Approved', void_response.voidResponse.message)
519
+ assert_equal('001', void_response.voidResponse.response)
520
+ assert_equal('Transaction Received', void_response.voidResponse.message)
520
521
  end
521
522
 
522
523
  def test_5_avs
@@ -564,15 +565,15 @@ module LitleOnline
564
565
  credit_hash = {'litleTxnId' => sale_response.saleResponse.litleTxnId}
565
566
  hash2b = credit_hash.merge(@@merchant_hash)
566
567
  credit_response = LitleOnlineRequest.new.credit(hash2b)
567
- assert_equal('000', credit_response.creditResponse.response)
568
- assert_equal('Approved', credit_response.creditResponse.message)
568
+ assert_equal('001', credit_response.creditResponse.response)
569
+ assert_equal('Transaction Received', credit_response.creditResponse.message)
569
570
 
570
571
  #test 5C
571
572
  void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
572
573
  hash2c = void_hash.merge(@@merchant_hash)
573
574
  void_response = LitleOnlineRequest.new.void(hash2c)
574
- assert_equal('000', void_response.voidResponse.response)
575
- assert_equal('Approved', void_response.voidResponse.message)
575
+ assert_equal('001', void_response.voidResponse.response)
576
+ assert_equal('Transaction Received', void_response.voidResponse.message)
576
577
  end
577
578
 
578
579
  def test_6_auth
@@ -630,8 +631,8 @@ module LitleOnline
630
631
  void_hash = {'litleTxnId' => sale_response.saleResponse.litleTxnId }
631
632
  hash6A = void_hash.merge(@@merchant_hash)
632
633
  void_response = LitleOnlineRequest.new.void(hash6A)
633
- assert_equal('360', void_response.voidResponse.response)
634
- assert_equal('No transaction found with specified litleTxnId', void_response.voidResponse.message)
634
+ assert_equal('001', void_response.voidResponse.response)
635
+ assert_equal('Transaction Received', void_response.voidResponse.message)
635
636
  end
636
637
 
637
638
  def test_7_auth