LitleOnline 9.3.3 → 9.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +15 -2
  3. data/DESCRIPTION +2 -2
  4. data/LICENSE +1 -1
  5. data/README.md +9 -9
  6. data/Rakefile +8 -8
  7. data/SETUP.md +3 -3
  8. data/bin/Setup.rb +4 -4
  9. data/bin/sample_batch_driver.rb +1 -1
  10. data/bin/sample_driver.rb +1 -1
  11. data/lib/Communications.rb +7 -7
  12. data/lib/Configuration.rb +1 -1
  13. data/lib/LitleBatchRequest.rb +3 -3
  14. data/lib/LitleListeners.rb +1 -1
  15. data/lib/LitleOnline.rb +2 -2
  16. data/lib/LitleOnlineRequest.rb +4 -4
  17. data/lib/LitleRequest.rb +3 -3
  18. data/lib/LitleTransaction.rb +45 -21
  19. data/lib/LitleXmlMapper.rb +9 -4
  20. data/lib/XMLFields.rb +100 -15
  21. data/temp.xml +21 -0
  22. data/test/certification/certTest_batchAll.rb +15 -10
  23. data/test/certification/ts_all.rb +1 -1
  24. data/test/functional/test_activate.rb +7 -3
  25. data/test/functional/test_activateReversal.rb +7 -3
  26. data/test/functional/test_auth.rb +119 -16
  27. data/test/functional/test_authReversal.rb +5 -3
  28. data/test/functional/test_balanceInquiry.rb +5 -3
  29. data/test/functional/test_batch.rb +1 -1
  30. data/test/functional/test_batchStream.rb +1 -1
  31. data/test/functional/test_cancelSubscription.rb +5 -3
  32. data/test/functional/test_capture.rb +34 -3
  33. data/test/functional/test_captureGivenAuth.rb +55 -4
  34. data/test/functional/test_configuration.rb +1 -1
  35. data/test/functional/test_createPlan.rb +5 -3
  36. data/test/functional/test_credit.rb +17 -1
  37. data/test/functional/test_deactivate.rb +5 -3
  38. data/test/functional/test_deactivateReversal.rb +5 -3
  39. data/test/functional/test_depositReversal.rb +5 -3
  40. data/test/functional/test_echeckCredit.rb +13 -9
  41. data/test/functional/test_echeckRedeposit.rb +5 -3
  42. data/test/functional/test_echeckSale.rb +20 -29
  43. data/test/functional/test_echeckVerification.rb +20 -12
  44. data/test/functional/test_echeckVoid.rb +1 -1
  45. data/test/functional/test_forceCapture.rb +27 -5
  46. data/test/functional/test_fraudCheck.rb +10 -10
  47. data/test/functional/test_litle_requests.rb +1 -1
  48. data/test/functional/test_load.rb +5 -3
  49. data/test/functional/test_loadReversal.rb +5 -3
  50. data/test/functional/test_refundReversal.rb +5 -3
  51. data/test/functional/test_sale.rb +176 -29
  52. data/test/functional/test_token.rb +18 -3
  53. data/test/functional/test_unload.rb +5 -3
  54. data/test/functional/test_unloadReversal.rb +6 -4
  55. data/test/functional/test_updateCardValidationNumOnToken.rb +1 -1
  56. data/test/functional/test_updatePlan.rb +5 -3
  57. data/test/functional/test_updateSubscription.rb +5 -3
  58. data/test/functional/test_utf8.rb +44 -0
  59. data/test/functional/test_xmlfields.rb +10 -6
  60. data/test/functional/ts_all.rb +1 -1
  61. data/test/unit/test_LitleAUBatch.rb +1 -1
  62. data/test/unit/test_LitleBatchRequest.rb +4 -4
  63. data/test/unit/test_LitleOnlineRequest.rb +37 -54
  64. data/test/unit/test_LitleRequest.rb +1 -1
  65. data/test/unit/test_LitleTransaction.rb +5 -5
  66. data/test/unit/test_LitleXmlMapper.rb +136 -0
  67. data/test/unit/test_activate.rb +1 -21
  68. data/test/unit/test_activateReversal.rb +1 -1
  69. data/test/unit/test_auth.rb +51 -11
  70. data/test/unit/test_authReversal.rb +1 -1
  71. data/test/unit/test_balanceInquiry.rb +1 -1
  72. data/test/unit/test_cancelSubscription.rb +1 -1
  73. data/test/unit/test_capture.rb +27 -1
  74. data/test/unit/test_captureGivenAuth.rb +44 -18
  75. data/test/unit/test_createPlan.rb +1 -1
  76. data/test/unit/test_credit.rb +16 -3
  77. data/test/unit/test_deactivate.rb +1 -1
  78. data/test/unit/test_deactivateReversal.rb +1 -1
  79. data/test/unit/test_depositReversal.rb +1 -1
  80. data/test/unit/test_echeckCredit.rb +1 -1
  81. data/test/unit/test_echeckRedeposit.rb +1 -1
  82. data/test/unit/test_echeckSale.rb +2 -2
  83. data/test/unit/test_echeckVerification.rb +1 -1
  84. data/test/unit/test_echeckVoid.rb +1 -1
  85. data/test/unit/test_forceCapture.rb +20 -2
  86. data/test/unit/test_fraudCheck.rb +1 -1
  87. data/test/unit/test_load.rb +1 -1
  88. data/test/unit/test_loadReversal.rb +1 -1
  89. data/test/unit/test_refundReversal.rb +1 -1
  90. data/test/unit/test_sale.rb +72 -6
  91. data/test/unit/test_token.rb +15 -4
  92. data/test/unit/test_unload.rb +1 -1
  93. data/test/unit/test_unloadReversal.rb +1 -1
  94. data/test/unit/test_updateCardValidationNumOnToken.rb +1 -1
  95. data/test/unit/test_updatePlan.rb +1 -1
  96. data/test/unit/test_updateSubscription.rb +1 -1
  97. data/test/unit/test_xmlfields.rb +1 -1
  98. data/test/unit/ts_unit.rb +1 -1
  99. metadata +14 -11
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2011 Litle & Co.
2
+ Copyright (c) 2017 Vantiv eCommerce
3
3
 
