0
votes

I have a form that a user fills out prior to reaching the PayPal Buy Now button. The form contains information such as the users name and the amount they will be paying (in a hidden field).

I know there probably is a way to pass the name variable to PayPal using the Advanced Variables feature, but is there a way to alter the buttons price?

And can I do this using PHP variables?

Eg: item_name=<?php $myitem ?>

Any advice would be great! Thanks

EDIT: Form as requested

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="XXXX">
<input type="image" src="https://www.paypalobjects.com/en_AU/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal — The safer, easier way to pay online.">
<img alt="" border="0" src="https://www.paypalobjects.com/en_AU/i/scr/pixel.gif" width="1" height="1">
</form>
2
Please post the according html from your button.pdu
please paste your sample paypal form. What do you mean alter the buttons priceantoniom
@antoniom I mean that when I create the Buy Now button on the PayPal site it asks for a dollar amount (presumably what the user will be asked to pay upon clicking the button). I want to know how to change that initial amount by using a php var from my formMeltingDog

2 Answers

1
votes

If I understand correctly your question, you have to put the amount hidden field on paypal form. e.g.

<input type="hidden" name="amount" value="100">
<input type="hidden" name="currency_code" value="USD">

This form will prompt paypal to ask $100 from buyer.

of course you can add your own var there e.g.

<input type="hidden" name="amount" value="<?php echo $amount;?>">

HTH

0
votes

I cannot even get this working with an unhosted button. It seems Paypal never lets you change the amount. I see it like this :

hosted button : amount is set in the code pointed to by the 'hosted button id' unhosted button : PayPal encrypts the information, of which amount is part of

so, in either case you cannot change it, or at least, I haven't been able to do this.

Having said that, there is a variable called 'amount' you can use. So, I'm very confused about this.