- API
- Cart Setup
- Agoracart
- Brightbuilders
- Cart32
- ClickCart Pro Connect
- CubeCart
- Herbalife
- Internet Treasure Chest
- LinkPoint Cart
- Meridian1
- Miva Merchant
- Monstercommerce
- Oscommerce API
- Oscommerce Connect
- PriceGrabber
- ProStores
- QuickCart
- SNSCART
- SecurenetShop
- ShopFactory
- ShopSite
- Storefront
- Virtuemart
- X-Cart
- Yahoo Store
- Connect
- Contact
- Example Code
- Example Forms
- FAQ
- General
- Web Service
PHP API Setup
NOTE: If your web site is hosted by GoDaddy you will NOT be able to use LinkPoint API because they block port 1129. You can try to contact Godaddy to see if they will unblock this port otherwise you will have to use the Connect option.
Before you begin using LinkPoint API you will also need to download the PEM file.
NOTE: The LinkPoint PEM can not be installed on the web server as a SSL certificate.
- Log into LinkPoint Central
- Click on Support on the top menu.
- On the left menu click on Download Center
- Click on Download PEM
- Save the file to your desktop
- Upload the PEM file to the root of your web site or any other folder.
If your web site is on a UNIX server you need to make sure you upload the file in ASCII (text) format.
REQUIREMENTS:
Make sure the version of PHP is greater than 4.0.2
PHP compiled with both cURL and OpenSSL
SSL certificate for the web site
Port 1129 needs to be open on the web server. Contact your web host to verify.
If you are not sure what version of PHP you have, create a file named phpinfo.php with the following code:
CODE
<?php
phpinfo();
?>
phpinfo();
?>
If you are using a Windows server make sure uncomment the cURL extension in the php.ini file which is located in the following directory:
C:\windows\php.ini
On a UNIX server it would be located in the following directory:
/usr/local/php5/lib/php.ini
Edit php.ini, look for the following code, and remove the semicolon at the beginning:
CODE
;extension=php_curl.dll
- Download the PHP wrapper.
- Upload one of the example files such as SALE_MININFO.php
(Do not place any of the PHP files in the cgi-bin folder.) - Upload the file named lphp.php into the same direcotory
- Upload the PEM file to the same directory as the PHP files you uploaded earlier.
- Edit the example file and change the following 2 lines of code (replace 123456 with your LinkPoint store number):
CODE
$myorder["keyfile"] = realpath("123456.pem");
$myorder["configfile"] = "123456";
$myorder["configfile"] = "123456";
If you want to place the PEM file in a different directory then you will need to change the line of code for "keyfile"
CODE for UNIX server
$myorder["keyfile"] = "/home/htdocs/www/linkpoint/123456.pem";
CODE for WINDOWS server
$myorder["keyfile"] = "c:\\inetpub\\wwwroot\\linkpoint\\123456.pem";
If you want to run test transactions, look for the following line of code:
CODE
$myorder["result"] = "LIVE";
Make the following change:
CODE
$myorder["result"] = "GOOD";
If you are using the staging server you will also need to modify the lphp.php file and uncomment 2 lines of code.
Search for "setopt" and remove the pound symbol in front of the 2 lines.
CODE
# curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);
# curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);
# curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);
SGS-020003: Invalid XML
If you receive the "Invalid XML" error you will need to add the following line of code for troubleshooting:
CODE
$myorder["debugging"] = "true";
You may need to uncomment the line by removing the 2 forward slashes at the beginning.
Place another order and you will see some code displayed like the following example:
CODE
sending xml string:
<order><orderoptions><ordertype>SALE</ordertype><result>LIVE</result></orderoptions>
<creditcard><cardnumber>4111-1111-1111-1111</cardnumber><cardexpmonth>01</cardexpmonth>
<cardexpyear>05</cardexpyear></creditcard>
<billing><zip>12345</zip><addrnum>&123</addrnum></billing><shipping></shipping>
<transactiondetails></transactiondetails> <merchantinfo><configfile>679880</configfile><keyfile>679880.pem</keyfile>
<host>secure.linkpt.net</host><port>1129</port></merchantinfo> <payment><chargetotal>9.99</chargetotal></payment></order>
server responds:
<r_csp></r_csp><r_time></r_time><r_ref></r_ref><r_error>SGS-020003: Invalid XML</r_error>
<r_ordernum></r_ordernum><r_message></r_message><r_code></r_code><r_tdate></r_tdate><r_score>
</r_score><r_authresponse></r_authresponse><r_approved></r_approved><r_avs></r_avs>
Status: Error: SGS-020003: Invalid XML ±
<order><orderoptions><ordertype>SALE</ordertype><result>LIVE</result></orderoptions>
<creditcard><cardnumber>4111-1111-1111-1111</cardnumber><cardexpmonth>01</cardexpmonth>
<cardexpyear>05</cardexpyear></creditcard>
<billing><zip>12345</zip><addrnum>&123</addrnum></billing><shipping></shipping>
<transactiondetails></transactiondetails> <merchantinfo><configfile>679880</configfile><keyfile>679880.pem</keyfile>
<host>secure.linkpt.net</host><port>1129</port></merchantinfo> <payment><chargetotal>9.99</chargetotal></payment></order>
server responds:
<r_csp></r_csp><r_time></r_time><r_ref></r_ref><r_error>SGS-020003: Invalid XML</r_error>
<r_ordernum></r_ordernum><r_message></r_message><r_code></r_code><r_tdate></r_tdate><r_score>
</r_score><r_authresponse></r_authresponse><r_approved></r_approved><r_avs></r_avs>
Status: Error: SGS-020003: Invalid XML ±
You may need to copy the "sending XML" and "server responds" portion and email it to LinkPoint support.