4
4
  Permission is hereby granted, free of charge, to any person
5
5
  obtaining a copy of this software and associated documentation
@@ -27,7 +27,7 @@ require 'logger'
27
27
 
28
28
  #
29
29
  # Handles round trip of transactions
30
- # Maps the request to Litle XML -> Sends XML payload to Litle via HTTP(S) -> formats XML response into a Ruby hash and returns it
30
+ # Maps the request to Vantiv eCommerce XML -> Sends XML payload to Vantiv eCommerce via HTTP(S) -> formats XML response into a Ruby hash and returns it
31
31
  #
32
32
  module LitleOnline
33
33
  class LitleXmlMapper
@@ -35,14 +35,19 @@ module LitleOnline
35
35
  logger = initialize_logger(config_hash)
36
36
 
37
37
  logger.debug request_xml
38
- # get the Litle Online Response from the API server over HTTP
38
+ # get the Vantiv eCommerce Online Response from the API server over HTTP
39
39
  response_xml = Communications.http_post(request_xml,config_hash)
40
40
  logger.debug response_xml
41
41
 
42
42
  # create response object from xml returned form the Litle API
43
43
  response_object = XMLObject.new(response_xml)
44
44
 
45
- return response_object
45
+ # Check if the response xml is valid.
46
+ if (response_object.response == "0")
47
+ return response_object
48
+ else
49
+ raise("Error with http response, code: " + response_object.response + ", message: " + response_object.message)
50
+ end
46
51
  end
47
52
 
48
53
  private
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2011 Litle & Co.
2
+ Copyright (c) 2017 Vantiv eCommerce
3
3
 
4
4
  Permission is hereby granted, free of charge, to any person
5
5
  obtaining a copy of this software and associated documentation
@@ -628,6 +628,7 @@ module LitleOnline
628
628
  text_node :number, "number", :default_value=>nil
629
629
  text_node :expDate, "expDate", :default_value=>nil
630
630
  text_node :cardValidationNum, "cardValidationNum", :default_value=>nil
631
+ text_node :pin, "pin", :default_value=>nil
631
632
  def self.from_hash(hash, name='card')
632
633
  base = hash[name]
633
634
  if(base)
@@ -637,11 +638,13 @@ module LitleOnline
637
638
  this.number = base['number']
638
639
  this.expDate = base['expDate']
639
640
  this.cardValidationNum = base['cardValidationNum']
641
+ this.pin = base['pin']
640
642
  SchemaValidation.validate_enum(this.mop, false, ['','MC','VI','AX','DC','DI','PP','JC','BL','EC','GC'], name, 'type')
641
643
  SchemaValidation.validate_length(this.track, false, 1, 256, name, 'track')
642
644
  SchemaValidation.validate_length(this.number, false, 13, 25, name, 'number')
643
645
  SchemaValidation.validate_length(this.expDate, false, 4, 4, name, 'expDate')
644
646
  SchemaValidation.validate_length(this.cardValidationNum, false, 1, 4, name, 'cardValidationNum')
