Encrypt Paypal button, but I need user text input

58 views Asked by At

I need to somehow secure source code of paypal button, so users can't change amount of money. But I also need user's input (custom input - Nickname for some game), because I'm using this input in IPN.

This is my code for paypal button:

<form name="_xclick" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="POST">
<input type="hidden" name="cmd" value="_xclick">
<input name='currency_code' type='hidden' value='CZK'
<input name='business' type='hidden' value='DHWYTXXXXXXXX'>
<input name='item_name' type='hidden' value='VIP Membership on server XXX'>
<input name='amount' type='hidden' value='5.00'>
<input name='lc' type='hidden' value='CZ'>
<input name='no_shipping' type='hidden' value='1'>
<input name='no_note' type='hidden' value='1'>
<input name='custom' type='text' placeholder='Nickname' required='required'>
<input name='notify_url' type='hidden' value='https://example.cz/paypal/ipn_process.php'>
<input name='return_url' type='hidden' value='https://example.cz/paypal/ipn_success.php'>
<input name='rm' type='hidden' value='2'>
<input type='submit' class='paypalSubmit' name='submit' value='Buy now'>
</form>

I tried encrypting it with OpenSSL, but I need user's input, so that didn't work.

So, Is there any other way how to protect the amount (or encrypt it, but also be able and use user's input), so users can't change the price?

Thank you very much! :)

0

There are 0 answers