Can anyone using LinkPoint succesfully please help me out? I'm testing VM without an SSL certificate for now to see if it can process credit cards using LinkPoint. I downloaded the 'lphp.php' file from LinkPoint (http://www.linkpoint.com/viewcart/down_index.htm) and installed it in the /administrator/components/com_virtuemart/classes/payment/ dir next to ps_linkpoint.php. Then I got my pem file from linkpoint (https://www.linkpointcentral.com/) and uploaded it per:
http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=13808.0
I maunually added the payment method and Fixed the bug in Task# 520 for line 197 file in /classes/payment/ps_linkpoint.php as instructed:
http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=15194.0
Now trying to test a credit card order using the 4111111111111111 test number and get the following ERROR:
Notice: Unknown column 'id' in 'where clause' in /VirtueMart/includes/database.php on line 282
/VirtueMart/includes/database.php:473
/VirtueMart/administrator/components/com_virtuemart/classes/ps_database.php:98
/VirtueMart/administrator/components/com_virtuemart/classes/payment/ps_linkpoint.php:197
/VirtueMart/administrator/components/com_virtuemart/classes/ps_checkout.php:792
/VirtueMart/administrator/components/com_virtuemart/classes/ps_checkout.php:491
/VirtueMart/components/com_virtuemart/virtuemart_parser.php(244) : eval()'d code:1
/VirtueMart/components/com_virtuemart/virtuemart_parser.php:244
/VirtueMart/components/com_virtuemart/virtuemart.php:29
/VirtueMart/index.php:212
Error: <
Error: Failure in Processing the Payment (ps_linkpoint)
Did I miss something or do something wrong? ???
Can anyone using LinkPoint succesfully please help me out here? Thanks.
Hello,
just change line 197 in the file /classes/payment/ps_linkpoint.php
FROM
$qt = "SELECT * FROM `#__{vm}_userinfo` WHERE id='".$auth["user_id"]."' AND address_type='BT'";
TO
$qt = "SELECT * FROM `#__{vm}_user_info` WHERE user_id='".$auth["user_id"]."' AND address_type='BT'";
this should at least fix the query error.
ciao, Soeren
Many Thanks Soeren!
I changed line 197 in the file /classes/payment/ps_linkpoint.php as instructed and it did fix the query error. Unfortunately I'm still getting this:
Error: <
Error: Failure in Processing the Payment (ps_linkpoint)
I am NOT the author of this code.
Please see the file header:
/**
* The ps_linkpoint class, containing the payment processing code
* for transactions with linkpoint.net or yourpay.com
* contains code for Recurring billing an/or PreAuth Options
*
* Installation: You must have the linkpoint/yourpay.com API file (lphp.php) in the
* current working directory, or your php includes directory.
* you also should have your public key file provided by linkpoint/yourpay.com secured
* in a directory outside of the webroot, but readable by the webserver daemon owner (ie; nobody)
*
* In the administrator console of VirtueMart -> Payment Method List -> Creditcard LP -> Configuration
* you can insert your store number, and public key location.
*
* Any questions, email jimmy@freshstation.org
* @copyright (C) 2005 James McMillan
*/
Maybe you should contact the author...
ciao, Soeren
Thank you for all your help and suggestions Soeren.
I emailed James McMillan, the author of the ps_linkpoint.php code and he kindly replied with the FIX! So now it works as advertised ;D
On line 280 (or so) of ps_linkpoint.php please change the following:
if ($result["r_approved"] != "SUBMITTED")
TO
if ($result["r_approved"] != "APPROVED")
Quote from: FireIslandMan on March 22, 2006, 04:48:31 AM
Thank you for all your help and suggestions Soeren.
I emailed James McMillan, the author of the ps_linkpoint.php code and he kindly replied with the FIX! So now it works as advertised ;D
On line 280 (or so) of ps_linkpoint.php please change the following:
if ($result["r_approved"] != "SUBMITTED")
TO
if ($result["r_approved"] != "APPROVED")
Hi,
I worked according to the instructions in these posts but still I am getting error. Can you please let me how you managed to integrate Linkpoint with your application?
Regards,
Fenil
What version of VM using and what does your error message say?
Hi,
Thanx for the reply. I am using VM 1.0.4. When I click on confirm order button I get error message like
Error: <
Error: Failure in Processing the Payment (ps_linkpoint)
Regards,
Fenil
First make sure that in Payment Method List --> Credit Card --> General you have:
Active?: Check
Payment Method Name: Credit Card
Code: LP
Payment class name: ps_linkpoint
Payment method type: Use Payment Processor
Accepted Credit Card Types: Visa, MC, etc.
Then in Configuration try:
Linkpoint Store ID: ###### (your store id #)
Location Of Public Keyfile: /etc/linkpoint/mykey#.pem (the full path of your LinkPoint Keyfile)
Request/Capture Credit Card Code Value: YES
Recurring Billings? NO
Pre Auth for Recurring Billing? NO
Payment Extra Info: EMPTY (no form code needed)
What do you get when you try with these settings?
Hi,
Thnx again for your reply. Is it compulsory to have a SSL certificate to work with Linkpoint?
Regards,
Fenil
I don't know if it is compulsory to have a SSL certificate to work with Linkpoint, but it is strongly recommended if you want to guarantee your customers that credit card orders between your browser and site's web servers are private and secure. So did you get it working yet?
No actually I am waiting for my client's reply about SSL. Can it work locally? Do we need to put form code in the payment configuration area or data are automatically read by linkpoint?
No it isn't working yet. I have created a test account in Linkpoint and I have worked as below
My Linkpoint store name: 1909827377
I have kept lphp.php file in payment dir.
I have kept my test account pem file at this location 'D:\Fenil_All\joomla\addons\1909827377.pem' and provide this location in configuration file.
My form code is as below:
Quote
<?php
$url = "https://www.staging.linkpointcentral.com/lpc/servlet/lppay";
$tax_total = $db->f("order_tax") + $db->f("order_shipping_tax");
$discount_total = $db->f("coupon_discount") + $db->f("order_discount");
$post_variables = Array(
"mode" => "fullpay",
"charge" => round( $db->f("order_subtotal")+$tax_total-$discount_total, 2),
"storename" => "1909827377"
);
if( $page == "checkout.thankyou" ) {
$query_string = "?";
foreach( $post_variables as $name => $value ) {
$query_string .= $name. "=" . urlencode($value) ."&";
}
mosRedirect( $url . $query_string );
} else {
echo '<form action="'.$url.'" method="post" target="_blank">';
echo '<input type="submit" value="Continue to secure payment form">';
foreach( $post_variables as $name => $value ) {
echo '<input type="hidden" name="'.$name.'" value="'.$value.'" />';
}
echo '</form>';
}
?>
Do let me know where I am wrong over here.
Do I need to make any settings in my Linkpoint account?
Please refer to the above posts again (I updated some steps). Don't know if it can work locally. Don't have to put form code in the payment configuration area, data is automatically read by Linkpoint. And please delete your Linkpoint store id from your post! Good night, and good luck...
Thnx for your concern. This is my test account ID so its ok. But still I am getting the same error. I tried with all the options. ??? :-[ :'(
The ps_linkpoint.php included in VM 1.0.4. doesn't work for me so try the attached modified version that does. It was uploaded in txt so make sure to change it to php.
[attachment cleanup by admin]
I have been following the suggestions posted to the T and I have been still getting the usual error.
Error: <
Error: Failure in Processing the Payment (ps_linkpoint)
I was wondering if you had to do anythng specific on the linkpoint connect site. I am having a hard time tracking the source of the error.
Thanks....
No. Take a break and then recheck everything...
:(
Error: <
Error: Failure in Processing the Payment (ps_linkpoint)
I have been working on trying to track this error and cant seem to figure out what is causing it. All of the code in the iphp.php and the ps_linkpoint.php file is correct as per the forum. Any advise would be greatly appreciated.
Thanks...
Hi Geo:
I'm working on this right now myself, and was able to send a test transaction last night (by setting the "result" field to "GOOD", you can send a test transaction to the live server. Do this inside of ps_linkpoint.php, by adding $myorder["result"] = "GOOD" somewhere around line 312, before the "if (LP_RECURRING...)" statement.) I haven't yet sent a real transaction across.
Anyway, some things to look at:
1. In your post, you mention "iphp.php" - with an i. Make sure you've got the name correct: lphp.php (that's the letter 'l' is in love.) When I downloaded this module, I made the mistake of naming it "lpphp.php" at first - which of course caused problems. Also, I'm using the version of lphp.php posted by 'Atlanticom' on July 25, 2006 in this thread: http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=19011.msg49407#msg49407
I'm also using his version of ps_linkpoint.php, also posted in that same thread.
2. Be sure and look at your server log files. In my case, I have a root-access virtual host, and can directly browse the server logs. For me, the error_ssl_log file had error messages that let me know I had misspelled the "lphp.php" module.
3. Be sure your "pem" file (which you downloaded from LinkPoint Central, right?) is located in a path that is accessible from PHP. In particular, there is a PHP configuration item called "open_basedir" which limits the directory paths that PHP can access. When I was looking through the LinkPoint documentation, all that was mentioned is that the pem file needed to be placed in a directory accessible by the web server userid (typically 'nobody'). That's not the whole story. It specifically also has to be accessible from PHP, and the PHP "open_basedir" directive will thereby affect where you can put the pem file.
Anyway, hope this helps!
Mike Mills
Mike,
Thank you for your reply and suggestions. I switched over to alanticom's code and also added the additional curl information that was listed in another thread since I am using godaddy for my hosting. The code was provided by godaddy and worked with another project using authorize.net. I had to contact godaddy to find out what access is available on the server. I only can get to the public folder.
Thanks
<?php
/* lphp.php LINKPOINT PHP MODULE */
/* A php interlocutor CLASS for
LinkPoint: LINKPOINT LSGS API using
libcurl, liblphp.so and liblpssl.so
v3.0.005 20 Aug. 2003 smoffet */
/* modified by atlanticom for ps_linkpoint/virtuemart compatibility */
# Copyright 2003 LinkPoint International, Inc. All Rights Reserved.
#
# This software is the proprietary information of LinkPoint International, Inc.
# Use is subject to license terms.
### YOU REALLY DO NOT NEED TO EDIT THIS FILE! ###
class lphp
{
var $debugging;
###########################################
#
# F U N C T I O N p r o c e s s ( )
#
# process a hash table or XML string
# using LIBLPHP.SO and LIBLPSSL.SO
#
###########################################
function process($data)
{
$using_xml = 0;
$webspace = 1;
if (isset($data["webspace"]))
{
if ($data["webspace"] == "false") // if explicitly set to false, don't use html output
$webspace = 0;
}
if ( isset($data["debugging"]) || isset($data["debug"]) )
{
if ($data["debugging"] == "true" || $data["debug"] == "true" )
{
$this->debugging = 1;
# print out incoming hash
if ($webspace) // use html-friendly output
{
echo "at process, incoming data: <br>";
while (list($key, $value) = each($data))
echo htmlspecialchars($key) . " = " . htmlspecialchars($value) . "<BR>\n";
}
else // don't use html output
{
echo "at process, incoming data: \n";
while (list($key, $value) = each($data))
echo "$key = $value\n";
}
reset($data);
}
}
if (isset($data["xml"])) // if XML string is passed in, we'll use it
{
$using_xml = 1;
$xml = $data["xml"];
}
else
{
// otherwise convert incoming hash to XML string
$xml = $this->buildXML($data);
}
// then set up transaction variables
$key = $data["keyfile"];
$host = $data["host"];
$port = $data[port];
# FOR PERFORMANCE, Use the 'extensions' statement in your php.ini to load
# this library at PHP startup, then comment out the next seven lines
// load library
if (!extension_loaded('liblphp'))
{
if (!dl('liblphp.so'))
{
exit("cannot load liblphp.so, bye\n");
}
}
if ($this->debugging)
{
if ($webspace)
echo "<br>sending xml string:<br>" . htmlspecialchars($xml) . "<br><br>";
else
echo "\nsending xml string:\n$xml\n\n";
}
// send transaction to LSGS
$retstg = send_stg($xml, $key, $host, $port);
if (strlen($retstg) < 4)
exit ("cannot connect to lsgs, exiting");
if ($this->debugging)
{
if ($this->webspace) // we're web space
echo "<br>server responds:<br>" . htmlspecialchars($retstg) . "<br><br>";
else // not html output
echo "\nserver responds:\n $retstg\n\n";
}
if ($using_xml != 1)
{
// convert xml response back to hash
$retarr = $this->decodeXML($retstg);
// and send it back to caller
return ($retarr);
}
else
{
// send server response back
return $retstg;
}
}
#####################################################
#
# F U N C T I O N c u r l _ p r o c e s s ( )
#
# process hash table or xml string table using
# curl, either with PHP built-in curl methods
# or binary executable curl
#
#####################################################
function curl_process($data)
{
$using_xml = 0;
$webspace = 1;
if (isset($data["webspace"]))
{
if ($data["webspace"] == "false") // if explicitly set to false, don't use html output
$webspace = 0;
}
if (isset($data["debugging"]) || isset($data["debug"]) )
{
if ($data["debugging"] == "true" || $data["debug"] == "true" )
{
$this->debugging = 1;
# print out incoming hash
if ($webspace) // use html-friendly output
{
echo "at curl_process, incoming data: <br>";
while (list($key, $value) = each($data))
echo htmlspecialchars($key) . " = " . htmlspecialchars($value) . "<BR>\n";
}
else // don't use html output
{
echo "at curl_process, incoming data: \n";
while (list($key, $value) = each($data))
echo "$key = $value\n";
}
reset($data);
}
}
if (isset($data["xml"])) // if XML string is passed in, we'll use it
{
$using_xml = 1;
$xml = $data["xml"];
}
else
{
// otherwise convert incoming hash to XML string
$xml = $this->buildXML($data);
}
if ($this->debugging)
{
if ($webspace)
echo "<br>sending xml string:<br>" . htmlspecialchars($xml) . "<br><br>";
else
echo "\nsending xml string:\n$xml\n\n";
}
// set up transaction variables
$key = $data["keyfile"];
$port = $data["port"];
$host = "https://".$data["host"].":".$port."/LSGSXML";
if (isset($data["cbin"])) //using BINARY curl methods
{
if ($data["cbin"] == "true")
{
if (isset($data["cpath"]))
$cpath = $data["cpath"];
else // curl path has not been set, try to find curl binary
{
if (getenv("OS") == "Windows_NT")
$cpath = "c:\\curl\\curl.exe";
else
$cpath = "/usr/bin/curl";
}
// look for $cargs variable, otherwise use default curl arguments
if (isset($data["cargs"]))
$args = $data["cargs"];
else
$args = "-m 300 -s -S"; // default curl args; 5 min. timeout
# TRANSACT #
if (getenv("OS") == "Windows_NT")
{
if ($this->debugging)
$result = exec ("$cpath -v -d \"$xml\" -E $key -k $host", $retarr, $retnum);
else
$result = exec ("$cpath -d \"$xml\" -E $key -k $host", $retarr, $retnum);
}
else //*nix string
{
if ($this->debugging)
$result = exec ("'$cpath' $args -v -E '$key' -d '$xml' '$host'", $retarr, $retnum);
else
$result = exec ("'$cpath' $args -E '$key' -d '$xml' '$host'", $retarr, $retnum);
}
# EVALUATE RESPONSE #
if (strlen($result) < 2) // no response
{
$result = "<r_approved>FAILURE</r_approved><r_error>Could not connect.</r_error>";
$retarr = $this->decodeXML($result);
return $retarr;
}
if ($this->debugging)
{
if ($this->webspace)
echo "<br>server responds:<br>" . htmlspecialchars($result) . "<br><br>";
else // non html output
echo "\nserver responds:\n $result\n\n";
}
if ($using_xml == 1)
{
// return xml string straight from server
return ($result);
}
else
{
// convert xml response back to hash
$retarr = $this->decodeXML($result);
// and send it back to caller. Done.
return ($retarr);
}
}
}
else // using BUILT-IN PHP curl methods
{
$ch = curl_init ();
curl_setopt ($ch, CURLOPT_HTTPPROXYTUNNEL, TRUE);
curl_setopt ($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
curl_setopt ($ch, CURLOPT_PROXY, "http://64.202.165.130:3128");
curl_setopt ($ch, CURLOPT_URL,$host);
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $xml);
curl_setopt ($ch, CURLOPT_SSLCERT, $key);
//curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);
//curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
if ($this->debugging)
curl_setopt ($ch, CURLOPT_VERBOSE, 1);
# use curl to send the xml SSL string
$result = curl_exec ($ch);
curl_close($ch);
if (strlen($result) < 2) # no response
{
$result = "<r_approved>FAILURE</r_approved><r_error>Could not connect.</r_error>";
$retarr = $this->decodeXML($result);
return $retarr;
}
if ($this->debugging)
{
if ($webspace) // html-friendly output
echo "<br>server responds:<br>" . htmlspecialchars($result) . "<br><br>";
else
echo "\nserver responds:\n $result\n\n";
}
if ($using_xml)
{
# send xml response back
return $result;
}
else
{
#convert xml response to hash
$retarr = $this->decodeXML($result);
# and send it back
return ($retarr);
}
}
}
#############################################
#
# F U N C T I O N d e c o d e X M L ( )
#
# converts the LSGS response xml string
# to a hash of name-value pairs
#
#############################################
function decodeXML($xmlstg)
{
preg_match_all ("/<(.*?)>(.*?)\</", $xmlstg, $out, PREG_SET_ORDER);
$n = 0;
while (isset($out[$n]))
{
$retarr[$out[$n][1]] = strip_tags($out[$n][0]);
$n++;
}
return $retarr;
}
############################################
#
# F U N C T I O N b u i l d X M L ( )
#
# converts a hash of name-value pairs
# to the correct XML format for LSGS
#
############################################
function buildXML($pdata)
{
// while (list($key, $value) = each($pdata))
// echo htmlspecialchars($key) . " = " . htmlspecialchars($value) . "<br>\n";
### ORDEROPTIONS NODE ###
$xml = "<order><orderoptions>";
if (isset($pdata["ordertype"]))
$xml .= "<ordertype>" . $pdata["ordertype"] . "</ordertype>";
if (isset($pdata["result"]))
$xml .= "<result>" . $pdata["result"] . "</result>";
$xml .= "</orderoptions>";
### CREDITCARD NODE ###
$xml .= "<creditcard>";
if (isset($pdata["cardnumber"]))
$xml .= "<cardnumber>" . $pdata["cardnumber"] . "</cardnumber>";
if (isset($pdata["cardexpmonth"]))
$xml .= "<cardexpmonth>" . $pdata["cardexpmonth"] . "</cardexpmonth>";
if (isset($pdata["cardexpyear"]))
$xml .= "<cardexpyear>" . $pdata["cardexpyear"] . "</cardexpyear>";
if (isset($pdata["cvmvalue"]))
$xml .= "<cvmvalue>" . $pdata["cvmvalue"] . "</cvmvalue>";
if (isset($pdata["cvmindicator"]))
$xml .= "<cvmindicator>" . $pdata["cvmindicator"] . "</cvmindicator>";
if (isset($pdata["track"]))
$xml .= "<track>" . $pdata["track"] . "</track>";
$xml .= "</creditcard>";
### BILLING NODE ###
$xml .= "<billing>";
if (isset($pdata["name"]))
$xml .= "<name>" . $pdata["name"] . "</name>";
if (isset($pdata["company"]))
$xml .= "<company>" . $pdata["company"] . "</company>";
if (isset($pdata["address1"]))
$xml .= "<address1>" . $pdata["address1"] . "</address1>";
elseif (isset($pdata["address"]))
$xml .= "<address1>" . $pdata["address"] . "</address1>";
if (isset($pdata["address2"]))
$xml .= "<address2>" . $pdata["address2"] . "</address2>";
if (isset($pdata["city"]))
$xml .= "<city>" . $pdata["city"] . "</city>";
if (isset($pdata["state"]))
$xml .= "<state>" . $pdata["state"] . "</state>";
if (isset($pdata["zip"]))
$xml .= "<zip>" . $pdata["zip"] . "</zip>";
if (isset($pdata["country"]))
$xml .= "<country>" . $pdata["country"] . "</country>";
if (isset($pdata["userid"]))
$xml .= "<userid>" . $pdata["userid"] . "</userid>";
if (isset($pdata["email"]))
$xml .= "<email>" . $pdata["email"] . "</email>";
if (isset($pdata["phone"]))
$xml .= "<phone>" . $pdata["phone"] . "</phone>";
if (isset($pdata["fax"]))
$xml .= "<fax>" . $pdata["fax"] . "</fax>";
if (isset($pdata["addrnum"]))
$xml .= "<addrnum>" . $pdata["addrnum"] . "</addrnum>";
$xml .= "</billing>";
## SHIPPING NODE ##
$xml .= "<shipping>";
if (isset($pdata["sname"]))
$xml .= "<name>" . $pdata["sname"] . "</name>";
if (isset($pdata["saddress1"]))
$xml .= "<address1>" . $pdata["saddress1"] . "</address1>";
if (isset($pdata["saddress2"]))
$xml .= "<address2>" . $pdata["saddress2"] . "</address2>";
if (isset($pdata["scity"]))
$xml .= "<city>" . $pdata["scity"] . "</city>";
if (isset($pdata["sstate"]))
$xml .= "<state>" . $pdata["sstate"] . "</state>";
elseif (isset($pdata["state"]))
$xml .= "<state>" . $pdata["sstate"] . "</state>";
if (isset($pdata["szip"]))
$xml .= "<zip>" . $pdata["szip"] . "</zip>";
elseif (isset($pdata["sip"]))
$xml .= "<zip>" . $pdata["zip"] . "</zip>";
if (isset($pdata["scountry"]))
$xml .= "<country>" . $pdata["scountry"] . "</country>";
if (isset($pdata["scarrier"]))
$xml .= "<carrier>" . $pdata["scarrier"] . "</carrier>";
if (isset($pdata["sitems"]))
$xml .= "<items>" . $pdata["sitems"] . "</items>";
if (isset($pdata["sweight"]))
$xml .= "<weight>" . $pdata["sweight"] . "</weight>";
if (isset($pdata["stotal"]))
$xml .= "<total>" . $pdata["stotal"] . "</total>";
$xml .= "</shipping>";
### TRANSACTIONDETAILS NODE ###
$xml .= "<transactiondetails>";
if (isset($pdata["oid"]))
$xml .= "<oid>" . $pdata["oid"] . "</oid>";
if (isset($pdata["ponumber"]))
$xml .= "<ponumber>" . $pdata["ponumber"] . "</ponumber>";
if (isset($pdata["recurring"]))
$xml .= "<recurring>" . $pdata["recurring"] . "</recurring>";
if (isset($pdata["taxexempt"]))
$xml .= "<taxexempt>" . $pdata["taxexempt"] . "</taxexempt>";
if (isset($pdata["terminaltype"]))
$xml .= "<terminaltype>" . $pdata["terminaltype"] . "</terminaltype>";
if (isset($pdata["ip"]))
$xml .= "<ip>" . $pdata["ip"] . "</ip>";
if (isset($pdata["reference_number"]))
$xml .= "<reference_number>" . $pdata["reference_number"] . "</reference_number>";
if (isset($pdata["transactionorigin"]))
$xml .= "<transactionorigin>" . $pdata["transactionorigin"] . "</transactionorigin>";
if (isset($pdata["tdate"]))
$xml .= "<tdate>" . $pdata["tdate"] . "</tdate>";
$xml .= "</transactiondetails>";
### MERCHANTINFO NODE ###
$xml .= "<merchantinfo>";
if (isset($pdata["configfile"]))
$xml .= "<configfile>" . $pdata["configfile"] . "</configfile>";
if (isset($pdata["keyfile"]))
$xml .= "<keyfile>" . $pdata["keyfile"] . "</keyfile>";
if (isset($pdata["host"]))
$xml .= "<host>" . $pdata["host"] . "</host>";
if (isset($pdata["port"]))
$xml .= "<port>" . $pdata["port"] . "</port>";
if (isset($pdata["appname"]))
$xml .= "<appname>" . $pdata["appname"] . "</appname>";
$xml .= "</merchantinfo>";
### PAYMENT NODE ###
$xml .= "<payment>";
if (isset($pdata["chargetotal"]))
$xml .= "<chargetotal>" . $pdata["chargetotal"] . "</chargetotal>";
if (isset($pdata["tax"]))
$xml .= "<tax>" . $pdata["tax"] . "</tax>";
if (isset($pdata["vattax"]))
$xml .= "<vattax>" . $pdata["vattax"] . "</vattax>";
if (isset($pdata["shipping"]))
$xml .= "<shipping>" . $pdata["shipping"] . "</shipping>";
if (isset($pdata["subtotal"]))
$xml .= "<subtotal>" . $pdata["subtotal"] . "</subtotal>";
$xml .= "</payment>";
### CHECK NODE ###
if (isset($pdata["voidcheck"]))
{
$xml .= "<telecheck><void>1</void></telecheck>";
}
elseif (isset($pdata["routing"]))
{
$xml .= "<telecheck>";
$xml .= "<routing>" . $pdata["routing"] . "</routing>";
if (isset($pdata["account"]))
$xml .= "<account>" . $pdata["account"] . "</account>";
if (isset($pdata["bankname"]))
$xml .= "<bankname>" . $pdata["bankname"] . "</bankname>";
if (isset($pdata["bankstate"]))
$xml .= "<bankstate>" . $pdata["bankstate"] . "</bankstate>";
if (isset($pdata["ssn"]))
$xml .= "<ssn>" . $pdata["ssn"] . "</ssn>";
if (isset($pdata["dl"]))
$xml .= "<dl>" . $pdata["dl"] . "</dl>";
if (isset($pdata["dlstate"]))
$xml .= "<dlstate>" . $pdata["dlstate"] . "</dlstate>";
if (isset($pdata["checknumber"]))
$xml .= "<checknumber>" . $pdata["checknumber"] . "</checknumber>";
if (isset($pdata["accounttype"]))
$xml .= "<accounttype>" . $pdata["accounttype"] . "</accounttype>";
$xml .= "</telecheck>";
}
### PERIODIC NODE ###
if (isset($pdata["startdate"]))
{
$xml .= "<periodic>";
$xml .= "<startdate>" . $pdata["startdate"] . "</startdate>";
if (isset($pdata["installments"]))
$xml .= "<installments>" . $pdata["installments"] . "</installments>";
if (isset($pdata["threshold"]))
$xml .= "<threshold>" . $pdata["threshold"] . "</threshold>";
if (isset($pdata["periodicity"]))
$xml .= "<periodicity>" . $pdata["periodicity"] . "</periodicity>";
if (isset($pdata["pbcomments"]))
$xml .= "<comments>" . $pdata["pbcomments"] . "</comments>";
if (isset($pdata["action"]))
$xml .= "<action>" . $pdata["action"] . "</action>";
$xml .= "</periodic>";
}
### NOTES NODE ###
if (isset($pdata["comments"]) || isset($pdata["referred"]))
{
$xml .= "<notes>";
if (isset($pdata["comments"]))
$xml .= "<comments>" . $pdata["comments"] . "</comments>";
if (isset($pdata["referred"]))
$xml .= "<referred>" . $pdata["referred"] . "</referred>";
$xml .= "</notes>";
}
### ITEMS AND OPTIONS NODES ###
if ($this->debugging) // make it easy to see
{ // LSGS doesn't mind whitespace
reset($pdata);
while (list ($key, $val) = each ($pdata))
{
if (is_array($val))
{
$otag = 0;
$ostag = 0;
$items_array = $val;
$xml .= "\n<items>\n";
while(list($key1, $val1) = each ($items_array))
{
$xml .= "\t<item>\n";
while (list($key2, $val2) = each ($val1))
{
if (!is_array($val2))
$xml .= "\t\t<$key2>$val2</$key2>\n";
else
{
if (!$ostag)
{
$xml .= "\t\t<options>\n";
$ostag = 1;
}
$xml .= "\t\t\t<option>\n";
$otag = 1;
while (list($key3, $val3) = each ($val2))
$xml .= "\t\t\t\t<$key3>$val3</$key3>\n";
}
if ($otag)
{
$xml .= "\t\t\t</option>\n";
$otag = 0;
}
}
if ($ostag)
{
$xml .= "\t\t</options>\n";
$ostag = 0;
}
$xml .= "\t</item>\n";
}
$xml .= "</items>\n";
}
}
}
else // !debugging
{
while (list ($key, $val) = each ($pdata))
{
if (is_array($val))
{
$otag = 0;
$ostag = 0;
$items_array = $val;
$xml .= "<items>";
while(list($key1, $val1) = each ($items_array))
{
$xml .= "<item>";
while (list($key2, $val2) = each ($val1))
{
if (!is_array($val2))
$xml .= "<$key2>$val2</$key2>";
else
{
if (!$ostag)
{
$xml .= "<options>";
$ostag = 1;
}
$xml .= "<option>";
$otag = 1;
while (list($key3, $val3) = each ($val2))
$xml .= "<$key3>$val3</$key3>";
}
if ($otag)
{
$xml .= "</option>";
$otag = 0;
}
}
if ($ostag)
{
$xml .= "</options>";
$ostag = 0;
}
$xml .= "</item>";
}
$xml .= "</items>";
}
}
}
$xml .= "</order>";
return $xml;
}
}
?>
any luck getting this to work with godaddy?
Guys, you are getting the "Could not connect" error because curl is returning an empty result.
Try changing the following code in the lphp.php
# curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);
# curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);
to
curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);
Just uncomment the above codes.
Any Luck with this? I am getting the same error:
Error: <
Error: Failure in Processing the Payment (ps_linkpoint)
Followed directions, still nothing.
Anyone get this resolved?
Thanks,
Red
recently i build joomla site with shopping cart. Here i was created new page.. but amount is going on current position upto shipping address.
after shipping address is not possible to move.. please anybody tell my problem... Please be check my site
http://resumebyhr.com.