647
+ SchemaValidation.validate_length(this.pin, false, 4, 12, name, 'pin')
645
648
  this
646
649
  else
647
650
  nil
@@ -663,10 +666,10 @@ module LitleOnline
663
666
  this.ephemeralPublicKey = base['ephemeralPublicKey']
664
667
  this.publicKeyHash = base['publicKeyHash']
665
668
  this.transactionId = base['transactionId']
666
- SchemaValidation.validate_required(this.applicationData,true,name,'applicationData')
667
- SchemaValidation.validate_required(this.ephemeralPublicKey,true,name,'ephemeralPublicKey')
668
- SchemaValidation.validate_required(this.publicKeyHash,true,name,'publicKeyHash')
669
- SchemaValidation.validate_required(this.transactionId,true,name,'transactionId')
669
+ SchemaValidation.validate_length(this.applicationData,true,0,10000,name,'applicationData')
670
+ SchemaValidation.validate_length(this.ephemeralPublicKey,true,0,400,name,'ephemeralPublicKey')
671
+ SchemaValidation.validate_length(this.publicKeyHash,true,0,200,name,'publicKeyHash')
672
+ SchemaValidation.validate_length(this.transactionId,true,0,250,name,'transactionId')
670
673
  this
671
674
  else
672
675
  nil
@@ -688,10 +691,10 @@ module LitleOnline
688
691
  this.header = ApplepayHeader.from_hash(base)
689
692
  this.signature = base['signature']
690
693
  this.version = base['version']
691
- SchemaValidation.validate_required(this.data,true,name,'data')
694
+ SchemaValidation.validate_length(this.data,true,0,2000,name,'data')
692
695
  SchemaValidation.validate_required(this.header,true,name,'header')
693
- SchemaValidation.validate_required(this.signature,true,name,'signature')
694
- SchemaValidation.validate_required(this.version,true,name,'version')
696
+ SchemaValidation.validate_length(this.signature,true,0,10000,name,'signature')
697
+ SchemaValidation.validate_length(this.version,true,5,20,name,'version')
695
698
  this
696
699
  else
697
700
  nil
@@ -1342,6 +1345,69 @@ module LitleOnline
1342
1345
  object_node :shipToAddress, "shipToAddress", :class=>Contact, :default_value=>nil
1343
1346
  text_node :amount, "amount", :default_value=>nil
1344
1347
  end
1348
+
1349
+ class Wallet
1350
+ include XML::Mapping
1351
+ text_node :walletSourceType, "walletSourceType", :default_value=>nil
1352
+ text_node :walletSourceTypeId, "walletSourceTypeId", :default_value=>nil
1353
+ def self.from_hash(hash, name='wallet')
1354
+ base = hash[name]
1355
+ if(base)
1356
+ this = Wallet.new
1357
+ this.walletSourceType = base['walletSourceType']
1358
+ this.walletSourceTypeId = base['walletSourceTypeId']
1359
+ SchemaValidation.validate_enum(this.walletSourceType, false, ['MasterPass','VisaCheckout'], name, 'walletSourceType')
1360
+ SchemaValidation.validate_required(this.walletSourceTypeId,true,name,'walletSourceTypeId')
1361
+ this
1362
+ else
1363
+ nil
1364
+ end
1365
+ end
1366
+ end
1367
+
1368
+ class SepaDirectDebitType
1369
+ include XML::Mapping
1370
+ root_element_name "sepaDirectDebit"
1371
+ text_node :mandateProvider, "mandateProvider", :default_value=>nil
1372
+ text_node :sequenceType, "sequenceType", :default_value=>nil
1373
+ text_node :mandateReference, "mandateReference", :default_value=>nil
1374
+ text_node :mandateUrl, "mandateUrl", :default_value=>nil
1375
+ text_node :mandateSignatureDate, "mandateSignatureDate", :default_value=>nil
1376
+ text_node :iban, "iban", :default_value=>nil
1377
+ text_node :preferredLanguage, "preferredLanguage", :default_value=>nil
1378
+ def self.from_hash(hash, name='sepaDirectDebit')
1379
+ base = hash[name]
1380
+ if(base)
1381
+ this = SepaDirectDebitType.new
1382
+ this.mandateProvider = base['mandateProvider']
1383
+ this.sequenceType = base['sequenceType']
1384
+ this.mandateReference = base['mandateReference']
1385
+ this.mandateUrl = base['mandateUrl']
1386
+ this.mandateSignatureDate = base['mandateSignatureDate']
1387
+ this.iban = base['iban']
1388
+ this.preferredLanguage = base['preferredLanguage']
1389
+ this
1390
+ else
1391
+ nil
1392
+ end
1393
+ end
1394
+ end
1395
+
1396
+ class IdealType
1397
+ include XML::Mapping
1398
+ root_element_name "ideal"
1399
+ text_node :preferredLanguage, "preferredLanguage", :default_value=>nil
1400
+ def self.from_hash(hash, name='ideal')
1401
+ base = hash[name]
1402
+ if(base)
1403
+ this = IdealType.new
1404
+ this.preferredLanguage = base['preferredLanguage']
1405
+ this
1406
+ else
1407
+ nil
1408
+ end
1409
+ end
1410
+ end
1345
1411
 
