FDMSGiftCard Component
Properties Methods Events Configuration Settings Errors
The FDMSGiftCard component is used to manipulate funds on Stored Value (Gift) Cards with the FDMS Closed Loop Gift Card System. This component supports both card-present and card-not-present gift card transactions, and allows for simple, direct, secure communication to the Datawire gateway to FDMS 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.
Syntax
TibcFDMSGiftCard
Remarks
A Stored Value Card (or Gift Card as they are commonly called) is a not actually a type of credit or debit card. Simply put, a Stored Value Card is a card with a magnetic strip on the back that holds information about monies that have been "pre-paid" into an account for the purpose of making financial transactions. Examples include a retailer's gift card, a prepaid telephone card, a college campus meal plan card, a reloadable subway pass, etcetera. Not included are government income-support cards, otherwise known as EBT cards or electronic food stamps.
The FDMSGiftCard component makes gift card transactions very easy by adding an additional layer of abstraction between the programmer and the protocol. There is no need to deal with raw sockets, TLS/SSL handshakes, or data packet formatting. The steps to setting up the component and authorizing a transaction are outlined below:
First, you must register and activate your account with Datawire. Datawire will provide you with a MerchantNumber and MerchantTerminalNumber, but you'll need to use the FDMSRegister component to activate the merchant and receive a DatawireId. Once you acquire the DatawireId and receive your transaction URLs through Service Discovery, you may begin to authorize transactions.
To authorize a credit card, set the MerchantNumber and MerchantTerminalNumber with the values supplied by FDMS and Datawire, and the DatawireId with the value retrieved by the FDMSRegister component after activating your merchant account. Set the URL property with one of the URLs you retrieved during Service Discovery.
FDMSGiftCard.MerchantNumber = "57111111111"; // Supplied by FDMS/Datawire FDMSGiftCard.MerchantTerminalNumber = "00000000001"; // Supplied by FDMS/Datawire FDMSGiftCard.DatawireId = "00010388888888888878"; // Retrieved with the FDMSRegister component.
After the merchant information is setup, you may enter transaction data. When the card is Manually Entered, the merchant should fill the CardNumber and CardEntryDataSource properties. Otherwise, you should fill the CardMagneticStripe property with the Track 2 data read from the back of the card.
FDMSGiftCard.Card.MagneticStripe = "6010567008288444=00010004000070771026"; FDMSGiftCard.Card.EntryDataSource = edsTrack2;
Then set additional information about the transaction, including any merchant-designated tracking information, such as the Id of the employee making the transaction, the terminal where the transaction is taking place, any alternate identification for the merchant location, and transaction and reference numbers.
FDMSGiftCard.TransactionNumber = "0000001V000003"; FDMSGiftCard.ClerkId = "123"; FDMSGiftCard.ReferenceNumber = "555523"; FDMSGiftCard.AlternateMerchantId = "132123"; FDMSGiftCard.TerminalId = "1234";Now you must choose what transaction you wish to make. Adding Value to a card, Redeeming a card, voiding a previous transaction, or retrieving the card's current balance.
To add funds to an existing Gift Card, simply set the TransactionAmount with the amount to add to the card, and then call LoadCard. Activating a new gift card is handled similarly, by calling ActivateCard instead.
To redeem funds from a Gift Card due to a customer purchase, set TransactionAmount to the total for the purchase and call RedeemCard. If the Gift Card account contains enough funds, ResponseCode will indicate the card was approved. If there are not enough funds available on the card to cover the TransactionAmount, normally the transaction will be declined. However, the merchant may set RedemptionType to rtPartialRedemption. This allows the customer to split the cost of the purchase between the Gift Card and another form of payment. Instead of declining the Gift Card, ResponsePreviousBalance and ResponseNewBalance can be used to deduce the amount removed from the Gift Card. The merchant may subtract that from the requested TransactionAmount to determine the difference to charge the customer.
You may also inquire as to the total funds contained on the card by calling BalanceInquiry. This will not effect the amount of funds contained on the card in any way.
You also have the ability to lock funds on a card with the LockCard method, so that they may not be used for any other purchase until first unlocked. Previous transactions may be voided with VoidTransaction, and any transactions for which you did not receive a response (due to network issues), should be immediately reversed using the ReverseLastTransaction method.
The status of any of the above transactions will be stored in the ResponseCode property, with human-readable text appearing in ResponseText. Like the FDMSRetail component, there are several other Response fields which will contain data that should be logged.
Property List
The following is the full list of the properties of the component with short descriptions. Click on the links for further details.
AlternateMerchantId | Merchant-designated store or location number. |
ApplicationId | Identifies the merchant application to the Datawire System. |
CardCVVData | Three digit security code on back of card (optional). |
CardCVVPresence | Indicates the presence of the card verification value. |
CardEntryDataSource | This property contains a 1-character code identifying the source of the customer data. |
CardExpMonth | Expiration month of the credit card specified in Number . |
CardExpYear | Expiration year of the credit card specified in Number . |
CardMagneticStripe | Track data read off of the card's magnetic stripe. |
CardNumber | Customer's credit card number for the transaction. |
ClerkId | Identifies the clerk executing this transaction. |
DatawireId | Identifies the merchant to the Datawire System. |
LockType | Indicates the type of lock requested by the LockCard method. |
MerchantNumber | A unique number used to identify the merchant within the FDMS and Datawire systems. |
MerchantTerminalNumber | Used to identify a unique terminal within a merchant location. |
ProxyAuthScheme | This property is used to tell the component which type of authorization to perform when connecting to the proxy. |
ProxyAutoDetect | This property tells the component whether or not to automatically detect and use proxy system settings, if available. |
ProxyPassword | This property contains a password if authentication is to be used for the proxy. |
ProxyPort | This property contains the TCP port for the proxy Server (default 80). |
ProxyServer | If a proxy Server is given, then the HTTP request is sent to the proxy instead of the server otherwise specified. |
ProxySSL | This property determines when to use SSL for the connection to the proxy. |
ProxyUser | This property contains a user name, if authentication is to be used for the proxy. |
RedemptionType | Identifies the type of redemption to execute. |
ReferenceNumber | Reference number used to identify the transaction. |
ResponseApprovalCode | Contains an authorization code if the transaction has been approved. |
ResponseCardClass | Identifies the class of the gift card used in the transaction. |
ResponseCardExpDate | Contains the expiration date of the gift card. |
ResponseCashBack | Indicates the amount of cash to return to the customer. |
ResponseCode | Indicates the status of the authorization request. |
ResponseDatawireReturnCode | Contains an error code providing more details about the DatawireStatus received. |
ResponseDatawireStatus | Status of the communication with Datawire. |
ResponseLockAmount | Contains the amount that is locked and cannot be used. |
ResponseNewBalance | Contains the balance on the card reflected immediately after this transaction. |
ResponsePreviousBalance | Contains the balance that was on the gift card before this transaction was completed. |
ResponseReferenceNumber | Contains the reference or customer number that was submitted in the request. |
ResponseSystemTrace | Contains a number used to trace the transaction. |
ResponseText | Contains a human-readable description of the response Code . |
SSLAcceptServerCertEncoded | The certificate (PEM/base64 encoded). |
SSLCertEncoded | The certificate (PEM/base64 encoded). |
SSLCertStore | The name of the certificate store for the client certificate. |
SSLCertStorePassword | If the certificate store is of a type that requires a password, this property is used to specify that password in order to open the certificate store. |
SSLCertStoreType | The type of certificate store for this certificate. |
SSLCertSubject | The subject of the certificate used for client authentication. |
SSLServerCertEncoded | The certificate (PEM/base64 encoded). |
TerminalId | Merchant-generated 4-digit terminal Id. |
Timeout | A timeout for the component. |
TransactionAmount | Purchase amount to be authorized. |
TransactionNumber | Uniquely identifies the transaction. |
URL | Location of the Datawire server to which transactions are sent. |
VoidType | Identifies the type of void to execute. |
Method List
The following is the full list of the methods of the component with short descriptions. Click on the links for further details.
ActivateCard | Activates a Gift Card. |
BalanceInquiry | Retrieves the balance remaining on a gift card. |
Config | Sets or retrieves a configuration setting . |
Interrupt | Interrupts the current action. |
LoadCard | Adds funds to a gift card. |
LockCard | Locks funds on a gift card. |
RedeemCard | Removes funds from the gift card for a purchase. |
Reset | Clears all properties to their default values. |
ReverseLastTransaction | Reverses the last attempted transaction. |
VoidTransaction | Voids a previous transaction. |
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.
Connected | Fired immediately after a connection completes (or fails). |
Disconnected | Fired when a connection is closed. |
Error | Information about errors during data delivery. |
SSLServerAuthentication | Fired after the server presents its certificate to the client. |
SSLStatus | Shows the progress of the secure connection. |
Status | Shows the progress of the FDMS/Datawire connection. |
Configuration Settings
The following is a list of configuration settings for the component with short descriptions. Click on the links for further details.
ClientTimeout | Indicates timeout client application will wait for response. |
CurrencyCode | Currency Code for this transaction. |
DebugTrace | Whether to enable debug logging. |
CardAvailableDate | Date in the future when the gift card's activation will complete. |
CardExpirationDate | Date you wish the gift card to expire. |
EchoBack | Generic field used at the merchant's discretion. |
SourceCode | Used to identify the source of the transaction. |
User1 | Generic field used at the merchant's discretion. |
User2 | Generic field used at the merchant's discretion. |
Refund | Adds value back onto a card. |
IsRetailTransaction | Determines whether the transaction was performed in an retail or internet environment. |
GenerateMerchantKeyPair | Generates a private and public key pair. |
MerchantPrivateKey | The Merchant's Private Key. |
MerchantPublicKey | The Merchant's Public Key. |
FDMSPublicKey | The FDMS Public Key. |
GenerateWorkingKey | Generates a Merchant Working Key. |
DecryptedWorkingKey | The decrypted Merchant Working Key. |
EncryptedWorkingKey | The encrypted Merchant Working Key. |
AssignMerchantWorkingKey | Assigns a merchant working key to be used by all Internet transactions with EANs. |
MerchantKeyID | The Merchant Key ID associated with the Merchant ID. |
EAN | Extended Account Number. |
SCV | Security Card Value. |
ConnectionTimeout | Sets a separate timeout value for establishing a connection. |
FirewallAutoDetect | Tells the component whether or not to automatically detect and use firewall system settings, if available. |
FirewallHost | Name or IP address of firewall (optional). |
FirewallPassword | Password to be used if authentication is to be used when connecting through the firewall. |
FirewallPort | The TCP port for the FirewallHost;. |
FirewallType | Determines the type of firewall to connect through. |
FirewallUser | A user name if authentication is to be used connecting through a firewall. |
KeepAliveTime | The inactivity time in milliseconds before a TCP keep-alive packet is sent. |
KeepAliveInterval | The retry interval, in milliseconds, to be used when a TCP keep-alive packet is sent and no response is received. |
Linger | When set to True, connections are terminated gracefully. |
LingerTime | Time in seconds to have the connection linger. |
LocalHost | The name of the local host through which connections are initiated or accepted. |
LocalPort | The TCP port in the local host where the component binds. |
MaxLineLength | The maximum amount of data to accumulate when no EOL is found. |
MaxTransferRate | The transfer rate limit in bytes per second. |
RecordLength | The length of received data records. |
TCPKeepAlive | Determines whether or not the keep alive socket option is enabled. |
UseIPv6 | Whether to use IPv6. |
TcpNoDelay | Whether or not to delay when sending packets. |
TLS12SignatureAlgorithms | Defines the allowed TLS 1.2 signature algorithms when UseManagedSecurityAPI is True. |
ReuseSSLSession | Determines if the SSL session is reused. |
SSLCipherStrength | The minimum cipher strength used for bulk encryption. |
SSLEnabledProtocols | Used to enable/disable the supported security protocols. |
SSLProvider | The name of the security provider to use. |
SSLSecurityFlags | Flags that control certificate verification. |
OpenSSLCADir | The path to a directory containing CA certificates. |
OpenSSLCAFile | Name of the file containing the list of CA's trusted by your application. |
OpenSSLCipherList | A string that controls the ciphers to be used by SSL. |
OpenSSLPrngSeedData | The data to seed the pseudo random number generator (PRNG). |
AbsoluteTimeout | Determines whether timeouts are inactivity timeouts or absolute timeouts. |
FirewallData | Used to send extra data to the firewall. |
InBufferSize | The size in bytes of the incoming queue of the socket. |
OutBufferSize | The size in bytes of the outgoing queue of the socket. |
CodePage | The system code page used for Unicode to Multibyte translations. |