Linkpoint API Payment Module

Contrib type: 
Module
Status: 
Complete and working
Moderation: 
Failed code review

Downloads

Compatibility: 
Ubercart 1.x

This is a current working version of the Linkpoint API module that was posted on the forums awhile back.

To install this module, extract the uc_linkpoint_api.zip file to your modules/ubercart/payment folder. After, go to the modules section in drupal admin (http://www.yoursite.com/admin/build/modules) and scroll down to the "Ubercart - Payment" modules section. Enable "Linkpoint API".

In order to communicate with your linkpoint account, you will need to get a file called a PEM file from linkpoint. To get it, go to Linkpoint Central -> Support -> Download Center. Save that file to your modules/ubercart/payment/uc_linkpoint_api folder.

Once you've done that, navigate over to the Payment settings in ubercart (http://www.yoursite.com/admin/store/settings/payment/edit/gateways). Click on "Linkpoint API settings" and where it says PEM file, fill in the absolute path to your PEM file (example: /home/domain/public_html/modules/ubercart/payment/uc_linkpoint_api/123456.pem).

The Linkpoint API module submits the following information to Linkpoint Central:

    Billing Address:
    • Name
    • Company
    • Address 1
    • Address 2
    • City
    • State/Province
    • Zip/Postal Code
    • Country

    Shipping Address:

    • Name
    • Address 1
    • Address 2
    • City
    • State/Province
    • Zip/Postal Code
    • Country

    Contact Information:

    • Phone
    • E-Mail
    • IP Address

    Credit Card Information:

    • Card Number
    • Card Expiration Month
    • Card Expiration Year in 2 digits (00, 01, 02, etc)
    • CVM Value

    Payment Information

    • Total Amount

It will also pass all of the item descriptions and attributes to the Linkpoint Central comments section. To disable this, scroll down to line 191 and comment it out so it looks like this:

  //$xml .="<comments>" . $description . "</comments>";

All issues addressed in my old post and the post by guest have been addressed and corrected.

PreviewAttachmentSize
uc_linkpoint_api.zip3.81 KB
Nick's picture
Offline
Joined: 08/17/2007
Juice: 95
Re: Linkpoint API Payment Module

I was getting an error telling me the Credit Card Expiration Year was incorrect when I tried to process credit cards. I did a little more research and found linkpoint needs the years to be in 2 digits instead of 4 digits.

In the linkpoint module there is a line that is supposed to truncate the year down to 2 digits:

$xml .="<cardexpyear>" . date('y', $order->payment_details['cc_exp_year']) . "</cardexpyear> ";

This wasn't working for me so I removed that line and replaced it with:

$cardexpyr = substr($order->payment_details['cc_exp_year'], 2, 2);
$xml .="<cardexpyear>" . $cardexpyr . "</cardexpyear> ";

As of 10/8/2007 this module appears to be fully functioning for me.

Guest (not verified)
Guest's picture
Country problem

Another issue with Linkpoint is the country code is supposed to be 2 letters. For example:

US for USA
CA for Canada.

The problem is Ubercart stores the countries as numbers. For example:

USA is 840
CA is 124

For the time being, I devised a ghetto little rig to convert these numbers to the 2 letters needed by Linkpoint.

Add the lines to the uc_linkpoint_api.module file:

Original file:

$description = substr($description, 0, 255);
*/

  $xml ="<order>";

Modified file:

$description = substr($description, 0, 255);
*/

$countrybill = $order->billing_country;
  if ($countrybill == 840) {
    $countrybill = "US";
  } else if ($countrybill == 124) {
    $countrybill = "CA";
  }

  $xml ="<order>";

After you do that, find the line that says:

$xml .="<country>" . $order->billing_country . "</country>";

and replace it with:

  $xml .="<country>" . $countrybill . "</country>";
pat
pat's picture
Offline
Joined: 11/22/2007
Juice: 8
Copyright issue

This module contains some code from the linkpoint lphp.php file decodeXML function. This file has a copyright notice on it.

I have a rewritten module without copyright code I will post soon.

mrpoptart's picture
Offline
Joined: 01/15/2008
Juice: 49
Godaddy and others

Some non-dedicated hosting companies do not give cURL access to certain ports.

This means that GoDaddy will NOT work with this module if you have a shared hosting server.

jodo's picture
Offline
Joined: 01/10/2008
Juice: 28
help needed

I posted this in the general forum in error as I thought I was adding it to this thread of nick's.
http://www.ubercart.org/forum/general_discussion/3064/linkpoint_yourpay_...

Question as posted:

Ubercart tells me "Your order is complete!" I get no other feedback. And there is nothing in watchdog indicating any errors. This is LIVE Production mode.
When I check for the transaction on the linkpoint/yourpay site there is none.

Linkpoint_api_module here:
/home/xxx/www/mydomain.com/sites/all/modules/ubercart/payment/uc_linkpoint_api/uc_linkpoint_api.module

pem file here:
/home/xxx/www/mydomain.com/sites/all/modules/ubercart/payment/uc_linkpoint_api/1234567890.pem

What is the best way to debug this? How to see what is being passed to linkpoint?

apologies for the "double" post

Nick's picture
Offline
Joined: 08/17/2007
Juice: 95
Re: help needed

What I did to see more debug info was edit the following lines:

'message' => t('Credit card payment declined: !text', array('!text' => $x_response_text)),

'message' => t('Credit card payment processed successfully. Approval code: !code', array('!code' => $approved_text)),

to

'message' => t('x_response_code:'. $x_response_code .'<br />x_approval_code:'.$x_approval_code.'<br />xml: '.$xml.'<br />Credit card payment declined: !text', array('!text' => $x_response_text)),

'message' => t('x_response_code:'. $x_response_code .'<br />x_approval_code:'.$x_approval_code.'<br />xml: '.$xml.'<br />Credit card payment processed successfully. Approval code: !code', array('!code' => $approved_text)),

jodo's picture
Offline
Joined: 01/10/2008
Juice: 28
thanks for the code

Thanks for the code, Nick. Assuming I installed it correctly I still get no feed back except the standard "Order complete."
So I don't know if linkpoint is receiving anything or not.
I am using the standard test number 4111111111111111. (Linkpoint tech told me it is not a problem using that number)
Any ideas on how I can tell if my server is shaking hands with theirs?

Another issue in looking at the order report under the admin/store/orders/69/payments there is no info recorded regarding the payment. It's all blank. This indicates to me something is not being completed even though the cart says it is.

mimetic2's picture
Offline
Joined: 08/07/2007
Juice: 478
screen goes blank

Hi,

I keep trying to process a card (i'm going through ubercarts backend) and it keeps going blank after i go to charge card.

Does nayone know why this is?

I cant seem to get this to work =/

mimetic2's picture
Offline
Joined: 08/07/2007
Juice: 478
FIXED

I transfered servers and now the module works...SO it mustve been something with my server configuration.

Thanks nick for the great module

rmarc71's picture
Offline
Joined: 03/07/2008
Juice: 5
Issues with linkpoint (invalid XML)

Just wanted to toss this out to whomever is using this API. I'm using linkpnt via YourPay and found an issue with this where I'd get errors: SGS-020003.
This is an invalid XML error. After much lack of help from their support,
I found this in their manual:

SGS-020003: Invalid XML

There are a couple different things that will cause this error.

1. Make sure the amount for chargetotal is not blank.
2. Make sure expiration year is only 2 digits
3. Make sure there is no dollar sign for the amount.
4. Make sure there are no symbols like an ampersand,
apostrophe, or letters with accents
5. If there is no shipping make sure you pass zero for the amount
6. Make sure there are no commas in the amount for chargetotal

The issue I have is a LOT of my commercial customers have an & or an
apostrophe in their company names.

I had to add the following to the module:

/* remove ampersand and appostrophes from text */
$xml = str_replace("&", "and", $xml);
$xml = str_replace("'", " ", $xml);
/* end scrub */

Now things are happier.

R. Marc

signalpoint's picture
Offline
Joined: 07/24/2008
Juice: 14
Can't Connect To Payment Gateway

Hello Linkpoint API Module Crew,

I am having a problem when clicking "Submit Order" on the "Review order" page, e.g. https://www.domain.com/cart/checkout/review , the form submit hangs for a while then I get these error messages on a blank white page:

Warning: MySQL server has gone away
couldn't connect to host
Credit card declined: $0.50
Payment failed: Credit card payment declined: Sorry - Could not connect to payment gateway.

I assume SSL is working fine since https://www.domain.com/cart/checkout/review works ok.

I checked to see what my absolute path was and if curl is enabled using the following php code and received the output below:

$_SERVER['DOCUMENT_ROOT']
output: /home/account_name/public_html

var_dump(curl_version())
output: libcurl/7.18.2 OpenSSL/0.9.7a zlib/1.2.1.2 libidn/0.5.6

My settings at store/settings/payment/edit/gateways for the Linkpoint API are:

Store Number: xxxxxxxxxx (10 digits)
PEM File: /home/account_name/public_html/modules/ubercart/payment/uc_linkpoint_api/xxxxxxxxxx.pem
Transaction mode: Production
Transaction Type: Sale

I noticed that Linkpoint also gave me a 6 digit user id that is the same as the last 6 digits in the 10 digit store number. Should I be using the 6 digits instead of the 10 digits for the Store Number field?

Also, I noticed that when I first extracted the module into the /home/account_name/public_html/modules/ubercart/payment/uc_linkpoint_api directory, there is an 000000.pem.txt file in there with the instructions: "Delete all text within this file, then copy and paste your key from Linkpoint API here. Do not leave any whitespaces or returns at the end of the file. Then rename this file to your store id, 6 digits, with .pem as the file extension."

However, when I download my PEM file from Linkpoint, the file is named xxxxxxxxxx.pem (10 digits) and it has a trailing line break on the end of the file.

I have tried using the 6 digit user id as my store number, switching to the xxxxxx.pem (6 digit version with no trailing line break and no white space), switched between production and test modes, and still receive the same errors that I listed above.

Has anyone ran into a similar problem, or know of anything to fix this problem? Thanks!

hvitebjorn's picture
Offline
Joined: 07/26/2008
Juice: 85
Various fixes

I did a few fixes for this module since I ran into a few issues:

- Added breakout of subtotal, tax, shipping and total cost so your customer doesn't get "shipping cost: 0, tax: 0"
- Added check for subtotal since payment will fail if subtotal <= zero. If this happens, reverts to using total only (no breakout of tax/shipping etc). Why would you ever have negative subtotal? We're using userpoints as payment and may have the situation that userpoints paid is less than total but more than subtotal.
- Fixed a few bugs related to the way the module formatted and sent credit card expiration date and security code.

UPDATE: sorry just saw there's a later update of this module which might already include these fixes... I was running 5.x-1.0-alpha6c

AttachmentSize
patch.txt 2.5 KB
roberto's picture
Offline
Joined: 08/20/2008
Juice: 10
Unable to process - no key/wrong pass phrase

I'm getting this error:

"unable to use client certificate (no key found or wrong pass phrase?)"

This is my first setup and after using test gateway, then switching to processing an order using a real credit card via the LinkPoint API, in production mode.

Could there be something wrong with my pem file?

Thanks,

Robert

roberto's picture
Offline
Joined: 08/20/2008
Juice: 10
Re: Unable to process - no key/wrong pass phrase

Ahh - must have been some issue with the path - I repasted it in and now it works fine.

Robert

sam353's picture
Offline
Joined: 08/12/2008
Juice: 48
kind of a bug

It turns out if that if the linkpoint terminal had been previously used and there are already orders in there that match the order id the transaction will be denied.

I'm not sure what the best solution is, but in my case, I simply appended some letters to the order id so there wouldn't be a conflict -- in other words, instead of sending the #3 as order id, it sends UC3

maui1's picture
Offline
Joined: 09/30/2008
Juice: 8
Which is most recent version of linkpoint api

I have been trying to debug my Drupal-Ubercart with linkpoint api and have finally got to the point where it seems to send the order but returns a "Credit Card Denied" error with different known good cards.

I am wondering if I have the most current version as the file attached to the top message seems to be dated from 2007 but after reading message 12 it seems to indicate a more current 2008 version.

Could anyone point me to the most recent version and help me with what might be causing the "Credit Card Denied" error I keep getting.

Out of frustration I have installed Zen Cart to test to see if I might be having a server issue, but after configuring Zen Cart I was able to pass an order to linkpoint and have the transaction show up on their side. So I am thinking the problem must be with either my Drupal-Ubercart configuration or the Linkpoint api. Anyone else working with Drupal-Ubercart and Linkpoint?

signalpoint's picture
Offline
Joined: 07/24/2008
Juice: 14
SGS-020003: Invalid XML

I was also having the same problems as rmarc71.

It turns out, the element inside the xml created by this module prints out the name of the product(s), which is "ok".

However, in some of my product names there is a "registered" ® symbol, and the "trademark" ™ symbol, which when printed into an xml file without being escaped properly causes the xml to be invalid. And hence the SGS-020003: Invalid XML error.

Hopefully this helps others. Thanks to rmarc71 for steering me in the right direction.

WisTex's picture
Offline
Joined: 11/14/2008
Juice: 2
PEM File should not be in public_html

The PEM file should not be accessible via the web (i.e. it should not be in your public_html folder). Ideally it should be uploaded to your root folder so Ubercart can get to it, but anonymous visitors to your website cannot.

A better location to upload it would be /home/domain/123456.pem instead.

HiFiGuy36's picture
Offline
Joined: 02/26/2009
Juice: 5
Plan for uc 2.x version

I was just wondering if there was a plan to update this module to be compatible with Drupal 6.x and Ubercart 2.x?

fossle's picture
Offline
Joined: 01/19/2009
Juice: 77
appending letters

How did you append the letters to the orders?

scorrales's picture
Offline
Joined: 02/19/2009
Juice: 29
Re: Plan for uc 2.x version

I created a version of the LinkPoint API for UC 2.x. You can find it here - http://www.ubercart.org/forum/development/9567/linkpoint_api_drupal_6xub...

All I did was modify the .info file and a few other minor edits - nothing significant. This is pretty much the exact same code base as the UC 1.x version.

I've done very minimal testing so be careful using on sites - especially live sites! I still haven't ran a live transaction through this.

focal55's picture
Offline
Joined: 05/07/2009
Juice: 11
My Comments on this module

Thank you very much for creating this module. I had a little trouble finding help on getting it to work, mostly because I am a noob. Here are some things to note for other noobs out there. Please note I dont warrant these tips are completely correct. It is just what worked for me and I humbly ask experts to correct anything I state incorrectly.

1. If your the developer and your client has YourPay - this module is for you. The LinkPoint links listed in the module directions above will work for you. In order to download the PEM file, you will need to know the exact first and last name your client used to sign up with the service. In my case, my clients name is Josh but he used Joshua to sign up.

2. You need SSL to pass information to LinkPoint. I understood that your need SSL for security, however I thought I could get away with fully testing with out SSL. The way the module is set up will actually partially test the credit card number when you go from the Billing Information page to the Review Order page. This was slightly misleading to me because it would pass the partial test however when I tried to complete the order I received an error. When I checked the Watchdog Error log, it said 'Payment failed: Credit card payment declined: Sorry - Could not connect to payment gateway'. This was due to my shared hosting provider (bluehost) not having port 1129 open for me. After buying the dedicated IP address I had to send in a request ticket to open up port 1129.

3. I also requested that my host give me SSH access so that I could better test that curL was actually getting to LinkPoint. Here is a cool command that I pieced together from web searches that you can enter into the command line:

curl -v -d "<order><orderoptions><ordertype>SALE</ordertype><result>GOOD</result></orderoptions><creditcard><cardnumber>4005550000000019</cardnumber><cardexpmonth>12</cardexpmonth><cardexpyear>12</cardexpyear><cvmindicator>provided</cvmindicator></creditcard><billing><name>Chad King</name><company></company><address1>6329 s paulina</address1><address2></address2><city>Chicago</city><state></state><zip>60636</zip><country>USA</country><phone>312-431-0251</phone><fax></fax></billing><shipping><state></state></shipping><transactiondetails><oid>e520402b948a7fc6bd403cd065ab132d</oid></transactiondetails><merchantinfo><configfile>XXXXXXXX</configfile><keyfile>/home/XXXXX/etc/linkpoint/XXXXXX.pem</keyfile><host>secure.linkpt.net</host><port>1129</port></merchantinfo><payment><chargetotal>34.35</chargetotal></payment></order>" -E <path to your .pem file> -k https://secure.linkpt.net:1129/LSGSXML

Replace [path to your .pem file] with the full location of your PEM file. Notice that between the [cardnumber] tag I am using a fake credit card number LinkPoint offers for testing. You can find more of these test credit card numbers in the PDF at http://www.firstdata.com/support/manuals_and_guides/pdf/global_gateway/n....

4. After using the above command I would get an error that I couldn't connect to the payment gateway until I got the SSL set up on my server. After SSL was set up I got another error. It said the following:

* About to connect() to secure.linkpt.net port 1129 (#0)
* Trying 208.72.248.102... connected
* Connected to secure.linkpt.net (208.72.248.102) port 1129 (#0)
* SSL: couldn't set callback!
* unable to use client certificate (no key found or wrong pass phrase?)
* Closing connection #0

After lots of whining and banging my head against the wall I re-read the thread on this page and notice I missed comment #18. WiseTex mention that you shouldn't put the PEM is the web accessible public_html directory. You should place the folder somewhere above the public_html directory. After doing that and revising the PEM location in the command line code everything worked!

Thanks again for this module!

maui1's picture
Offline
Joined: 09/30/2008
Juice: 8
REPLY to comment #11 Sounds like the problem I am having

Hope you have found a solution. I installed Ubercart about a year ago and it seemed to be working fine with the Linkpoint gateway, After checking it recently I am confronted with the very same problem you reported here. I haven't upgraded Ubercart or changed the Linkpoint settings since first installing, perhaps the Linkpoint Gateway settings need changing.

jrust's picture
Offline
Joined: 12/19/2007
Juice: 122
What about Declined Transactions

Great module, but I'm having trouble with declined transactions. Thought I'd cross-post this here in case anyone has developed a solution. The problem is that if someone's card is declined that order ID is now in Linkpoint's system and can't be used again. So, if the user were to click to click the Back button and change their CC# it would still not be able to process the order because it would detect a duplicate Order ID. So, my question is how would I reset the order ID after a declined transaction? Can I just increment it to the next available ID in uc_orders or is it also a session variable?

jrust's picture
Offline
Joined: 12/19/2007
Juice: 122
Re: What about Declined Transactions

Just a heads up that I solved the declined transaction problem mentioned above and posted the 6.x version as a module on d.o. at http://drupal.org/project/uc_linkpoint_api

le
le's picture
Offline
Joined: 07/05/2009
Juice: 11
Need help debugging / silently failing

Hi - I'm having the same issue as someone else in this thread. I've got this module installed and got the PEM file, and it gives me a "success, your order is complete!" message after I check out, but the information isn't going into my First Data / Linkpoint transaction log. I can't debug curl from the command line (as suggested in other posts) due to SSH restrictions on the machine I'm working on, and there's no errors in my php error log. Does anyone have any ideas how I can debug this? Is there some debugging code I can add to the module itself? Any help would be GREATLY appreciated.

mcaden@drupal.org's picture
Offline
Joined: 07/11/2009
Juice: 2
recurring

any idea on support for recurring billing?

I see nothing in any of the drupal controls for linkpoint allowing recurring subscriptions and nothing in the uc_recurring module allowing linkpoint.

avior@drupal.org's picture
Offline
Joined: 08/30/2008
Juice: 7
what is the status of this

I will be glade to hear what is the status of this ?
I this stable & working ?

does firstdata.com using this module as a payment gateway ?

Thanks
Avior

NewEditionFanClub's picture
Offline
Joined: 09/20/2009
Juice: 2
Recurring?

I need recurring billing/subscription billing. Is it available with this?

Francois's picture
Offline
Joined: 08/19/2008
Juice: 390
Linkpoint = First Data Global Gateway

If you're wanting to add the First Data Global Gateway, this is the module you should use. There is also a version of UC2x at the Drupal site. http://drupal.org/project/uc_linkpoint_api

--------
'Twas the end of the world, and you didn't even know it.

awolfey's picture
Offline
Joined: 07/13/2009
Juice: 10
Thanks for this useful test RE: #22

Reply to http://www.ubercart.org/contrib/903#comment-38381

I want to add a couple of comments for others and for my own future reference.

Here: <path to your .pem file> you don't need the < and >, just the path/to/your/pemfile.pem

Here: <configfile>XXXXXXXX</configfile> you don't need to replace the XXX's for this test.

Here: <keyfile>/home/XXXXX/etc/linkpoint/XXXXXX.pem</keyfile > you DO need to replace the XXX's with your path and filename.

I continued to get this error after moving a site to a new server: curl: (58) unable to use client certificate (no key found or wrong pass phrase?)

It turned out the pem file had changed somehow during the transfer, and getting the pem again from First Data and pasting directly into the file in the command line editor fixed the problem.

quartarian's picture
Offline
Joined: 11/12/2009
Juice: 4
We were unable to process your credit card payment.

First off, Id like to thank everyone for their work on this module.

I'm having an issue though getting it to work. My host is positive that port 1129 is not blocked and Ive verified the path to the PEM file a million times. Ive also had the host install an SSL certificate. When I try to process a card using either my production account or live account I get the default error:

"We were unable to process your credit card payment. Please verify your card details and try again. If the problem persists, contact us to complete your order."

Under recent log entries in drupal, I see a error of type "uc_linkpoint_api" with no message attached every time I try to process an order. Also, simultaneously during every order I get an error of type "uc_payment" with the message "Payment failed for order 8: Credit card payment declined: Sorry - Could not connect to payment gateway." Do you think my host is lying to me about port 1129? Is there anyway I can prove it if so? Thanks for the help!!

Edit:
Im using drupal 6.14, UC 2, and UC linkpoint API 6.x-1.2.

quartarian's picture
Offline
Joined: 11/12/2009
Juice: 4
Setting for Windows hosts

OK guys, after giving up and getting some sleep I found my problem! If you running on a windows server you need to make the path to the PEM file look something like this:
c:\\xammp\\keys\\xxxxxxxxxx.pem (notice the double slashes)

Also, I had to uncomment two lines in the module code:
curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0); //Comment out these two lines before actual use
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0); //And this one.
According to the Magento plugin I found here, this is necessary for some people.

To debug the problem, I created a curltest.php file on my server with the following code (Notice the hard coded url):

<?php
$StoreID
= "xxxxxxxxxx";
$PEMfilePath = "c:\\xammp\\keys\\xxxxxxxxxx.pem";
$xml = "<order>
    <billing>
        <userid>1</userid>
        <name>John Doe</name>
        <company></company>
        <address1>938 New Garden</address1>
        <address2></address2>
        <addrnum>938 New Garden</addrnum>
        <city>New York</city>
        <state>NY</state>
        <zip>10001</zip>
        <country>US</country>
        <phone></phone>
        <email>generic@email.com</email>
    </billing>
    <shipping>
        <name>John Doe</name>
        <address1>938 New Garden</address1>
        <address2></address2>
        <city>New York</city>
        <state>NY</state>
        <zip>10001</zip>
        <country>US</country>
    </shipping>
    <orderoptions>
        <result>GOOD</result>
        <ordertype>PREAUTH</ordertype>
    </orderoptions>
    <merchantinfo>
        <configfile>"
.$StoreID."</configfile>
        <keyfile>"
.$PEMfilePath."</keyfile>
    </merchantinfo>
    <creditcard>
        <cardnumber>4111111111111111</cardnumber>
        <cardexpmonth>1</cardexpmonth>
        <cardexpyear>12</cardexpyear>
        <cvmvalue>111</cvmvalue>
        <cvmindicator></cvmindicator>
    </creditcard>
    <payment>
        <chargetotal>122.2</chargetotal>
    </payment>
    <transactiondetails>
        <transactionorigin>ECI</transactionorigin>
        <oid>3-13</oid>
        <invoice_number>3</invoice_number>
        <ip>127.0.0.1</ip>
    </transactiondetails>
    <notes>
        <comments>Pet Rock x4</comments>
    </notes>
</order>"
;
$xml = str_replace("&", "and", $xml);
$xml = str_replace("'", " ", $xml);

/*******************************************************************************
  * Start CURL Session
  ******************************************************************************/
 
$ch = curl_init();
 
$url = "https://staging.linkpt.net:1129";
 
curl_setopt($ch, CURLOPT_URL, $url);
 
curl_setopt($ch, CURLOPT_VERBOSE, 1);
 
curl_setopt($ch, CURLOPT_POST, 1);
 
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
 
curl_setopt($ch, CURLOPT_SSLCERT, $PEMfilePath);
 
curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0); //Comment out these two lines before actual use
 
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0); //And this one.
 