1346
1412
  class Authorization
1347
1413
  include XML::Mapping
@@ -1382,6 +1448,11 @@ module LitleOnline
1382
1448
  object_node :recurringRequest,"recurringRequest", :class=>RecurringRequest, :default_value=>nil
1383
1449
  text_node :debtRepayment,"debtRepayment", :default_value=>nil
1384
1450
  object_node :advancedFraudChecks, "advancedFraudChecks",:class=>AdvancedFraudChecks, :default_value=>nil
1451
+ #9.10
1452
+ object_node :wallet,"wallet", :class=>Wallet, :default_value=>nil
1453
+ text_node :processingType,"processingType", :default_value=>nil
1454
+ text_node :originalNetworkTransactionId,"originalNetworkTransactionId", :default_value=>nil
1455
+ text_node :originalTransactionAmount,"originalTransactionAmount", :default_value=>nil
1385
1456
  end
1386
1457
 
1387
1458
  class Sale
@@ -1405,7 +1476,9 @@ module LitleOnline
1405
1476
  :elsif, 'token', :then, (object_node :token, "token", :class=>CardToken),
1406
1477
  :elsif, 'paypage', :then, (object_node :paypage, "paypage", :class=>CardPaypage),
1407
1478
  :elsif, 'mpos', :then, (object_node :mpos, "mpos", :class=>Mpos),
1408
- :elsif, 'applepay', :then, (object_node :applepay, "applepay", :class=>Applepay)
1479
+ :elsif, 'applepay', :then, (object_node :applepay, "applepay", :class=>Applepay),
1480
+ :elsif, 'sepaDirectDebit', :then, (object_node :sepaDirectDebit, "sepaDirectDebit", :class=>SepaDirectDebitType),
1481
+ :elsif, 'ideal', :then, (object_node :ideal, "ideal", :class=>IdealType)
1409
1482
  object_node :billMeLaterRequest, "billMeLaterRequest", :class=>BillMeLaterRequest, :default_value=>nil
1410
1483
  optional_choice_node :if, 'fraudCheck', :then, (object_node :fraudCheck, "fraudCheck", :class=>FraudCheck, :default_value=>nil),
1411
1484
  :elsif, 'cardholderAuthentication', :then, (object_node :cardholderAuthentication, "cardholderAuthentication", :class=>FraudCheck, :default_value=>nil)
@@ -1427,6 +1500,11 @@ module LitleOnline
1427
1500
  object_node :litleInternalRecurringRequest, "litleInternalRecurringRequest", :class=>LitleInternalRecurringRequest, :default_value=>nil
1428
1501
  text_node :debtRepayment,"debtRepayment", :default_value=>nil
1429
1502
  object_node :advancedFraudChecks, "advancedFraudChecks",:class=>AdvancedFraudChecks, :default_value=>nil
1503
+ #9.10
1504
+ object_node :wallet,"wallet", :class=>Wallet, :default_value=>nil
1505
+ text_node :processingType,"processingType", :default_value=>nil
1506
+ text_node :originalNetworkTransactionId,"originalNetworkTransactionId", :default_value=>nil
1507
+ text_node :originalTransactionAmount,"originalTransactionAmount", :default_value=>nil
1430
1508
  end
1431
1509
 
1432
1510
  class Credit
@@ -1454,6 +1532,9 @@ module LitleOnline
1454
1532
  object_node :enhancedData, "enhancedData", :class=>EnhancedData, :default_value=>nil
1455
1533
  object_node :processingInstructions, "processingInstructions", :class=>ProcessingInstructions, :default_value=>nil
1456
1534
  object_node :pos, "pos", :class=>Pos, :default_value=>nil
1535
+ #9.10
1536
+ text_node :pin, "pin", :default_value=>nil
1537
+ #9.10 end
1457
1538
  object_node :amexAggregatorData, "amexAggregatorData", :class=>AmexAggregatorData, :default_value=>nil
