4D Payments SDK 2016 .NET Edition

Questions / Feedback?

TSYSSettle Component

Properties   Methods   Events   Configuration Settings   Errors  

The TSYSSettle component is used to do a Batch Settlement on all transactions that were successfully authorized with the TSYSECOMMERCE or TSYSRETAIL components. This component may also send Level II and Level III Corporate Purchasing Card data for better interchange rates.




This component allows for a direct, secure connection to the Vital/TSYS gateway through a standard Internet connection. This component can be integrated into web pages or stand-alone Point Of Sale applications. Because all TLS/SSL communications are handled inside the component, any application or web page can be deployed without the need for expensive dedicated TLS/SSL servers. The TSYSSettle component is used to settle all transactions previously authorized by the TSYSECommerce or TSYSRetail component. When a transaction is authorized, money in the customer's account is blocked and tagged for the merchant. However, funds do not actually change hands at this point. When transactions are settled with the TSYSSettle component the funds are deducted from the customer's account and added to the merchant's. It is essential that the authorized transactions are properly recorded and resent later in a Batch Settlement.

To send a Batch Settlement, first the user must fill out the Merchant properties with the same information contained in the authorizing component's Merchant properties.

  TSYSSettle.Merchant.BankId = "999995"
  TSYSSettle.Merchant.CategoryCode = "5999"
  TSYSSettle.Merchant.Name = "test merchant"
  TSYSSettle.Merchant.Number = "123456789012"
  TSYSSettle.Merchant.City = "Beverly Hills"
  TSYSSettle.Merchant.State = "CA"
  TSYSSettle.Merchant.StoreNumber = "5999"
  TSYSSettle.Merchant.TerminalNumber = "1515"
  TSYSSettle.Merchant.Zip = "90210"

Additionally, the AgentBankNumber, AgentChainNumber, TerminalId, BatchNumber, and IndustryType must be set. Note that the TerminalId is fundamentally different from the TerminalNumber. The TerminalNumber is used to identify a unique terminal (PC, server, whatever) within a merchant location. The TerminalId, also known as the "V Number", is used for point-of-sale tracking.

  TSYSSettle.AgentBankNumber = "000000"
  TSYSSettle.AgentChainNumber = "111111"
  TSYSSettle.TerminalId = "00000001"
  TSYSSettle.BatchNumber = 15
  TSYSSettle.IndustryType = itRetail

At this point, you are ready to add transactions to the batch settlement. Each successfully authorized transaction to be settled must be added to the DetailRecords collection. The DetailRecords collection contains TSYSRecordType types, which consist of a a DetailAggregate and AddendumAggregate field. The DetailAggregate field should be set with the XML aggregate returned from the TSYSRetail, TSYSECommerce, or TSYSDetailRecord component's GetDetailAggregate method. The AddendumAggregate is used when passing additional commercial card addendum data with the settlement, and is not used for regular credit card transactions.

  TSYSSettle.DetailRecords.Add(new TSYSRecordType(TSYSRetail.GetDetailAggregate()));
  TSYSSettle.DetailRecords.Add(new TSYSRecordType());
  TSYSSettle.DetailRecords[0].DetailAggregate = TSYSRetail.GetDetailAggregate();

Finally, call the SendSettlement method.


If the transaction is successful, the Code will contain "GB", which indicates a "Good Batch". You should check that the NetDeposit and RecordCount match the NetDeposit and RecordCount fields.

If the transaction is not successful and you receive an "RB" Code (indicating a "Rejected Batch") the component throws an exception. You may inspect the Data. DataFieldNumber, RecordType, SequenceNumber, and ErrorType properties for more information concerning why the batch was rejected. After either fixing this record to resolve the error, or removing the record from the batch, the entire batch must be resubmitted. When resubmitting a batch that was previously rejected, the BatchNumber must be set to the same value that was originally used. It is critical that the same BatchNumber value is used to avoid duplicate charges.

Thousands of detail records may be settled in the above manner, just by adding transactions to the DetailRecords collection. However it is recommended that Batch Settlements be kept relatively small - around 100 transactions or so - to decrease the number of records that must be resent in the event of an error.

To Void a transaction that has been authorized but has not yet been settled, simply do not include it in the batch settlement. The block on the cardholder's account will clear automatically. Credits and forced transactions may be created using the TSYSDetailRecord component and settled in the same manner.

To add Level II or Level III data to the settled transactions, use the AddendumAggregate field and the TSYSLevel2 or TSYSLevel3 components.

Note that the IndustryType from the TSYSSettle component MUST match the detail record aggregate of EACH transaction that is added to the settlement. You cannot mix industry types in a batch - you must settle a separate batch for each industry type.

Property List

The following is the full list of the properties of the component with short descriptions. Click on the links for further details.

AgentBankNumberIdentifies a specific agent entity of the member bank or processor.
AgentChainNumberIdentifies a specific chain of an agent organization.
BatchContains information about the batch settlement, as computed by the component.
BatchNumberSequence number of this batch transaction.
DetailRecordsCollection of detail records to send in the settlement.
ErrorContains information about settlement errors.
IndustryTypeCode which indicates the industry the merchant is engaged in.
MerchantContains the merchant's setup information.
MerchantLocalPhoneMerchant's local phone number. Used in settlement only.
ResponseContains the response to a batch settlement.
SSLAcceptServerCertInstructs the component to unconditionally accept the server certificate that matches the supplied certificate.
SSLCertThe certificate to be used during SSL negotiation.
SSLServerCertThe server certificate for the last established connection.
TerminalIdContains number to accommodate a POS device tracking number.
TimeoutA timeout for the component.

Method List

The following is the full list of the methods of the component with short descriptions. Click on the links for further details.

