Jump to content

PHP and PayPal


dsartain

Recommended Posts

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!

Link to comment
https://forums.phpfreaks.com/topic/54445-php-and-paypal/
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/54445-php-and-paypal/#findComment-269285
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.