1458
1539
  object_node :merchantData, "merchantData", :class=>MerchantData, :default_value=>nil
1459
1540
  text_node :payPalNotes, "payPalNotes", :default_value=>nil
@@ -1502,6 +1583,10 @@ module LitleOnline
1502
1583
  object_node :amexAggregatorData, "amexAggregatorData", :class=>AmexAggregatorData, :default_value=>nil
1503
1584
  object_node :merchantData, "merchantData", :class=>MerchantData, :default_value=>nil
1504
1585
  text_node :debtRepayment,"debtRepayment", :default_value=>nil
1586
+ #9.10
1587
+ text_node :processingType,"processingType", :default_value=>nil
1588
+ text_node :originalNetworkTransactionId,"originalNetworkTransactionId", :default_value=>nil
1589
+ text_node :originalTransactionAmount,"originalTransactionAmount", :default_value=>nil
1505
1590
  end
1506
1591
 
1507
1592
  class ForceCapture
@@ -1529,6 +1614,8 @@ module LitleOnline
1529
1614
  object_node :amexAggregatorData, "amexAggregatorData", :class=>AmexAggregatorData, :default_value=>nil
1530
1615
  object_node :merchantData, "merchantData", :class=>MerchantData, :default_value=>nil
1531
1616
  text_node :debtRepayment,"debtRepayment", :default_value=>nil
1617
+ #9.10
1618
+ text_node :processingType,"processingType", :default_value=>nil
1532
1619
  end
1533
1620
 
1534
1621
  class AuthReversal
@@ -1561,6 +1648,9 @@ module LitleOnline
1561
1648
  object_node :processingInstructions, "processingInstructions", :class=>ProcessingInstructions, :default_value=>nil
1562
1649
  text_node :payPalOrderComplete, "payPalOrderComplete", :default_value=>nil
1563
1650
  text_node :payPalNotes, "payPalNotes", :default_value=>nil
1651
+ #9.10
1652
+ object_node :customBilling, "customBilling", :class=>CustomBilling, :default_value=>nil
1653
+ text_node :pin, "pin", :default_value=>nil
1564
1654
  end
1565
1655
 
1566
1656
  class Void
@@ -2016,11 +2106,6 @@ module LitleOnline
2016
2106
 
2017
2107
  class LitleRequest
2018
2108
  include XML::Mapping
2019
- # version="6.0" xmlns="http://www.litle.com/schema" numBatchRequests = "1">
2020
- # <authentication>
2021
- # <user>XMLTESTV6ORG14</user>
2022
- # <password>password</password>
2023
- # </authentication>
2024
2109
  root_element_name "litleRequest"
2025
2110
 
2026
2111
  text_node :version, "@version", :default_value=>"0"
@@ -2055,7 +2140,7 @@ module LitleOnline
2055
2140
  object_node :authentication, "authentication", :class=>Authentication
2056
2141
  object_node :rfrRequest, 'RFRRequest', :class=>LitleRFRRequest
2057
2142
  end
2058
-
2143
+
2059
2144
  # begin
2060
2145
  # class LitleOnlineResponse
2061
2146
  # attr_accessor :message
@@ -0,0 +1,21 @@
1
+ <litleOnlineRequest merchantId="101" merchantSdk="Ruby;11.0" version="11.0" xmlns="http://www.litle.com/schema">
2
+ <authentication>
3
+ <user>demo</user>
4
+ <password>demo</password>
5
+ </authentication>
6
+ <depositReversal id="test" reportGroup="Planets">
7
+ <litleTxnId>5000</litleTxnId>
8
+ <card>
9
+ <type>GC</type>
10
+ <number>400000000000001</number>
11
+ <expDate>0150</expDate>
12
+ <cardValidationNum>411</cardValidationNum>
13
+ <pin>1234</pin>
14
+ </card>
15
+ <originalRefCode>101</originalRefCode>
16
+ <originalAmount>34561</originalAmount>
17
+ <originalTxnTime>2017-01-24T09:00:00</originalTxnTime>
18
+ <originalSystemTraceId>33</originalSystemTraceId>
19
+ <originalSequenceNumber>111111</originalSequenceNumber>
20
+ </depositReversal>
21
+ </litleOnlineRequest>
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2012 Litle & Co.
2
+ Copyright (c) 2017 Vantiv eCommerce
3
3
 
4
4
  Permission is hereby granted, free of charge, to any person
5
5
  obtaining a copy of this software and associated documentation
@@ -50,7 +50,8 @@ module LitleOnline
50
50
  'type'=>'VI',
51
51
  'number' =>'4100000000000001',
