user2288974
user2288974

Reputation: 93

Custom Paypay payment protection

I'm doing a PayPal payment system. The steps are:

  1. collect all item & price value that user have chose, through js get from html input.
  2. redirect to url paypal and add on item and price:

    https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_cart&upload=1&[email protected]&cy_code=USD&lc=US&item_name_1=Black Gold&item_number_1=1&quantity_1=1&amount_1=$58.00

Question: But using this method, user can change the price easily by downloading the page from my site and changing the script. So any protection I can do for this?

I have 2 ideas now. But I don't think they're good solutions.

  1. encode/decode the price by server site
  2. get the price value from sql ...

Upvotes: 0

Views: 77

Answers (1)

IrishChieftain
IrishChieftain

Reputation: 15253

Use a POST request to send the data and not a GET request (using URL params). Also, use the PayPal IPN notification system to notify you in the situation that somebody tampers with passed values using a hack:

https://www.paypal.com/ipn

Upvotes: 1

Related Questions