Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.