52
52
  'expDate' =>'1210'
53
- }}
53
+ }, 'processingType' => 'initialInstallment',
54
+ }
54
55
 
55
56
  saleHash = {
56
57
  'reportGroup'=>'Planets',
@@ -62,7 +63,9 @@ module LitleOnline
62
63
  'type'=>'VI',
63
64
  'number' =>'4100000000000001',
64
65
  'expDate' =>'1210'
65
- }}
66
+ },'originalNetworkTransactionId' => '9876543210',
67
+ 'originalTransactionAmount' => '536981'
68
+ }
66
69
 
67
70
  creditHash = {
68
71
  'merchantId' => '101',
@@ -117,7 +120,8 @@ module LitleOnline
117
120
  'type'=>'VI',
118
121
  'number' =>'4100000000000001',
119
122
  'expDate' =>'1210'
120
- }}
123
+ },'processingType' => 'initialInstallment',
124
+ }
121
125
 
122
126
  captHash = {
123
127
  'merchantId' => '101',
@@ -125,6 +129,7 @@ module LitleOnline
125
129
  'reportGroup'=>'Planets',
126
130
  'litleTxnId'=>'123456000',
127
131
  'amount'=>'106',
132
+ 'pin'=>'1234'
128
133
  }
129
134
 
130
135
  captGivenAuthHash = {
@@ -136,7 +141,7 @@ module LitleOnline
136
141
  'authInformation' => {
137
142
  'authDate'=>'2002-10-09','authCode'=>'543216',
138
143
  'authAmount'=>'12345'
139
- },
144
+ },'originalNetworkTransactionId' => '9876543210',
140
145
  'orderSource'=>'ecommerce',
141
146
  'card'=>{
142
147
  'type'=>'VI',
@@ -152,7 +157,7 @@ module LitleOnline
152
157
  'orderId'=>'12345',
153
158
  'orderSource'=>'ecommerce',
154
159
  'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
155
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
160
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'}
156
161
  }
157
162
 
158
163
  echeckCreditHash = {
@@ -179,7 +184,7 @@ module LitleOnline
179
184
  'orderId'=>'12345',
180
185
  'orderSource'=>'ecommerce',
181
186
  'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
182
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
187
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'}
183
188
  }
184
189
 
185
190
  accountUpdateHash = {
@@ -250,7 +255,7 @@ module LitleOnline
250
255
  'orderId'=>'12345',
251
256
  'orderSource'=>'ecommerce',
252
257
  'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
253
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
258
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'}
254
259
  }
255
260
 
256
261
  path = "/tmp/litle-sdk-for-ruby/cert/"
@@ -296,7 +301,7 @@ module LitleOnline
296
301
  'orderId'=>'12345',
297
302
  'orderSource'=>'ecommerce',
298
303
  'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
299
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
304
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'}
300
305
  }
301
306
 
302
307
  path = "/tmp/litle-sdk-for-ruby/cert/"
@@ -466,7 +471,7 @@ module LitleOnline
466
471
 
467
472
  def test_echeck_pre_note_all
468
473
 
469
- billToAddress = {'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
474
+ billToAddress = {'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'}
470
475
  echeckSuccess = {'accType'=>'Corporate','accNum'=>'1092969901','routingNum'=>'011075150'}
471
476
  echeckRoutErr = {'accType'=>'Checking','accNum'=>'6099999992','routingNum'=>'053133052'}
472
477
  echeckAccErr = {'accType'=>'Corporate','accNum'=>'10@2969901','routingNum'=>'011100012'}
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2012 Litle & Co.
2
+ Copyright (c) 2017 Vantiv eCommerce
3
3
 
4
4
  Permission is hereby granted, free of charge, to any person
5
5
  obtaining a copy of this software and associated documentation
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2012 Litle & Co.
2
+ Copyright (c) 2017 Vantiv eCommerce
3
3
 
4
4
  Permission is hereby granted, free of charge, to any person
5
5
  obtaining a copy of this software and associated documentation
@@ -93,8 +93,12 @@ def test_simple_virtualGiftCard_happy
93
93
  'amount' =>'500',
94
94
  }
95
95
 
96
- response= LitleOnlineRequest.new.activate(hash)
97
- assert(response.message =~ /Error validating xml data against the schema/)
96
+ #Get exceptions
97
+ exception = assert_raise(RuntimeError){
98
+ LitleOnlineRequest.new.activate(hash)
99
+ }
100
+ #Test
101
+ assert(exception.message =~ /Error validating xml data against the schema/)
98
102
  end
99
103
  end
100
104
  end
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2012 Litle & Co.
2
+ Copyright (c) 2017 Vantiv eCommerce
3
3
 
