Implementation Overview
The SLIM CD libraries provide wrappers around each of the SLIM CD web services so that developers can use libraries instead of communications protocols. These libraries hide the actual data communication protocols by exposing properties of an object to set and methods to invoke.
Implementation Philosophy
The libraries are coded to allow the developer to declare the class/object from SLIM CD’s library, set the properties of the individual items (such as cardnumber, etc), then trigger a method that returns a result as another class or set of properties.
Depending on the language and environment, the methods are implemented in either a synchronous or an asynchronous fashion. If the method is entered
Groups of Functions/Methods/Classes
The SLIM CD libraries have six main groupings. Each group contains a collection of similar features.
Validation | Handy set of functions to validate a cardnumber, expiration date, etc. |
Login | Provide user validation and client/site access information |
Transact | Processes payments, Closes Batches of transactions, get/sends text receipts |
Reports | Pulls reports from the SLIM CD servers as an array of records |
Images | Provides ways to store or retrieve signatures from SLIM CD’s servers |
Sessions | Provides a way to create and manage Secure Sessions/Hosted Pages |
Request Objects
Each method/function accepts a request object as input and returns a reply object as output. The request objects contain values that map to the arguments required by the web services. The reply objects contain values that are supplied by the web services.
Callbacks
A callback function is required for those languages which implement asynchronous through an operating system or external linkage. In these cases, the methods/functions accept the name of a callback function as the final argument in their calling sequence. Callback functions are called by supplying a single argument, the reply object.
Calling Sequences
Methods or functions in the library may contain arguments if the language library promotes that approach. In addition, a method may have multiple definitions with different argument lists. The most common example is the inclusion of “timeout” as a value that determines how long the connection to the web service should wait before deciding to return without a response from the web server.
Other differences are the handling of the reply. Some libraries implement a callback function that is invoked with the reply data. Others are synchronous (or act as if they are synchronous) and return the reply data from the function/method call as a return value.
Entry Points
Transact
ProcessTransaction | Post a transaction to the SLIM CD servers and return a reply |
CloseBatch | Close the currently open batch of transactions that were previously collected by calls to ProcessTransaction |
GetReceipt | Get the receipt text as a content-type of text/plain |
SendReceipt | Send the text for the receipt as an email or sms-text |
GetTemporaryToken | Gets a Transient Token that can store credit, debit or check information for up to 5 minutes |