Forum Moderators: buckworks
I could look up the price in a database based on the product name, but part of the point of IPN is to make sure the price paid IS the price in the database! Best I can do for verification is to compare the total price paid for the whole cart against the total price of all items in the database.
I could also check the prices of the items in the shopping cart database, since I'm running my own cart which I hand off to PayPal, but that's not reliable. Say someone clicks Check Out and goes to PayPal, but before actually paying they have another browser window open where they start adding or deleting things from their cart. Paid cart no longer matches database cart once they've actually paid.
Paid cart no longer matches database cart once they've actually paid
IPN provides custom fields for you to pass whatever info you need and I've found it perfectly flexible enough for my needs.
[edited by: FalseDawn at 2:57 am (utc) on Nov. 27, 2006]
So you blindly ship goods without checking the actual amount received?
Ahem. The whole point of my post is that I *am* trying to check the price paid for each item, but that's kind of hard to do when PayPal doesn't return that data to me.
Passing data through the custom fields is useless from a security standpoint, as it's easily faked. I want PayPal to pass me back what was *actually* paid for each individual item. Can PayPal do that? I hope I'm missing something, because otherwise it looks like it can't. Maybe I should check out Google Payments....
Again, my issue is that I'm trying to find a way to verify from PayPal that the price paid for an item was the price that should have been paid.
[edited by: lorax at 3:55 pm (utc) on Nov. 27, 2006]
[edit reason] removed commentary [/edit]
My next problem is that I don't see that PayPal returns the SHIPPING cost back to the server via IPN. Well, it returns the cost if you're charging separate shipping on each item, but if your shipping is cart-wide, I don't see a way to get the shipping cost. My workaround is to pass the shipping info through the hidden "custom" variable.
Anyway, I just tested it by getting the values for the following, since I wasn't sure which, of any to use:
$ship1 = $variable{'mc_shipping'};
$ship2 = $variable{'mc_shipping#'};
$ship3 = $variable{'mc_shipping1'};
$ship4 = $variable{'mc_shipping_'};
$ship5 = $variable{'mc_shipping_1'};
The actual shipping for the order was $5.
Variables $ship1 & $ship3 reported "0.00".
Variables $ship2, $ship4, & $ship5 were empty.
None of them reported the proper 5.00 shipping.
PayPal scrapes.