4
4
  Permission is hereby granted, free of charge, to any person
5
5
  obtaining a copy of this software and associated documentation
@@ -49,8 +49,12 @@ def test_simple
49
49
  'reportGroup'=>'Planets',
50
50
  }
51
51
 
52
- response= LitleOnlineRequest.new.activate_reversal(hash)
53
- assert(response.message =~ /Error validating xml data against the schema/)
52
+ #Get exceptions
53
+ exception = assert_raise(RuntimeError){
54
+ LitleOnlineRequest.new.activate_reversal(hash)
55
+ }
56
+ #Test
57
+ assert(exception.message =~ /Error validating xml data against the schema/)
54
58
  end
55
59
  end
56
60
  end
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2012 Litle & Co.
2
+ Copyright (c) 2017 Vantiv eCommerce
3
3
 
4
4
  Permission is hereby granted, free of charge, to any person
5
5
  obtaining a copy of this software and associated documentation
@@ -80,7 +80,7 @@ module LitleOnline
80
80
  'transactionId'=>'1234'
81
81
  },
82
82
  'signature' =>'1',
83
- 'version'=>'1'
83
+ 'version'=>'1.0.0'
84
84
  }}
85
85
  response= LitleOnlineRequest.new.authorization(hash)
86
86
  assert_equal('Insufficient Funds', response.authorizationResponse.message)
@@ -100,8 +100,14 @@ module LitleOnline
100
100
  'number' =>'4100000000000001',
101
101
  'expDate' =>'1210'
102
102
  }}
103
- response= LitleOnlineRequest.new.authorization(hash)
104
- assert(response.message =~ /Error validating xml data against the schema/)
103
+
104
+ #Get exceptions
105
+ exception = assert_raise(RuntimeError){
106
+ LitleOnlineRequest.new.authorization(hash)
107
+ }
108
+ #Test
109
+ assert(exception.message =~ /Error validating xml data against the schema/)
110
+
105
111
  end
106
112
 
107
113
  def test_fields_out_of_order
@@ -152,8 +158,12 @@ module LitleOnline
152
158
  'number' =>'4100000000000001',
153
159
  'expDate' =>'1210'
154
160
  }}
155
- response= LitleOnlineRequest.new.authorization(hash)
156
- assert(response.message =~ /Error validating xml data against the schema/)
161
+ #Get exceptions
162
+ exception = assert_raise(RuntimeError){
163
+ LitleOnlineRequest.new.authorization(hash)
164
+ }
165
+ #Test
166
+ assert(exception.message =~ /Error validating xml data against the schema/)
157
167
  end
158
168
 
159
169
  def test_no_amount
@@ -168,8 +178,12 @@ module LitleOnline
168
178
  'number' =>'4100000000000001',
169
179
  'expDate' =>'1210'
170
180
  }}
171
- response= LitleOnlineRequest.new.authorization(hash)
172
- assert(response.message =~ /Error validating xml data against the schema/)
181
+ #Get exceptions
182
+ exception = assert_raise(RuntimeError){
183
+ LitleOnlineRequest.new.authorization(hash)
184
+ }
185
+ #Test
186
+ assert(exception.message =~ /Error validating xml data against the schema/)
173
187
  end
174
188
 
175
189
  def test_no_order_source
@@ -185,8 +199,12 @@ module LitleOnline
185
199
  'number' =>'4100000000000001',
186
200
  'expDate' =>'1210'
187
201
  }}
188
- response= LitleOnlineRequest.new.authorization(hash)
189
- assert(response.message =~ /Error validating xml data against the schema/)
202
+ #Get exceptions
203
+ exception = assert_raise(RuntimeError){
204
+ LitleOnlineRequest.new.authorization(hash)
205
+ }
206
+ #Test
207
+ assert(exception.message =~ /Error validating xml data against the schema/)
190
208
  end
191
209
 
192
210
  def test_authorization_missing_attributes
@@ -201,12 +219,16 @@ module LitleOnline
201
219
  'expDate' =>'1210'
202
220
  }}
203
221
 
204
- response= LitleOnlineRequest.new.authorization(hash)
205
- assert(response.message =~ /Error validating xml data against the schema/)
222
+ #Get exceptions
223
+ exception = assert_raise(RuntimeError){
224
+ LitleOnlineRequest.new.authorization(hash)
225
+ }
226
+ #Test
227
+ assert(exception.message =~ /Error validating xml data against the schema/)
206
228
  end
207
229
 
208
230
  def test_orderId_required
