Commit | Line | Data |
---|---|---|
d667da5b IK |
1 | Some countries have regulations on the use of cryptographic libraries |
2 | like the ones embedded in TCLink. It may be unlawful to download TCLink | |
3 | in these countries. | |
4 | ||
5 | ||
c235c6ac | 6 | TCLink v4.5.0 |
d667da5b | 7 | PHP Implementation |
c235c6ac | 8 | copyright (C) TrustCommerce 2019-2020 |
d667da5b IK |
9 | http://www.trustcommerce.com |
10 | techsupport@trustcommerce.com | |
11 | ||
c235c6ac | 12 | February 17, 2020 |
d667da5b IK |
13 | |
14 | I. DESCRIPTION | |
15 | ||
c235c6ac | 16 | TCLink is a thin client library to allow your servers to |
d667da5b IK |
17 | connect to the TrustCommerce payment gateway easily and consistently. |
18 | The protocol (which is the same across all platforms and languages) is | |
c235c6ac | 19 | well-documented in the TC Link API Developer Guide, so please consult it for |
d667da5b IK |
20 | any questions you may have about the protocol syntax itself. |
21 | ||
22 | If you are on a Windows environment, do not use this client. Please | |
23 | download the COM object and use the COM functions available for Windows | |
24 | to access the TCLink object. See here for more information: | |
25 | http://www.php.net/manual/en/ref.com.php | |
26 | ||
27 | TCLink was originally ported to PHP by Andrew Barnett of Data Clarity. | |
28 | Thanks go to both him (for the code) and his business (for their support | |
29 | of open source). | |
30 | ||
31 | ||
32 | II. LICENSE | |
33 | ||
34 | TCLink for PHP is released under the GNU LGPL. Please read LICENSE | |
35 | for details. | |
36 | ||
37 | ||
38 | III. REQUIREMENTS | |
39 | ||
40 | You must be running PHP 4.0.4pl1 or higher. | |
41 | ||
42 | You need to have the OpenSSL development libraries installed. | |
43 | It is recommended you use the most recent version provided by the | |
44 | vendor for PCI reasons. | |
45 | ||
46 | ||
47 | Besides the normal PHP install, you'll need the php-devel package, | |
48 | which contains files needed for building PHP modules. You can tell | |
49 | if this package is installed if the binary "phpize" is in your path. | |
50 | ||
51 | ||
52 | IV. BUILDING | |
53 | ||
54 | At the root directory of this archive, execute the following: | |
55 | ||
56 | phpize | |
57 | ||
c235c6ac | 58 | Afterwards, type the following commands, distribution specific comments provided when available: |
d667da5b | 59 | |
c235c6ac IK |
60 | General Instructions: |
61 | ./configure --with-ssl=[directory containing libssl.so] | |
d667da5b IK |
62 | make |
63 | ||
c235c6ac IK |
64 | Debian Jessie: |
65 | Debian Stretch: | |
66 | Debian Buster: | |
67 | ./configure --with-ssl=/usr/lib/x86_64-linux-gnu | |
68 | make | |
d667da5b | 69 | |
c235c6ac | 70 | Centos 8.1.1911: |
d667da5b IK |
71 | ./configure --with-ssl=/usr/lib64 |
72 | make | |
c235c6ac | 73 | |
d667da5b IK |
74 | If you are not sure where your SSL library is installed, contact your system administrator or hosting provider |
75 | for more information. | |
76 | ||
77 | If the module builds without errors and you have access to PHP at the command line, | |
78 | you can test it with the following command: | |
79 | ||
80 | php -d extension=modules/tclink.so tctest.php | |
81 | ||
82 | This script will run a test transaction and print the results. | |
83 | ||
d667da5b IK |
84 | V. INSTALLATION |
85 | ||
86 | If you have root access to the machine, you will probably want to | |
87 | install TCLink as a global extension. You can do this by copying the | |
88 | module library (modules/tclink.so) to your PHP extensions directory | |
c235c6ac | 89 | (typically /usr/lib/php*). Your extensions directory is defined by the |
d667da5b IK |
90 | "extension_dir" directive in php.ini. |
91 | ||
c235c6ac | 92 | Edit php.ini (typically found somewhere in /etc) and add the following line: |
d667da5b IK |
93 | |
94 | extension=tclink.so | |
95 | ||
96 | Restart your webserver, and all PHP scripts will have access to TCLink. | |
97 | ||
98 | If you can't or don't want to install the module system wide, you can | |
99 | still load it manually in each script that needs to access it through | |
c235c6ac IK |
100 | the dl() call. Your system must be configured to allow dynamic loading of |
101 | modules for this to work; see your system administrator or hosting provider. | |
d667da5b IK |
102 | |
103 | ||
104 | VI. USAGE | |
105 | ||
106 | The tctest.php script shows a simple example of running transactions | |
107 | through the TCLink API. A more complex example is contained in | |
c235c6ac | 108 | tcexample.php. |
d667da5b IK |
109 | |
110 | The curltest.php script shows a simple example of running transactions | |
c235c6ac | 111 | through the HTTPS post, as described in the TC Link API Developer Guide. It is |
d667da5b IK |
112 | provided here in as a conveinence to users who are unable to install |
113 | TCLink and have Curl available in their installation. | |
114 | ||
c235c6ac IK |
115 | VII. PLATFORMS |
116 | ||
117 | The included code has been tested on the following platforms: | |
118 | ||
119 | CentOS Linux release 8.1.1911 (Core) | |
120 | OpenSSL Version 1.1.1c-2 (Distribution), php-cli-7.2.11-2.module_el8.1.0+209+03b9a8ff.x86_64 (Distribution) | |
121 | Debian Linux release 8.11 | |
122 | OpenSSL Version 1.0.1t-1+deb8u12 (Distribution), PHP version 5.6.40+dfsg-0+deb8u8 (Distribution) | |
123 | Debian Linux release 9.8 | |
124 | OpenSSL Version 1.1.0l-1~deb9u1 (Distribution), PHP version 7.0.33-0+deb9u6 (Distribution) | |
125 | Debian Linux release 10.3 | |
126 | OpenSSL Version 1.1.1d-0+deb10u2 (Distribution), PHP version 7.3.11-1~deb10u1 (Distribution) | |
127 |