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

PayPal: "Transaction Cancelled. This function is temporarily unavailable."

Started by SparksArts, April 14, 2009, 21:50:36 PM

Previous topic - Next topic

SparksArts

I have 2 websites using VirtueMart and both are experiencing the same issue. Everything works fine adding items to the cart until you click "Pay Now With PayPal" and go to the PayPal servers. The first PayPal page says:

QuoteTransaction Cancelled

This function is temporarily unavailable. Please try your payment again later by returning to eBay and clicking the My eBay button.

They were both working fine. They don't get many orders, but the last successful order was March 14, 2009 on one site and April 7, 2009 on the other. An order on April 13 failed with the above error.

Nothing has changed on my sites. One day they're working, the next they're not. And since both sites started doing the same thing at the same time, I'm assuming it's something different at PayPal. So what could it be?

Anyone else experiencing this issue?

Here are my details:
Site 1 ----
Joomla 1.0.15 with VirtueMart 1.0.14

Payment Method > PayPal > Configuration > Payment Extra Info

<?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++;
}


$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.paypal.com/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(
"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_1" => sprintf("%.2f"$db->f("order_shipping")),
"image_url" => "https://securelogohosting.com/xxx",
"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",
"rm" => "2",

"email" => $dbb->f("user_email"),
"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"),
"night_phone_c" => $dbbt->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>';

}
?>


Site 2 ----
Joomla 1.5.10 with VirtueMart 1.1.1

Payment Method > PayPal > Configuration > Payment Extra Info

<?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++;
}


$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.paypal.com/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(
"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_1" => sprintf("%.2f"$db->f("order_shipping")),
"image_url" => "https://securelogohosting.com/xxx",
"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",
"rm" => "2",

"email" => $dbb->f("user_email"),
"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"),
"night_phone_c" => $dbbt->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>';

}
?>


Thanks for any help. I don't know where else to turn to get this fixed. I have other sites using PayPal, but not VirtueMart and they are working fine.

Richard
Richard Sparks, Website Developer

eedman

PAYPALS RESPONSE:

"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."

SparksArts

Thanks, eedman, for the rapid response!

So the temporary solution is to remove the 'order_id' variable from the Payment Extra Info and all will be fixed, right? I wonder if that variable has some other purpose that will then be broken. Any ideas on that?

I'll test it now and report back my results.

Richard
Richard Sparks, Website Developer

eedman

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.

SparksArts

It appears to be working now... I don't know what will happen when someone completes an order at PayPal and is redirected back to the website. The return path includes the order_id as well.

Strange that PayPal all of a sudden decided to make this not work. If the variable wasn't supported, why did it work in the first place?

Here's the affected code section in Payment Extra Info with the variable I removed highlighted in red:

$url = "https://www.paypal.com/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(
"cmd" => "_cart",
"upload" => "1",
"business" => PAYPAL_EMAIL,
"item_name" => $description,
"currency_code" => $_SESSION['vendor_currency'],
"amount" => round( $db->f("order_subtotal")+$tax_total-$discount_total, 2),
"tax" => $tax_total,
"tax_cart" => $tax_total,
"receiver_email" => PAYPAL_EMAIL,
"order_id" => $db->f("order_id"),
"invoice" => $db->f("order_number"),
"shipping_1" => sprintf("%.2f", $db->f("order_shipping")),
"image_url" => "https://securelogohosting.com/xxx.jpg",
"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",
"rm" => "2",

I'm sure this issue is not over yet, but at least my client's shopping carts work again.

Thanks again, eedman!
Richard
Richard Sparks, Website Developer

brandonjp

Thanks so much for this.  I've been having several PayPal problems - hopefully this was the reason.  Time will tell.
--bp