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.
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 Number and EntryDataSource fields. Otherwise, you should fill the MagneticStripe field 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, Code 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, PreviousBalance and NewBalance 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 Code field, with human-readable text appearing in Text. Like the FDMSRetail component, there are several other Response fields which will contain data that should be logged.
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.|
|Card||Contains the customer's credit card information.|
|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.|
|Proxy||A set of properties related to proxy access.|
|RedemptionType||Identifies the type of redemption to execute.|
|ReferenceNumber||Reference number used to identify the transaction.|
|Response||Contains the response returned from the FDMS Closed Loop Gift Card system.|
|SSLAcceptServerCert||Instructs the component to unconditionally accept the server certificate that matches the supplied certificate.|
|SSLCert||The certificate to be used during SSL negotiation.|
|SSLServerCert||The server certificate for the last established connection.|
|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.|
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.|
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.|
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).|
|FirewallListener||If true, the component binds to a SOCKS firewall as a server (IPPort only).|
|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 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.|
|ProxyExceptionsList||A semicolon separated list of hosts and IPs to bypass when using a proxy.|
|TCPKeepAlive||Determines whether or not the keep alive socket option is enabled.|
|UseIPv6||Whether to use IPv6.|
|UseNTLMv2||Whether to use NTLM V2.|
|CloseStreamAfterTransfer||If true, the component will close the upload or download stream after the transfer.|
|TcpNoDelay||Whether or not to delay when sending packets.|
|CACertFilePaths||The paths to CA certificate files when using Mono on Unix/Linux.|
|LogSSLPackets||Controls whether SSL packets are logged when using the internal security API.|
|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.|
|SSLIncludeCertChain||Whether the entire certificate chain is included in the SSLServerAuthentication event.|
|SSLProvider||The name of the security provider to use.|
|SSLSecurityFlags||Flags that control certificate verification.|
|SSLEnabledCipherSuites||The cipher suite to be used in an SSL negotiation.|
|TLS12SignatureAlgorithms||Defines the allowed TLS 1.2 signature algorithms when UseInternalSecurityAPI is True.|
|TLS12SupportedGroups||The supported groups for ECC.|
|TLS13KeyShareGroups||The groups for which to pregenerate key shares.|
|TLS13SupportedGroups||The supported groups for (EC)DHE key exchange.|
|TLS13SignatureAlgorithms||The allowed certificate signature algorithms.|
|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.|
|GUIAvailable||Tells the component whether or not a message loop is available for processing events.|
|UseBackgroundThread||Whether threads created by the component are background threads.|
|UseInternalSecurityAPI||Tells the component whether or not to use the system security libraries or an internal implementation.|