CreateSession

  • Method

    SlimCD.Sessions.CreateSession

    Purpose

    Loads data into SLIM CD and returns a session id.

    Description

    CreateSession is used to create a SessionID. SessionID values are later used as part of a secure and tamper-resistant URL so that a browser-style application can be launched to accept cardholder information outside of the developer’s software. CreateSession can also be used to send initial customer data to SLIM CD so that payment pages are pre-populated for the clerk, providing ease of data entry.

    Business Rules

    CreateSession must be called before ShowSession can display a page.

    Argument List

    Name Required Usage
    CheckSessionRequest Required Object containing properties for the request
    timeout Optional Integer wait time, in seconds, before timeout response is generated
    callback* Optional Function to call upon completion of asynchronous request

    *for JavaScript only

    CheckSessionRequest Fields

    Field Name Type Length Required Description
    UserName string 20 required Username or API Access Credential that accesses web service.
    Password string 20 required Plaintext password for the client account.
    SiteID integer 10 optional Assigned by the Slim CD administrator.
    ClientID integer 10 conditional Assigned by the Slim CD administrator.
    PriceID int 9 required numeric value provided by SLIMCD that is sent when processing a transaction
    FormName string 40 required name of the form to use when creating a session
    TransType string 20 required type of transaction to perform (SALE, CREDIT, VOID, etc).
    Amount string 20 required Amount of the transaction.
    UserField string varies optional This is a USER-SUPPLIED field, can be named whatever the developer wants, and can be used to store additional data with the form. In the case of the libraries, these field name/values are provided in a dictionary called “userfields”. In the case of the webservice/resource, these fields are simply included with other name/value pairs.
    1. Passwords are required except when the username is set to an API Access Credential, in which case it should be passed in as an empty string.
    2. ClientID, SiteID, PriceID are required if not specified in the API Access Credential
    3. Form name is highly recommended. FormID can also be specified, but it is unique and prevents the form from being used by more than one clientid. If not FormName is specified, the system will select a form, producing unexpected results.
    4. TransType is required, unless specified on the form as an editable field.
    5. Amount is required, unless specified on the form as an editable field.
    6. UserFields are any field the developer wishes to send. For direct API calls, simply add the field to the name/value pairs. For libraries, add the fields to the “userfields” dictionary associated with the CreateSessionRequest object

    Reply Fields

    reply outer tag for the reply data block
    response Success, FAIL, Error
    response code 0, 1, 2 (respective) matching the above
    description If successful, this will contain the single word, OK. Otherwise it will contain a description of failure or error which occurred
    reponseurl The Slimcd.com url which was called for this operation
    datablock The confirmation text returned from the server.

    Reply Hierarchy

    • reply
      • response
      • responsecode
      • description
      • responseurl
      • datablock
        • sessionid

    Remarks

    • Optional Fields fall into a few categories. These include Form Data, Customer Data, Payment Data, Clerk Identification Data, and Custom Developer Data.
    • Form Data allows the developer to identify the pre-configured display form to use. Form configurations are created on the SLIM CD website and referenced by name or numerical value. This identification is sent when the session is created so that the proper form configuration will be used when displaying the form data to the clerk or consumer. (Note that at this time, specifying a form is optional. The system will use the lowest FormID available for the merchant if none is specified. This approach is subject to change and SLIM CD recommends supplying form names when sessions are created to insure the display functionality meets developer expectations)
    • Customer Data can include any of the payment data supported by the SLIM CD gateway. This includes First Name, Last Name, Address, City, State, Zip, etc.
    • Payment Data includes other fields supported by the SLIM CD, such as TransType and Amount. If the transaction type is not specified, it will default to SALE. Specialty fields can be provided, such as Hotel Checkin Date, etc. The “gateid” field can be provided to reference customer data from previous transactions without supplying that data or cardholder information.
    • Please note that CreateSession will not accept certain cardholder data information. This is to ensure that PA-DSS avoidance and PCI Scope Reduction is obtained by discouraging applications from storing or sending cardholder data. Previously processed cardholder data can be referenced using the SLIM CD “gateid” values from those previous transactions.
    • The following fields will not be accepted by the CreateSession function: Card Number, Track Data, CVV2, or PIN Block data fields. If the developer desires to provide this information to SLIM CD as part of a conversion that eliminates cardholder data storage, we recommend using the SLIM CD Developer’s Toolkit and perform the “LOAD” function.

    Examples

    Sample HTTP GET:

        (Note: Use of GET is NOT recommended for CreateSession, even with an API Access Credential, as it sends data insecurely)

    Sample HTTP POST:

    URL: https://stats.slimcd.com/soft/createsession.asp POSTDATA: clientid=1032&siteid=249949344&priceid=74&password=289075&amount=20&first_name=Frank&var1=test2

    Sample HTML Form with POST:

  • Include

    Method

    Request

    Reply

    Sample Code

    Downloads

    Download full sample source.


     

  • Include

    Method

    Request

    JSON Reply

    Sample Code

    Downloads
    Download full sample source.


  • Include

    Method

    Request

    Reply

    Cross Reference: Client

    Sample Code

    Downloads
    Download full sample source.


  • Include

    Method

    Request

    Reply

    Sample Code


  • Method

    Request

    Reply

    Sample Code

    Downloads

    Download full sample source.


  • URL

    Protocols

        • SOAP/XML
        • HTTP POST
        • HTTP GET

    Request

    Status Codes

    Status Code Status Description Explanation
    200 200 OK Approved or declined attempts will return a response with an XML reply block
    500 500 Internal Server Error The response will not contain XML, as a server error has occurred.

    Reply

    Output is in XML format if a status code of 200 is returned.

    If the <reply> block’s <response> tag does not indicate “Success”, the <description> tag will contain an error description which can be displayed to the end-user

    Sample Code

    Simple HTML form to show CreateSession

    Remarks

    • Any fields not recognized by CreateSession will be stored in the session so that you can retrieve them later with CheckSession or on the PostBack
    • CreateSession uses the FormName to uniquely identify which form design to display with ShowSession. Forms can be exported from one clientid and imported into another to make installation of forms simple across merchants
  • URL

    Protocols

    • HTTP POST
    • HTTP GET

    This function accepts either name/value pairs or JSON

    Request

    Reply

    Sample Code

    Remarks

    1. None