$buffer = curl_exec($ch);

  if (

$error = curl_error($ch)) {
    echo
$error;
  }
 
curl_close($ch);

    echo

$buffer;
?>

This is similar to what focal55 did but in a shared hosting friendly way. I hope this helps someone!

kensystem's picture
Offline
Joined: 01/20/2010
Juice: 2
Anethre fix if you have zero shipping

I had zero shipping and the XML send to the gateway has 'f' for the shipping value (I know this form the log file) when it should be zero ('f' presuably is first char of "free", and I had a "free" shipping item that triggered this error). Had to modify the line in class.linkpoint_api.php from
$xml .= "" . $pdata["shipping"] . ""

to:
$xml .= "" . ($pdata["shipping"]=='f'?'0':$pdata["shipping"]) . ""

Note this should also work for zencart and oscommerce...

Huzoor Bux's picture
Offline
Joined: 03/29/2010
Juice: 3
Need help for CodeIgniter

I am using php CodeIgniter framework and i need a your service as wsdl not in php because CodeIgniter will not accept any .php extenssions in the code please help is there any solution that how can i implement this in my site.

Reards,

duckx's picture
Offline
Cool profile pic award.
Joined: 02/27/2008
Juice: 300
Re: Linkpoint API Payment Module

im on Drupal 5 and im having problems wehre it just times out when i click on the submit order (last page). i just get a time out error and i also tried the curl command in ssh and it throws:

* About to connect() to secure.linkpt.net port 1129
* Trying 208.72.248.102... Connection timed out
* couldn't connect to host
* Closing connection #0
curl: (7) couldn't connect to host

Is this module outdated for D5? anyone have an updated one?

Francois's picture
Offline
Joined: 08/19/2008
Juice: 390
I don't think so.

I'm using this module on a Drupal 5 site and it seems to work fine. Maybe the problem is somewhere else?

--------
'Twas the end of the world, and you didn't even know it.

jtnatoli's picture
Offline
Joined: 08/15/2010
Juice: 12
Re: Re: Linkpoint API Payment Module

Hey if you ever got this fixed I would LOVE to know how. Thanks.

le
le's picture
Offline
Joined: 07/05/2009
Juice: 11
Which problem?

This thread involves lots of problems! I managed to get this module working after customizing it a bit for the Drupal 5 site I was working with. Let us know exactly what problems you're running into and maybe we can help.

mpinch's picture
Offline
Joined: 03/14/2010
Juice: 6
Tax Question

Hello - Many thanks for this module. I have run into only one problem with it, and I can't seem to find the answer anywhere. Thought perhaps you could help.

Using the newest version of linkpoint api module on drupal 6. It is currently passing nothing in the tax field, which makes sense as the module has these lines of code:

