

                                TCLink v3.2
                             PHP Implementation
                       copyright (C) TrustCommerce 2001
                         http://www.trustcommerce.com
                         developer@trustcommerce.com

                               March 26, 2001

I. DESCRIPTION

  TCLink is a thin client library to allow your e-commerce servers to
connect to the TrustCommerce payment gateway easily and consistently.
The protocol (which is the same across all platforms and languages) is
well-documented in the Web Developer's Guide, so please consult it for
any questions you may have about the protocol syntax itself.

  TCLink was originally ported to PHP by Andrew Barnett of Data Clarity.
Thanks go to both him (for the code) and his business (for their support
of open source).


II. LICENSE

  TCLink for PHP is released under the GNU LGPL.  Please read COPYING
for details.


III. REQUIREMENTS

  You need to have the OpenSSL development libraries installed, with
the include files accessible in the include path and the library
files accessible in the library path.  The standard OpenSSL RPMs
from ftp.openssl.com are recommended.

  Besides the normal PHP install, you'll need the php-devel package,
which contains files needed for building PHP modules.


IV. AUTOMATED INSTALLATION

  To install as a module, you need only become superuser and run the
install.sh shell script included in the top level directory of this
archive.  Restart your webserver and you should be up and running.

V. MANUAL INSTALLATION

  Should you wish to run some or all of the steps manually, they
are described below.  YOU DON'T NEED TO DO THESE IF YOU USE
THE INSTALL SCRIPT.

1. Build and install the C shared library by descending to the "C"
   directory and typing "make install".  The libtclink.so module
   is installed to the /usr/local/lib directory.

2. Change to ../php and type "phpize".

3. Type "./configure --with-ssl=/usr/lib --with-tclink=$PWD/../C".

4. Type "make".

5. Type "make install".

6. Edit your /etc/php.ini file, and add the line "extension=tclink.so".

7. Restart Apache.


VI. USAGE

  The tctest.php file in the top level of this archive shows how to
use the TCLink module.  Place it somewhere in your web tree and try
running some transactions to check if your module is working.  Then,
examine the code to see how to use it yourself.

  A brief description of the functions available follows.

      int tclink_create()
        Creates a new TCLink handle.

      bool tclink_pushparam(int handle, string name, string value)
        Adds a parameters to be sent to the server. The handle
        parameter is the return value of tclink_create().

      bool tclink_send(int handle)
        Returns true on success, false on failure.

      string tclink_getresponse(int handle, string name)
        Returns false if no such parameter, or returns a string with value.

      array tclink_getentireresponse(int handle)
        Returns false on error, or returns an associative array with response
        values in it.

      string tclink_getversion()
        Returns string with C-library version information.


VII. STATIC EXTENSION

  Should you wish to install the module as a static extension instead
of a module, follow these steps.

1. Run "./buildconf".  You may want to edit build/builcheck.sh to add ./ in front of 
   the libtool check.

2. Run "./configure --with-ssl=/usr/lib and --with-tclink=$PWD/../C"

3. Type "make", and "make install".


