scooby1 Posted April 14, 2012 Share Posted April 14, 2012 Hello I am trying to redirect the user to paypal when then they press a button a new page runs. $urlParams = array( 'cmd' => '_cart', 'upload' => 1, 'charset' => 'utf-8', 'business' => '[email protected]', 'return' => 'http://www.mywebsite.com', 'currency_code' => 'GBP', 'amount_1' => $row['total'], 'item_name_1' => $row['id'], ); // Build the URL $urlParams = http_build_query($urlParams, '', '&'); $url = 'https://www.sandbox.paypal.com/cgi-bin/webscr'; header('location:' .$url. '?' . $urlParams); All I am trying to do is send across the Total order price and the order number. It redirects fine to paypal, and all the information is correctly displayed in the address bar but paypal says "Error Detected - Your shopping cart is empty". Has anyone had this problem before? Thanks for your help! Tom Link to comment https://forums.phpfreaks.com/topic/260915-redirecting-to-paypal-with-order-details/ Share on other sites More sharing options...
scooby1 Posted April 14, 2012 Author Share Posted April 14, 2012 Don't worry guys after a bit of research I managed to do it like this..... header("Location:https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=myemailaddress%40hotmail.com&item_name=" . urlencode(www.mywebsite.com) . "+Order&item_number=PROD" . $row['id'] ."&amount=" . urlencode(sprintf('%.2f', $row['total'])) . " &no_note=l¤cy_code=GBP&lc=GB"); Thanks for looking anyway. Link to comment https://forums.phpfreaks.com/topic/260915-redirecting-to-paypal-with-order-details/#findComment-1337287 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.