News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Just cant go to paypal.

Started by connor, December 13, 2008, 00:01:58 AM

Previous topic - Next topic

connor

I have looked at the paypal set up and even the posts similar to mine and nothing I do seems to work. I have the latest version of virtuemart and joomla 1.5

Config:-

Test mode - No
Paypal email - Set up correctly
Order Status for successful transactions       Confirmed
Order Status for Pending Payments                 Pending
"                " Canceled Payments              Canceled

In the extra payment info I have the following:-

<?php
$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" => "_xclick",
"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'],
"first_name" => $dbbt->f('first_name'),
"last_name" => $dbbt->f('last_name'),
"address_street" => $dbbt->f('address_1'),
"address_zip" => $dbbt->f('zip'),
"address_city" => $dbbt->f('city'),
"address_state" => $dbbt->f('state'),
"address_country" => $dbbt->f('country'),
"image_url" => $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) ."&";
}
mosRedirect$url $query_string );
} else {

echo '<form action="'.$url.'" method="post" target="_blank">';
echo '<input type="image" name="submit" src="http://images.paypal.com/images/x-click-but6.gif" border="0" alt="Make payments with PayPal, it is fast, free, and secure!" />';

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

echo '</form>';

}
?>



Please help me as I am new and really like this mod.

connor


inishindie

Hi Connor

Did you get a solution to this problem?  I have the same thing happening.  I have put a couple of forum questions up myself.  I did have the Paypal page up a day or two ago but it's gone now and I can't get into it. I did the same settings as yourself too............

Cheers

Ian

ajredding

could ya'll post details about your host/site

PHP version
Joomla Version
VirtueMart Version
etc...

And when you say it doesn't go to paypal, is it just sit there trying to connect or what exactly does it do when you go through the checkout process?
RAW Media Group - Website design - http://www.rawmediagroup.com
Cubed Hosting - Website Hosting - http://www.cubedhosting.com

eedman

I am also now having the same problems, i just get a paypal pay that says the transaction has been cancelled, (it shows up as pending in virtuemart)

my extra paypal info is as follows:

<?php
//"item_name" => $VM_LANG->_PHPSHOP_ORDER_PRINT_PO_NUMBER.": ". $db->f("order_id")
$order_id $db->f("order_id");
$dboi = new ps_DB;
$q_oi "SELECT * FROM #__vm_order_item ";
$q_oi .= "WHERE #__vm_order_item.order_id='$order_id'";
$dboi->query($q_oi);
$description "Inscriptions";
$row_num $dboi->num_rows();
$i=1;
while(
$dboi->next_record()) {
    
$supp_var['item_name_' $i] = $dboi->f("order_item_name");
    
$supp_var['quantity_' $i] = $dboi->f("product_quantity");
    
$supp_var['amount_' $i] = round($dboi->f("product_item_price"),2);
    
$i++;
}

//Fix to add shipping as item:
$dbsi = new ps_DB;
$q_si "SELECT ship_method_id FROM #__vm_orders ";
$q_si .= "WHERE #__vm_orders.order_id='$order_id'";
$dbsi->query($q_si);
$shipInfo split("\|"$dbsi->f("ship_method_id"));
$supp_var['item_name_' $i] = "Shipping - " $shipInfo[1] . " - " $shipInfo[2];
$supp_var['quantity_' $i] = "1";
$supp_var['amount_' $i] = sprintf("%.2f"$db->f("order_shipping"));
//End Ship Fix

$dbb = new ps_DB;
$q "SELECT * FROM jos_vm_user_info ";
$q .= "WHERE user_id ='".$my->id."' ";
$dbb->setQuery($q);
$dbb->query();
/*
"cmd" => "_ext-enter",
"redirect_cmd" => "_xclick",

*/
//$url = "https://www.sandbox.paypal.com/cgi-bin/webscr"; //Test mode
$url "https://www.paypal.com.au/cgi-bin/webscr";
$tax_total round($db->f("order_tax") + $db->f("order_shipping_tax"),2);
$discount_total $db->f("coupon_discount") + $db->f("order_discount");
$post_variables = Array(
"sf" => "0",
"cmd" => "_cart",
"upload" => "1",
"business" => PAYPAL_EMAIL,
"item_name" => $description,
"currency_code" => $_SESSION['vendor_currency'],
"amount" => round$db->f("order_subtotal")+$tax_total-$discount_total2),
"tax" => $tax_total,
"tax_cart" => $tax_total,
"receiver_email" => PAYPAL_EMAIL,
"order_id" => $db->f("order_id"),
"invoice" => $db->f("order_number"),
"shipping" => sprintf("%.2f"$db->f("order_shipping")),
"image_url" => $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" => "0",


"first_name" => $dbb->f("first_name"),
"last_name" => $dbb->f("last_name"),
"address1" => $dbb->f("address_1"),
"address2" => $dbb->f("address_2"),
"city" => $dbb->f("city"),
"state" => $dbb->f("state"),
"zip" => $dbb->f("zip"),
"H_PhoneNumber" => $dbb->f("phone_1")
);
if( 
$page == "checkout.thankyou" ) {
$query_string "?";

foreach( 
$post_variables as $name => $value ) {
$query_string .= $name"=" urlencode($value) ."&";
}
if(
is_array($supp_var) && count($supp_var)) {
foreach(
$supp_var as $name => $value) {
$query_string .= $name"=" urlencode($value) ."&";
}
}


mosRedirect$url $query_string );
} else {

echo 
'<form action="'.$url.'" method="post" target="_blank">';
echo 
'<input type="image" name="submit" src="http://images.paypal.com/images/x-click-but6.gif" border="0" alt="Make payments with PayPal, it is fast, free, and secure!">';


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

if(
is_array($supp_var) && count($supp_var)) {
foreach(
$supp_var as $name => $value) {
echo 
'<input type="hidden" name="'.$name.'" value="'.$value.'" />';
}
}

echo 
'</form>';

}
?>


Pjries

#5
I can confirm the same problem, using a PayPal script that I found on the forums here a long time ago which parses out the coupon discount, order and item information and taxes and shipping. 

In order to resolve this, at least temporarily, I've reverted to the code found in Soeren's PayPal post at the top of this thread source.

I suspect that PayPal may have changed some of the variables, but I cannot confirm that yet.
I have clients using Joomla 1.0.15 and VM 1.1.2, as well as Joomla 1.5.10 and VM 1.1.3, but all are using that script with the additional variables - it seems to have shown up across the board, with that other script.

Hope that helps someone. If I come up with anything else, I'll post it here.


eedman

And after sitting the all day yesterday, paypal have given me a response, it goes as follows:

"The problem lies in the 'order_id' variable that the cart is passing to PayPal. According to our Website Payment Standard Integration Guide (https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/library_documentation#wps), this is not a valid variable. When I remove it in my testing the whole process works as expected.

I am checking now to see how we can make Virtue Mart aware of this issue, but I would certainly recommend that you contact them directly to have a more immediate fix for your cart installed."


Does anyone know of a change we can make to fix this??

eedman

and heres a fix:

THIS WORKS!

comment out this line as shown below in you payment extra info in your payment method form:



//"order_id" => $db->f("order_id"),


Tested and works fine.

theEditor

Eedman,

It didn't work for me. Any other suggestions we could use mate.