This topic is locked

integrate paypal donation button

10/27/2010 6:55:53 PM
PHPRunner General questions
P
paulsimo author

I am currently working on a database that will allow users to send a donation through paypal.

The user does not have to be logged in to do this, they complete a form which includes how much they wish to donate as one of the fields.

What I can't figure out is how to integrate the donation option of paypal (this allows the user to state the amount they wish to pay). Any help would be gratefully received. So far all I have managed is to build the table for the user to fill in, then perform a redirect to the paypal payment page, however the user then has to input the amount a second time before proceeding with the payment. What I would like is for the amount to be automatically added from the relevant data in the table, i.e. donation amount.

T
tedwilder 10/29/2010

I think you might try to add something like
put in your script after record event the amount in the paypal post:

if field is called amount , replace the amount in paypal script with the value :

$values["amount"]
or if it's done after you can get it with something like that

$sql = "SELECT * FROM paypaldonationtable WHERE ID =".values["id"];

$rs = CustomQuery($sql);

$datafields = db_fetch_array($rs);
$datafields["amount"];