dsartain Posted June 6, 2007 Share Posted June 6, 2007 I'm working on a website for my family and they want to be able to use paypal to process transactions, but still want the ability to go in and update the shopping cart with new prices and such...Paypal's business account only lets me set the values when I create the buttons, and that's annoying as hell to change... Does anyone know how to pass values to paypal so that when they click the paypal "buy" button that it updates the information automatically???? Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/54445-php-and-paypal/ Share on other sites More sharing options...
ballhogjoni Posted June 6, 2007 Share Posted June 6, 2007 From what I know you have to get complex and use their api! Quote Link to comment https://forums.phpfreaks.com/topic/54445-php-and-paypal/#findComment-269274 Share on other sites More sharing options...
Dragen Posted June 6, 2007 Share Posted June 6, 2007 If you create your own buttons you should be able to send all of the info. If each button has a form attached to it with the set parameters, which it could get from a database, then paypal will read those. The form needs to look something like this: <form name="myform" method="post" action="https://www.paypal.com/cgi-bin/webscr"> <input type="hidden" name="cmd" value="_xclick" /> <!-- this input is needed --> <input type="hidden" name="business" value="YOUR PAYPAL ID" /> <input type="hidden" name="item_name" value="NAME OF ITEM" /> <input type="hidden" name="amount" value="COST OF ITEM" /> <input type="hidden" name="shipping" value="SHIPPING COST" /> <!-- this can be removed if not needed --> <input type="hidden" name="currency_code" value="CODE FOR CURRENCY" /> <!-- e.g; USD, GBP etc --> <input type="hidden" name="return" value="PAGE TO GO TO AFTER PAYMENT COMPLETE" /> <input type="hidden" name="cancel_return" value="PAGE TO GO TO IF CANCEL PAYMENT" /> You could easily get all of the prices, shipping, name and definitly the re-used variables, such as business, from a database. Quote Link to comment https://forums.phpfreaks.com/topic/54445-php-and-paypal/#findComment-269285 Share on other sites More sharing options...
per1os Posted June 6, 2007 Share Posted June 6, 2007 If you get wise with it, you notice the buttons have a query string attached, which has quantity, price, name etc. All you have to do is change that information to reflect new data. Quote Link to comment https://forums.phpfreaks.com/topic/54445-php-and-paypal/#findComment-269287 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.