0
votes

Paypal show the error

TIMESTAMP: 2012-05-07T12:17:49Z CORRELATIONID: 37a2b3f9a2901 ACK: Failure VERSION: 76.0 BUILD: 2860716 L_ERRORCODE0: 10413 L_SHORTMESSAGE0: Transaction refused because of an invalid argument. See additional error messages for details. L_LONGMESSAGE0: The totals of the cart item amounts do not match order amounts. L_SEVERITYCODE0: Error but I used the following code of orderreview.php during parameter parsing

$personName        = $_REQUEST['PERSONNAME'];
           $SHIPTOSTREET      = $_REQUEST['SHIPTOSTREET'];
           $SHIPTOCITY        = $_REQUEST['SHIPTOCITY'];
           $SHIPTOSTATE       = $_REQUEST['SHIPTOSTATE'];
           $SHIPTOCOUNTRYCODE = $_REQUEST['SHIPTOCOUNTRYCODE'];
           $SHIPTOZIP         = $_REQUEST['SHIPTOZIP'];
           $count             = $_REQUEST['COUNT'];
           $shippingch        = $_REQUEST['shipping_charge'];

           $L_NAME            = 'L_NAME';
           $itemamt = 0.00;
           $itemstr = '';
           $amtstr = '';
           $qtystr = '';
           for($i=0; $i<=$count; $i++){
            $temp_lname = 'L_NAME'.$i;
            $temp_lamt = 'L_AMT'.$i;
            $temp_lqty = 'L_QTY'.$i;

           $$temp_lname     = $_REQUEST['L_NAME'.$i];
           $$temp_lamt            = $_REQUEST['L_AMT'.$i];
           $$temp_lqty           =  $_REQUEST['L_QTY'.$i];
           $itemamt=($itemamt+($$temp_lqty*$$temp_lamt));
           $itemstr.='&L_NAME'.$i.'='.$_REQUEST['L_NAME'.$i];
           $amtstr.='&L_AMT'.$i.'='.$_REQUEST['L_AMT'.$i];
           $qtystr.='&L_QTY'.$i.'='.$_REQUEST['L_QTY'.$i];
           }



           $returnURL =urlencode($url.'/ReviewOrder.php?currencyCodeType='.$currencyCodeType.'&paymentType='.$paymentType);
           $cancelURL =urlencode("$url/SetExpressCheckout.php?paymentType=$paymentType" );



           $shiptoAddress = "&SHIPTONAME=$personName&SHIPTOSTREET=$SHIPTOSTREET&SHIPTOCITY=$SHIPTOCITY&SHIPTOSTATE=$SHIPTOSTATE&SHIPTOCOUNTRYCODE=$SHIPTOCOUNTRYCODE&SHIPTOZIP=$SHIPTOZIP";


           $nvpstr="&ADDRESSOVERRIDE=1$shiptoAddress".$itemstr."".$amtstr."".$qtystr."&MAXAMT=".(string)$maxamt."&AMT=".(string)$amt."&ITEMAMT=".(string)$itemamt."&CALLBACKTIMEOUT=4&L_SHIPPINGOPTIONAMOUNT1=$shippingch&L_SHIPPINGOPTIONlABEL1=UPS Next Day Air&L_SHIPPINGOPTIONNAME1=UPS Air&L_SHIPPINGOPTIONISDEFAULT1=true&L_SHIPPINGOPTIONAMOUNT0=$shippingch&L_SHIPPINGOPTIONLABEL0=UPS Ground 7 Days&L_SHIPPINGOPTIONNAME0=Ground&L_SHIPPINGOPTIONISDEFAULT0=false&INSURANCEAMT=1.00&INSURANCEOPTIONOFFERED=true&CALLBACK=https://www.ppcallback.com/callback.pl&SHIPPINGAMT=$shippingch&SHIPDISCAMT=-3.00&TAXAMT=2.00&L_NUMBER0=1000&L_DESC0=Size: 8.8-oz&L_NUMBER1=10001&L_DESC1=Size: Two 24-piece boxes&L_ITEMWEIGHTVALUE1=0.5&L_ITEMWEIGHTUNIT1=lbs&ReturnUrl=".$returnURL."&CANCELURL=".$cancelURL ."&CURRENCYCODE=".$currencyCodeType."&PAYMENTACTION=".$paymentType;

If I used the shipping charge is hard coded as 8.00 then this code is working.

What could be the problem?

1

1 Answers

0
votes

If you receive this error, be sure the total of the payment detail item parameters, such as ItemTotal, HandlingTotal, TaxTotal, and so forth add up to the order total.