I know how to make a PayPal donate button redirect after payment, but what I need to know is, can you pass the payed amount through this redirection. So it would redirect to http://example.com/donate?amount=123, is this even possible?
Thanks!
EDIT: It seems I can do it with IPN(?), I just don’t know how to use paypal’s IPN, can anyone help me? (yes I have read the docs, they are confusing)
yes it is possible, like so:
But (concerning security)
It would be better to keep it in e.g.
$_SESSION['amount']along with a reference id$_SESSION['reference_id'] = md5('whatever you like' . 'plus salt');And in the paypal button use that reference_id like so:
And then,
if $_GET['ref'] == $_SESSION['reference_id'], then you can use the $_SESSION[‘amount’] variable.