$shipping = $tax = $subtotal = 0;
.
.
.
.
if (!empty($tax)) $xml .="" . $tax . "";

My bottom line is I need to be able to get the tax data into firstdata - how can I modify this so it starts happening?

Thanks!
Mike

Francois's picture
Offline
Joined: 08/19/2008
Juice: 390
Duplicate in D5 Version

Hi JRust,

I've had a look at the difference between the D5 and D6 version and found the following code fixes this problem:

function uc_linkpoint_api_charge($order_id, $amount, $data) {
  global $user, $response;
  if (!function_exists('curl_init')) {
    drupal_set_message(t('The Linkpint API service requires curl.  Please talk to your system administrator to get this configured.'));
    return array('success' => FALSE);
  }

  // This handles the case where a user cancels their order on the checkout screen
  if ($_SESSION['uc_linkpoint_order'] != $order_id) {
    $_SESSION['uc_linkpoint_order'] = $order_id;
    unset($_SESSION['uc_linkpoint_attempt']);
  }
  // If users attempts to submit order more than once then modify Order ID so
  // as to avoid a duplicate transaction error.
  $_SESSION['uc_linkpoint_attempt'] = empty($_SESSION['uc_linkpoint_attempt']) ? 1 : ($_SESSION['uc_linkpoint_attempt'] + 1);
  $oid = $_SESSION['uc_linkpoint_attempt'] > 1 ? "$order_id-{$_SESSION['uc_linkpoint_attempt']}" : $order_id;
  $order = uc_order_load($order_id);
  $shipping = $tax = $subtotal = 0;
  $description = '';
  if (is_array($order->products)) {
    foreach ($order->products as $product) {
      if (!empty($description)) {
        $description .= ' // ';
      }
      $description .= $product->title .' x'. $product->qty;
      if ($product->data['attributes']) {
        foreach ($product->data['attributes'] as $key => $value) {
          $description .= ', '. $key .': '. $value;
        }
      }
    }
  }
  $description = substr($description, 0, 255);

However, when I move this over to the D5 version I still get the same error. I assume the problem lies in the the difference between D5 and D6 code. Is this code D6 specific?

Cheers
Francois.

--------
'Twas the end of the world, and you didn't even know it.

jrust's picture
Offline
Joined: 12/19/2007
Juice: 122
Re: Linkpoint API Payment Module

Yup, that's definitely the relevant section of code -- modifying the order ID if it comes through more than once. That should definitely do it if you move it over to the D5 version, but you may need to debug to make sure the function is being called and that order id is getting changed

Francois's picture
Offline
Joined: 08/19/2008
Juice: 390
Re: Linkpoint API Payment Module

Thanks, that's great. Off to work...

--------
'Twas the end of the world, and you didn't even know it.

bkosborne's picture
Offline
Joined: 04/28/2010
Juice: 184
Re: Re: Linkpoint API Payment Module

Is anybody interesting in improving this module with me? I'm going to try and add support for recurring payments and just integrate it a bit better into ubercart.

Francois's picture
Offline
Joined: 08/19/2008
Juice: 390
BOUNTY!!!

Bounty! I am fairly desperate to get this working in the Drupal 5.

We're getting a lot of complaints from Customers who make mistakes in inputting CC data and then having their transaction denied (duplicate transaction).

Jrust was able to fix this in the D6 version but I'm just not proficient enough in PHP to port the changes to the Drupal 5 module.

Is anyone out there willing to do this for a price?

Cheers
Francois.

--------
'Twas the end of the world, and you didn't even know it.

PatW's picture
Offline
Joined: 03/31/2009
Juice: 141
uc_linkpoint_api Auhtorize and capture, not being captured

This appears to be a great module, but I can't get it to work properly. I've been using Authorize.net for credit card processing for the past 16 months, but am in the process of changing it over to First Data using uc_linkpoint_api 6.x-1.5, D 6.19, UC 6.x-2.4. I'm in Production Mode on the Live Server using my personal credit card. AVS checking is working fine, but I couldn't get CVV checking to work properly, so have now disabled it. My immediate problem is that I have it set to Authorize and capture, but the payment is not being captured.
The Order View tab shows the following comments:

11/17/2010
12:20:36 PM pmw Credit card processed successfully for $6.81. Approval code: APPROVED YYYX 0319320751722016:YYYX:. CVV response: X. AVS response: YY
11/17/2010
12:20:38 PM - Order created through website.

Order status: Payment received

The Linkpoint terminal shows Type "Auth", but the only way we're able to get it to capture the funds right now is to do a Ticket only on the Linkpoint terminal. Is there some admin setting on the Linkpoint (First Data) side that needs to be changed to get it to capture the funds automatically (I looked, but couldn't find any)? My client and I are both getting really frustrated, so any troubleshooting ideas will be greatly appreciated.
Thanks!

