1

I am trying to add PayPal checkout to my website. The total amount for each payment varies and so I use PHP to generate the total sum. I am trying to POST the amount to a hosted button so that it is more secure, using the advanced variables option on the 3rd step when creating a button but I can't seem to get it to work.

Does anybody know if it is possible to actually do this or does it have to be done another way?

Code on the website:

<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
                <input type="hidden" name="cmd" value="_s-xclick">
                <input type="hidden" name="hosted_button_id" value="GMENQCFMYUE46">
                <input type="image" src="https://www.paypalobjects.com/en_US/GB/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal – The safer, easier way to pay online.">
                <input type="hidden" name="amount" value="<?php print("$total")?>"/>
                <input type="hidden" name="quantity" value="1" />
                <input type="hidden" name="item_name" value="<?php print("$origin - $destination Transfer $date")?>" />
                <img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1">
            </form>

The item_name works fine but I understand that the amount variable wont carry over in this way so I am trying to find a way to do this.

0 Answers0