209
- start_hash = {
231
+ hash = {
210
232
  'merchantId'=>'101',
211
233
  'reportGroup'=>'Planets',
212
234
  'amount'=>'101',
@@ -216,10 +238,14 @@ module LitleOnline
216
238
  'number' => '1111222233334444'
217
239
  }
218
240
  }
219
- response= LitleOnlineRequest.new.authorization(start_hash)
220
- assert(response.message =~ /Error validating xml data against the schema/)
241
+ #Get exceptions
242
+ exception = assert_raise(RuntimeError){
243
+ LitleOnlineRequest.new.authorization(hash)
244
+ }
245
+ #Test
246
+ assert(exception.message =~ /Error validating xml data against the schema/)
221
247
 
222
- response = LitleOnlineRequest.new.authorization(start_hash.merge({'orderId'=>'1234'}))
248
+ response = LitleOnlineRequest.new.authorization(hash.merge({'orderId'=>'1234'}))
223
249
  assert_equal('000', response.authorizationResponse.response)
224
250
  end
225
251
 
@@ -294,5 +320,82 @@ module LitleOnline
294
320
  response= LitleOnlineRequest.new.authorization(hash)
295
321
  assert_equal('000', response.authorizationResponse.response)
296
322
  end
323
+
324
+ def test_simple_auth_with_processingType_originalNetworkTransactionId_originalTransactionAmount
325
+ hash = {
326
+ 'merchantId' => '101',
327
+ 'version'=>'8.8',
328
+ 'reportGroup'=>'Planets',
329
+ 'orderId'=>'12355',
330
+ 'amount'=>'106',
331
+ 'orderSource'=>'ecommerce',
332
+ 'card'=>{
333
+ 'type'=>'VI',
334
+ 'number' =>'4100000000000000',
335
+ 'expDate' =>'1210'
336
+ },
337
+ 'processingType' => 'initialInstallment',
338
+ 'originalNetworkTransactionId' => '9876543210',
339
+ 'originalTransactionAmount' => '536981'
340
+ }
341
+ response= LitleOnlineRequest.new.authorization(hash)
342
+ assert_equal('000', response.authorizationResponse.response)
343
+ assert_equal('63225578415568556365452427825', response.authorizationResponse.networkTransactionId)
344
+ end
345
+
346
+ def test_simple_auth_with_wallet
347
+ hash = {
348
+ 'merchantId' => '101',
349
+ 'version'=>'8.8',
350
+ 'reportGroup'=>'Planets',
351
+ 'id'=>'12345',
352
+ 'orderId'=>'67890',
353
+ 'amount'=>'10000',
354
+ 'orderSource'=>'ecommerce',
355
+ 'processingType' => 'initialInstallment',
356
+ 'originalNetworkTransactionId' => '9876543210',
357
+ 'originalTransactionAmount' => '536981',
358
+ 'card'=>{
359
+ 'type'=>'VI',
360
+ 'number' =>'4100000000000000',
361
+ 'expDate' =>'1215'
362
+ },
363
+ 'wallet'=>{
364
+ 'walletSourceType'=>'VisaCheckout',
365
+ 'walletSourceTypeId' => 'VCIND'
366
+ }
367
+ }
368
+ response= LitleOnlineRequest.new.authorization(hash)
369
+ assert_equal('000', response.authorizationResponse.response)
370
+ assert_equal('63225578415568556365452427825', response.authorizationResponse.networkTransactionId)
371
+ end
372
+
373
+ def test_simple_auth_with_wallet_CardSuffixResponse
374
+ hash = {
375
+ 'merchantId' => '101',
376
+ 'version'=>'8.8',
377
+ 'reportGroup'=>'Planets',
378
+ 'id'=>'12345',
379
+ 'orderId'=>'67890',
380
+ 'amount'=>'10000',
381
+ 'orderSource'=>'ecommerce',
382
+ 'processingType' => 'initialInstallment',
383
+ 'originalNetworkTransactionId' => '9876543210',
384
+ 'originalTransactionAmount' => '536981',
385
+ 'card'=>{
386
+ 'type'=>'MC',
387
+ 'number' =>'5400700000000000',
388
+ 'expDate' =>'1215'
389
+ },
390
+ 'wallet'=>{
391
+ 'walletSourceType'=>'MasterPass',
392
+ 'walletSourceTypeId' => 'MasterPass'
393
+ }
394
+ }
395
+ response= LitleOnlineRequest.new.authorization(hash)
396
+ assert_equal('000', response.authorizationResponse.response)
397
+ assert_equal('123456', response.authorizationResponse.cardSuffix)
398
+ end
399
+
297
400
  end
298
401
  end