News:

Support the VirtueMart project and become a member

Main Menu

Paypal parse error

Started by tmedina, January 24, 2009, 18:34:44 PM

Previous topic - Next topic

tmedina

I've followed the directions in the sticky post of this forum and also copied the extra info code, I receive the following message when attempting to review the order:

Beginning to parse the payment extra info code...

Parse error: syntax error, unexpected '>' in /homepages/htdocs/components/com_virtuemart/themes/default/templates/pages/account.order_details.tpl.php(55) : eval()'d code on line 44

Error: The code of the payment method PayPal (PP) contains a Parse Error!
Please correct that first

Line 44 is as follows:   /** Start printing out HTML Form code (Payment Extra Info) **/ ?>

Any suggestions?  The website suggested to debug the script no longer works either: http://www.eliteweaver.co.uk/testing/ipntest.php -- could there be another place to test the IPN script?

ajredding

It sounds like there is a problem with your PayPal Config.  I'd suggest posting the default code to your site first and confirm that error goes away.  If it does then I'd also suggest using the code I've posted on this forum post http://forum.virtuemart.net/index.php?topic=49535.0  The reason I suggest this code is because of the major formatting and functionality changes that I've made to the way VM interfaces with PP.  Now as a caution right now I have not tested the payment process from start to finish to confirm that the IPN properly reports the transactions back to VM.  I'd watch the post listed above to see when that has been fixed.


<?php
$db1 
= new ps_DB();
$q "SELECT country_2_code FROM #__vm_country WHERE country_3_code='".$user->country."' ORDER BY country_2_code ASC";
$db1->query($q);

$url "https://www.paypal.com/cgi-bin/webscr";
$tax_total $db->f("order_tax") + $db->f("order_shipping_tax");
$discount_total $db->f("coupon_discount") + $db->f("order_discount");
$post_variables = Array(
"cmd" => "_ext-enter",
"redirect_cmd" => "_xclick",
"upload" => "1",
"business" => PAYPAL_EMAIL,
"receiver_email" => PAYPAL_EMAIL,
"item_name" => $VM_LANG->_('PHPSHOP_ORDER_PRINT_PO_NUMBER').": "$db->f("order_id"),
"order_id" => $db->f("order_id"),
"invoice" => $db->f("order_number"),
"amount" => round$db->f("order_subtotal")+$tax_total-$discount_total2),
"shipping" => sprintf("%.2f"$db->f("order_shipping")),
"currency_code" => $_SESSION['vendor_currency'],

"address_override" => "1",
"first_name" => $dbbt->f('first_name'),
"last_name" => $dbbt->f('last_name'),
"address1" => $dbbt->f('address_1'),
"address2" => $dbbt->f('address_2'),
"zip" => $dbbt->f('zip'),
"city" => $dbbt->f('city'),
"state" => $dbbt->f('state'),
"country" => $db1->f('country_2_code'),
"email" => $dbbt->f('user_email'),
"night_phone_b" => $dbbt->f('phone_1'),
"cpp_header_image" => $vendor_image_url,

"return" => SECUREURL ."index.php?option=com_virtuemart&page=checkout.result&order_id=".$db->f("order_id"),
"notify_url" => SECUREURL ."administrator/components/com_virtuemart/notify.php",
"cancel_return" => SECUREURL ."index.php",
"undefined_quantity" => "0",

"test_ipn" => PAYPAL_DEBUG,
"pal" => "NRUBJXESJTY24",
"no_shipping" => "1",
"no_note" => "1"
);
if( 
$page == "checkout.thankyou" ) {
$query_string "?";
foreach( 
$post_variables as $name => $value ) {
$query_string .= $name"=" urlencode($value) ."&";
}
vmRedirect$url $query_string );
} else {
echo 
'<form action="'.$url.'" method="post" target="_blank">';
echo 
'<input type="image" name="submit" src="https://www.paypal.com/en_US/i/btn/x-click-but6.gif" border="0" alt="Click to pay with PayPal - it is fast, free and secure!" />';

foreach( 
$post_variables as $name => $value ) {
echo 
'<input type="hidden" name="'.$name.'" value="'.htmlspecialchars($value).'" />';
}
echo 
'</form>';

}
?>

RAW Media Group - Website design - http://www.rawmediagroup.com
Cubed Hosting - Website Hosting - http://www.cubedhosting.com

lori100

Thank you, thank you, thank you!!  This code helped me (I was having the same problem).  I couldn't figure out what was going on! 

Cheers,

-Lori