SurfShopCart Documentation

Setting Up Shop Has Never Been Easier!

User Tools

Site Tools


Action disabled: register
using_linkpointapi

Using LinkPointAPI

STEP 1

Get the lpperl.pm module from LinkPoint. We cannot include it for legal reasons.

Please also note that LinkPointAPI requires the “curl” application. Contact your ISP if you have any questions about whether “curl” is installed on your host server.

The LinkPoint code will not run under “taint mode.” Either (1) disable the -T switch in shop.cgi:

  #!/usr/bin/perl -T 
  to
  #!/usr/bin/perl
  # -T

– OR –

(2) Modify lpperl.pm by inserting the following at line 591:

   if ($debugging)	{ print "nPOST $hoststgn$xmlstgnnSHELL> $curln"; }
   ### HACK TO RUN UNDER -T SWITCH ###
   $curl = $1 if ($curl =~ /(.+)/);
   $ENV{'PATH'} = <nowiki>//</nowiki>;
   ######## END OF UGLY HACK #########        
   if (! ($rdata = `$curl`))  # If $rdata comes back empty, it's a curl error
   {

STEP 2

Copy lpperl.pm to your surfshop scripts directory (i. e., “/cgi-bin/surfshop”)

STEP 3

You should have received your certificate from LinkPoint. It looks like this:

    -----BEGIN RSA PRIVATE KEY----- 
    MIICXAIBAAKBgQC13jS5T/DqXVBnPDspvy04gztA/Dav0spaA8jKWfeo1bs6pdWS 
    Xpw1vtB2+hsA6kQnAya7cX/lkVuQzPTehyFFRu6E/Psvwo0wZR2SnBNo+92iDlqk 
    9gfZDUCsUUw8xJJoefJzuiWNTAhX6qMaGSds4Z33fqUvmpsiTuo3LVg6tQIDAQAB 
    AoGAeQUGHJIfhDTX/fpMfDklBEf/M/0g/trLoB6IjG5VqNmgnyQe/ClM1U7GNYW0 
    VmWNOFCWg4DBVKfnQHHCOBm/ftRG46kNReBkE6xooJrnYEw1ECXvJhUnRkSYSvaN 
    j8Xf4FPMNBf6TDB1zflhrKDCGa1btv5KL7dDFeLTMXkWVfkCQQDlJN2eOrroYz1U 
    kcbB21aXFwS1937DqC4PO2ldPDtdDrYLFHbjP56jqpGWhV0JhPVUrKlYV8+kaWP+ 
    SWc8B4WLAkEAyy7kUKVjqouDFONlvKggjhgaU/cdG5/hNddeIZO7LSqlCgaHKgGg 
    f0leCApO3OZlAP0RLnp4RIKOykyzvZBYvwJAP57guVHtGyCSoqxm1uQjQoftkuhI 
    leJYB3rCexSCFvBCswjXiXjcfuyYx4X3svDrfLsDubeHu0pXrP6MXyp0yQJAM7zN 
    BnwW1OaRilAdJ9zn7UbV7WuPTel4P22H2qTzlJy3ScY/xMKFS+QyvXlie31vWsEW 
    Du/AkDFuirTdT/fhoQJBANtjhzU8Jy3FI/mr1FZhi/0rqCZ39Ezy03IMRsXNR6RT 
    zrSC8A6/yM+RN7PwLsR+2yuLZPvPOFCae1TWbye821A ======
    -----END RSA PRIVATE KEY----- 
    
    -----BEGIN CERTIFICATE----- 
    MIICdzCCAeACAQAwDQYJKoZIhvcNAQEEBQAwgYMxDDAKBgNVBAYTA1VTQTELMAkG 
    A1UECBMCRkwxEDAOBgNVBAcTB0pVUElURVIxFzAVBgNVBAoTDkxVTVBZU1RVRkYu 
    Q09NMRUwEwYDVQQDEwxUUkFDRVkgRUxMRVIxJDAiBgkqhkiG9w0BCQEWFXRyYWNl 
    eUBsdW1weXN0dWZmLmNvbTAeFw0wMzA2MDUxOTE3MDNaFw0zMzA2MDIxOTE3MDNa 
    MIGDMQwwCgYDVQQGEwNVU0ExCzAJBgNVBAgTAkZMMRAwDgYDVQQHEwdKVVBJVEVS 
    MRcwFQYDVQQKEw5MVU1QWVNUVUZGLkNPTTEVMBMGA1UEAxMMVFJBQ0VZIEVMTEVS 
    MSQwIgYJKoZIhvcNAQkBFhV0cmFjZXlAbHVtcHlzdHVmZi5jb20wgZ8wDQYJKoZI 
    hvcNAQEBBQADgY0AMIGJAoGBALXeNLlP8OpdUGc8Oym/LTiDO0D8Nq/SyloDyMpZ 
    96jVuzql1ZJenDW+0Hb6GwDqRCcDJrtxf+WRW5DM9N6HIUVG7oT8+y/CjTBlHZKc 
    E2j73aIOWqT2B9kNQKxRTDzEkmh58nO6JY1MCFfqoxoZJ2zhnfd+pS+amyJO6jct 
    WDq1AgMBAAEwDQYJKoZIhvcNAQEEBQADgYEANsCkXBo7ZffK0mLTLtP75+yBdHYQ 
    8SHdsRzqw1EsFRgQQq3NMojzE/rGcNWxX1XcK6T+l6HUBCyP/2ubiCz3UwW3/1w/ 
    rlqRCVHnLssyltgtOnzQrbhC3ztPOx9dCKWW9R4OrpDLaF8XzccD0Gn026VmhTmW 
    9jnCVi3rJPtDPxk ======
    -----END CERTIFICATE-----

STEP 4

Save this as a text file and name the file “lpapi.pem”. Copy this file to your surfshop scripts directory.

STEP 5

Open the surf shop script, “linkpointapi.pl” (in the surfshop scripts directory) and customize the following lines, based on your account information:

  my $type      = 'SALE';              # Insert transaction type here:
                                       # SALE and PREAUTH are most common
  my $storename = //;                  # Insert LinkPoint storename here; e.g., '012345' 
  my $hostname  = 'secure.linkpt.net'; # LinkPoint API hostname 
  my $port      = '1129';              # LinkPoint API Port Number 
  my $keyfile   = './lpapi.pem';       # Path to your LinkPoint Certificate File 
  my $test      = 'GOOD'; 
                                       # - enter 'GOOD', 'DUPLICATE', or 'DECLINE' to force result 
                                       # change to 'LIVE' or // when done testing

STEP 6

Modify your “Global Settings”:

Cardservice Vendor(s): LinkPointAPI
Cardservice domain(s): secure.linkpt.net
Name of transaction result field: status
Value when approved: approved
Value when declined: declined
Name of AVS result field: leave blank
Name of “Reason for Decline” field: leave blank
Name of “Authorization Code” field: leave blank
Name of “Reference Number” field: leave blank

STEP 7

Check the box labeled “Use Credit Card Form” in the “Check Out Options” Admin.

In the Check-Out Form section of your Check-Out Options admin, edit the following line:

<input type="hidden" name="<! ss_appfield>" value="<! ss_approved>"> 

Change it to:

<input type="hidden" name="<! ss_appfield>" value="LinkPointAPI">

STEP 8

Test the API - if you get a completed transaction, try changing the $test variable to 'GOOD', 'DUPLICATE', or 'DECLINE' to make sure it returns the correct result in all cases. Once it is working you can change the setting in linkpointapi.pl to “LIVE”.

<<Main_Page Top^

using_linkpointapi.txt · Last modified: 2018/07/03 04:55 (external edit)