4D Payments SDK 2016 .NET Edition

Questions / Feedback?

TSYSRecordType Type

Detail record storage type.


This type contains the XML aggregate for a single transaction, as well as an XML aggregate of any additional addenda to be added to the record at settlement. The fields contained by this type are listed below.



Optional Detail Record Addendum data (such as Level2 or Level3 data)

The DetailAggregate field contains an xml aggregate of the transaction retrieved from the TSYSECommerce, TSYSRetail, or TSYSDetailRecord component's GetDetailAggregate method. If you wish to accept corporate purchasing cards you will also need to send Level2, and possibly Level3 addendum data along with the DetailAggregate. The AddendumAggregate field takes an xml aggregate containing either Level2 or Level3 addendum data, which will be added to the DetailAggregate. The addendum aggregate may be created with either the TSYSLevel2 or TSYSLevel3 components, and then returned via those component's GetAddendum method.

For example:

  // First authorize the credit card
  TSYSECommerce1.TransactionAmount = "53";
  // Then, put the result into the settlement component
  TSYSSettle.DetailRecords.Add(new TSYSRecordType());
	TSYSSettle.DetailRecords[0].DetailAggregate = TSYSECommerce.GetDetailAggregate();  

  // Now build the Level3 Extension. 
  // The following properties are required for a Visa Corporate Purchasing Card:
  TSYSLevel3.CardType = ctVisa;
  TSYSLevel3.LocalTax = "EXEMPT";
  TSYSLevel3.NationalTax = "0";
  TSYSLevel3.PurchaseOrder = "purchOrdNum";
  TSYSLevel3.MerchantTaxId = "merchantTaxId";
  TSYSLevel3.CustomerTaxId = "customerTaxId";
  TSYSLevel3.CommodityCode = "fake";
  TSYSLevel3.DiscountAmount = "0";
  TSYSLevel3.FreightAmount = "0";
  TSYSLevel3.DutyAmount = "0";
  TSYSLevel3.DestinationZip = "27709";
  TSYSLevel3.ShipFromZip = "27709";
  TSYSLevel3.DestinationCountry = "840";
  TSYSLevel3.TaxInvoiceNumber = "VATInvoiceRefNo";
  TSYSLevel3.OrderDate = "060526";
  TSYSLevel3.FreightTaxAmount = "0";
  TSYSLevel3.FreightTaxRate = "0";
  // Begin adding line items:  
	TSYSLevel3.LineItems.Add(new TSYSLineItem());
  TSYSLevel3.LineItems[0].CommodityCode = "fake";
  TSYSLevel3.LineItems[0].Description = "hardware";
  TSYSLevel3.LineItems[0].ProductCode = "productCode123";
  TSYSLevel3.LineItems[0].Quantity = 1;
  TSYSLevel3.LineItems[0].Units = "";
  TSYSLevel3.LineItems[0].UnitCost = "33";
  TSYSLevel3.LineItems[0].TaxAmount = "0";
  TSYSLevel3.LineItems[0].TaxRate = "0";
  TSYSLevel3.LineItems[0].DiscountAmount = "0";
  TSYSLevel3.LineItems[0].Total = "33";
	TSYSLevel3.LineItems.Add(new TSYSLineItem());
  TSYSLevel3.LineItems[1].CommodityCode = "fake";
  TSYSLevel3.LineItems[1].Description = "hardware";
  TSYSLevel3.LineItems[1].ProductCode = "productCode124";
  TSYSLevel3.LineItems[1].Quantity = 1;
  TSYSLevel3.LineItems[1].Units = "";
  TSYSLevel3.LineItems[1].UnitCost = "20";
  TSYSLevel3.LineItems[1].TaxAmount = "0";
  TSYSLevel3.LineItems[1].TaxRate = "0";
  TSYSLevel3.LineItems[1].DiscountAmount = "0";
  TSYSLevel3.LineItems[1].Total = "20";
  // Finally, add the Level3 addendum to the same index in the settlement.
	TSYSSettle.DetailRecords[0].AddendumAggregate = TSYSLevel3.GetAddendum();

Note that you may mix corporate and non-corporate card transactions in the same settlement. It is not necessary that all DetailAggregates have a corresponding AddendumAggregate.


Set this field with xml aggregates of the transactions you wish to settle.

To settle previously authorized transactions, this field must be set with the xml aggregate returned from the TSYSRetail, or TSYSECommerce component's GetDetailAggregate method. For instance:

  TSYSSettle.DetailRecords.Add(new TSYSRecordType(TSYSRetail.GetDetailAggregate()));

On occasion, you may need to modify these aggregates before sending them to settlement. For instance, if you're running a restaurant you may need to add a gratuity to the charge. If you're accepting installment payments, you will need to add the installment info. To accomplish this, you may use the TSYSDetailRecord component.

For example, to add a gratuity to a charge:

  DetailRecord.Gratuity = "500"
  DetailRecord.SettlementAmount = DetailRecord.AuthorizedAmount + DetailRecord.Gratuity
  TSYSSettle.DetailAggregate[0] = DetailRecord.GetDetailAggregate()

To settle a transaction authorized with the ttInstallment TransactionType, you must use the TSYSDetailRecord component to add the number of this installment and the total count of all installments to be made. For instance, if the purchase was for "Three easy payments of $19.95", and this is the first payment, then the installment number will be 1, and the installment count 3. An example is included below:

  TSYSECommerce.TransactionType = ttInstallment
  TSYSECommerce.TransactionAmount = "1995"

  DetailRecord.ParseAggregate TSYSECommerce.GetDetailAggregate()
  DetailRecord.InstallmentCount = 3
  DetailRecord.InstallmentNumber = 1
  TSYSSettle.DetailAggregate[5] = DetailRecord.GetDetailAggregate()

To settle a Passenger Transport transaction authorized with the sitPassengerTransport IndustryType, you must use the TSYSDetailRecord component to add the number of this passenger and the total count of all passengers in the authorization code. For instance, if the authorization transaction included "Three passengers", and this is the first passenger, then the passenger number will be 1, and the passenger count 3. An example is included below:

  TSYSRetail.IndustryType = sitPassengerTransport

  DetailRecord.ParseAggregate TSYSRetail.GetDetailAggregate()
  DetailRecord.PassengerCount = 3
  DetailRecord.PassengerNumber = 1
  DetailRecord.Config("PassengerName=John Smith")
  TSYSSettle1.IndustryType = sitPassengerTransport
  TSYSSettle1.Config("TravelAgencyCode=12345678") 'if ticket was issued by a travel agency
  TSYSSettle1.Config("TravelAgencyName=Travel and Tours") 'if ticket was issued by a travel agency
  TSYSSettle1.DetailAggregate[5] = DetailRecord.GetDetailAggregate()


public TSYSRecordType();
Public TSYSRecordType()
public TSYSRecordType(string detailAggregate);
Public TSYSRecordType(ByVal DetailAggregate As String)
public TSYSRecordType(string detailAggregate, string addendumAggregate);
Public TSYSRecordType(ByVal DetailAggregate As String, ByVal AddendumAggregate As String)

Copyright (c) 2021 4D Payments Inc. - All rights reserved.
4D Payments SDK 2016 .NET Edition - Version 16.0 [Build 8017]