bkosborne's picture
Offline
Joined: 04/28/2010
Juice: 184
patW, Yes, there should be an

patW,

Yes, there should be an option to change it from PREAUTH to SALE in the settings for the module. It's confusing because this should have been tied into the Credit Card modules build in handling of different transactions, but it was not. I have rewritten the majority of this module, but the maintainer has not gotten back to me on co-maintainership. I've attached my version of it below. I have this version running on two production sites.

- Brian

AttachmentSize
uc_linkpoint_api.zip 13.97 KB
PatW's picture
Offline
Joined: 03/31/2009
Juice: 141
Brian, Thank you so much for

Brian,

Thank you so much for your quick response. I feel a bit silly now after re-reading the information below the Transaction Type options. It clearly states what the PREAUTH and SALE options do, but it seems redundant to have them after previously selecting Authorize and capture immediately as the Default credit transaction type. Confusing indeed. I have now changed it to SALE on my live site and it authorized & captured the funds Smiling I'll install your version on my test site to check it out - thanks again!

Pat

sco_tt's picture
Offline
Joined: 11/10/2010
Juice: 13
Re: Brian, Thank you so much for

I've been having a similar problem, getting error messages when that read:
Credit card declined for $10.76 with error: CVV verification failed because the code was "X"

Looking at this thread, I changed the Linkpoint API's "Transaction Type" from PREAUTH to SALE, but I'm still getting the same messages. I have "validate the credit card number at checkout" and "attempt to process credit cards at checkout" ticked on the Credit Card Page. I know the info is making its way over to Linkpoint, with Order logs similiar to PatW. Am I missing something else?

bkosborne's picture
Offline
Joined: 04/28/2010
Juice: 184
Re: Re: Brian, Thank you so much for

Anyone still having issues here should update to the latest release... lots of improvements there....