ConfigSets or retrieves a configuration setting.
InterruptInterrupts the current action.
ResetResets all the properties of the entire settlement to their default values.
SendSettlementBegins a Batch Settlement transaction with the transaction server.

Event List

The following is the full list of the events fired by the component with short descriptions. Click on the links for further details.

ConnectedFired immediately after a connection completes (or fails).
DataPacketInFired when receiving a data packet from the transaction server.
DataPacketOutFired when sending a data packet to the transaction server.
DisconnectedFired when a connection is closed.
ErrorInformation about errors during data delivery.
SSLServerAuthenticationFired after the server presents its certificate to the client.
SSLStatusShows the progress of the secure connection.

Configuration Settings

The following is a list of configuration settings for the component with short descriptions. Click on the links for further details.

AmexAggregatorNameContains the name of the Payment Service Provider/Aggregator or Facilitator participating in Amex OptBlue program.
CombineRecordsWhether settlement records are being concatenated into a single settlement block.
DeviceCodeA 1-character value used to identify the device and type of the merchant submitting the settlement batch.
GenKeyA randomly generated string of alphanumeric characters identifying the terminal.
HeartlandDeviceIdSpecifies a device ID to uniquely identify each terminal (card data entry device).
HeartlandEncryptionModeSpecifies the encryption mode to use in Heartland transactions.
HeartlandKeyBlockSpecifies the key block used to encrypt the data.
LocationNumberProvides additional information on the location of the merchant.
PortThe port to which transactions are posted.
ProcessorSpecifies the Processor you are connecting to.
ServerThe server to which transactions are posted.
TravelAgencyCodeContains the Travel Agency IATA Code if the ticket was issued by a travel agency.
TravelAgencyNameContains the Travel Agency Name if the ticket was issued by a travel agency.
CloseStreamAfterTransferIf true, the component will close the upload or download stream after the transfer.
ConnectionTimeoutSets a separate timeout value for establishing a connection.
FirewallAutoDetectTells the component whether or not to automatically detect and use firewall system settings, if available.
FirewallHostName or IP address of firewall (optional).
FirewallListenerIf true, the component binds to a SOCKS firewall as a server (IPPort only).
FirewallPasswordPassword to be used if authentication is to be used when connecting through the firewall.
FirewallPortThe TCP port for the FirewallHost;.
FirewallTypeDetermines the type of firewall to connect through.
FirewallUserA user name if authentication is to be used connecting through a firewall.
KeepAliveIntervalThe retry interval, in milliseconds, to be used when a TCP keep-alive packet is sent and no response is received.
KeepAliveTimeThe inactivity time in milliseconds before a TCP keep-alive packet is sent.
LingerWhen set to True, connections are terminated gracefully.
LingerTimeTime in seconds to have the connection linger.
LocalHostThe name of the local host through which connections are initiated or accepted.
LocalPortThe port in the local host where the component binds.
MaxLineLengthThe maximum amount of data to accumulate when no EOL is found.
MaxTransferRateThe transfer rate limit in bytes per second.
ProxyExceptionsListA semicolon separated list of hosts and IPs to bypass when using a proxy.
TCPKeepAliveDetermines whether or not the keep alive socket option is enabled.
TcpNoDelayWhether or not to delay when sending packets.
UseIPv6Whether to use IPv6.
UseNTLMv2Whether to use NTLM V2.
CACertFilePathsThe paths to CA certificate files when using Mono on Unix/Linux.
LogSSLPacketsControls whether SSL packets are logged when using the internal security API.
ReuseSSLSessionDetermines if the SSL session is reused.
SSLCACertsA newline separated list of CA certificate to use during SSL client authentication.
SSLCheckCRLWhether to check the Certificate Revocation List for the server certificate.
SSLCipherStrengthThe minimum cipher strength used for bulk encryption.
SSLEnabledCipherSuitesThe cipher suite to be used in an SSL negotiation.
SSLEnabledProtocolsUsed to enable/disable the supported security protocols.
SSLEnableRenegotiationWhether the renegotiation_info SSL extension is supported.
SSLIncludeCertChainWhether the entire certificate chain is included in the SSLServerAuthentication event.
SSLNegotiatedCipherReturns the negotiated ciphersuite.
SSLNegotiatedCipherStrengthReturns the negotiated ciphersuite strength.
SSLNegotiatedKeyExchangeReturns the negotiated key exchange algorithm.
SSLNegotiatedKeyExchangeStrengthReturns the negotiated key exchange algorithm strength.
SSLNegotiatedProtocolReturns the negotiated protocol version.
SSLProviderThe name of the security provider to use.
SSLSecurityFlagsFlags that control certificate verification.
SSLServerCACertsA newline separated list of CA certificate to use during SSL server certificate validation.
TLS12SignatureAlgorithmsDefines the allowed TLS 1.2 signature algorithms when UseInternalSecurityAPI is True.
TLS12SupportedGroupsThe supported groups for ECC.
TLS13KeyShareGroupsThe groups for which to pregenerate key shares.
TLS13SignatureAlgorithmsThe allowed certificate signature algorithms.
TLS13SupportedGroupsThe supported groups for (EC)DHE key exchange.
AbsoluteTimeoutDetermines whether timeouts are inactivity timeouts or absolute timeouts.
FirewallDataUsed to send extra data to the firewall.
InBufferSizeThe size in bytes of the incoming queue of the socket.
OutBufferSizeThe size in bytes of the outgoing queue of the socket.
BuildInfoInformation about the product's build.
GUIAvailableTells the component whether or not a message loop is available for processing events.
LicenseInfoInformation about the current license.
UseInternalSecurityAPITells the component whether or not to use the system security libraries or an internal implementation.

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