Reply
khmedia New Community Member
New Community Member
Posts: 1
Kudos: 0
Accepted Solutions: 0

What is wrong with this button API code:

Hello friends,

 

Please help me integrating amount to paypal:

 

See the code below:

 

<div align='center'>
        <form action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\">
        <input type=\"hidden\" name=\"cmd\" value=\"_s-xclick\">
        <input type=\"hidden\" name=\"currency_code\" value=\"USD\">
        <input type=\"hidden\" name=\"item_name\" value=\"Picture Purchase At www.khmedia.in\">
        <input type=\"hidden\" name=\"amount\" value=\"$imgprice\">
        <table>
        <tr><td><input type=\"hidden\" name=\"on0\" value=\"Image ID:\">Image ID: <input type=\"text\" name=\"os0\" maxlength=\"5\" value=\"$pid\" readonly=\"true\"></td></tr>
        </table>
        <input type=\"image\" src=\"https://www.paypalobjects.com/en_GB/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_GB/i/scr/pixel.gif\" width=\"1\" height=\"1\">
        </form>

</div>

0 Kudos
Highlighted
PayPal Employee PayPal_RobG
PayPal Employee
Posts: 182
Kudos: 15
Accepted Solutions: 7

Re: What is wrong with this button API code:

Use _xclick, not _s-xclick.

_s-xclick is only for secured and/or hosted PayPal buttons, which yours is not.

 

Additionally, I'd strongly recommend implementing some sort of check on your transaction(s), because you're basically transmitting the amount to be charged in plain view right now. You could use PayPal IPN (https://www.paypal.com/ipn/) to verify the correct amount was paid in the transaction.

----
For technical assistance with PayPal merchant product offerings, please file a ticket at https://www.paypal.com/mts/
0 Kudos
Announcements
If you are using Internet Explorer 8 take note. We’ll upgrade our communities in July and if you are using IE8 you won’t have a fully functional experience. Please upgrade your browser to Internet Explorer 9, 10 or 11. There will be no changes to your community experience if you are using IE 9, 10, 11, Chrome, Firefox or Safari.
Welcome, guest
Top Kudoed Authors
User Kudos Count
1