I've been having trouble with occ's Paypal IPN ver 2.3.3


All aspects of it are working properly, except for the data being sent back to me via paypal.

the ipn.php code is as follows
http://www.travispwalker.info/ipn.php.txt

I have error logging on, this is what the error log shows:
Code:
PP TEST start
PP TEST PayPal is accessing the ipn file
PP TEST we have successfuly loaded application top and language file
PP TEST PayPal IPN module successfully loaded
PP TEST we are assembling the reply: cmd=_notify-validate&mc_gross=30.95&invoice=45&address_status=confirmed&payer_id=MNDFL5TUDLBY4&tax=0.00&address_street=1111+STREETNAME+Ave&payment_date=20%3A06%3A17+Dec+02%2C+2007+PST&payment_status=Completed&charset=windows-1252&address_zip=48506&first_name=Test&mc_fee=1.20&address_country_code=US&address_name=Travis+lastname&notify_version=2.4&custom=3&payer_status=verified&business=testsa_1196622836_biz%40mysite.com&address_country=United+States&address_city=city&quantity=1&verify_sign=Amo-Bb4LfyRx-Wq2OkzkVO4zBoQyAmvdlDq2dQZgunFnSjT7B5KakD1I&payer_email=email%40mysite.com&txn_id=7D375135A5256105P&payment_type=instant&last_name=User&address_state=AA&receiver_email=testemail%40mysite.com&payment_fee=1.20&receiver_id=BMNMWWND6TFLE&txn_type=web_accept&item_name=mysite.COM&mc_currency=USD&item_number=&residence_country=US&test_ipn=1&payment_gross=30.95&shipping=8.00
PP TEST PayPal server is www.sandbox.paypal.com
PP TEST option2 - curl is true
PP TEST option2 we start to send string
PP TEST option2 proxy setting found, applying proxy setting
PP TEST option2 proxy setting: http://proxy.shr.secureserver.net:3128
PP TEST option2 REPLY: VERIFIED
PP TEST result is VERIFIED
PP TEST order id is: 45
PP TEST customer id is: 3
PP TEST made it past the IF statement
Because of this, I believe the error lies in:
Code:
$order_query = tep_db_query("select currency, currency_value from " . TABLE_ORDERS . " where orders_id = '" . $_POST['invoice'] . "' and customers_id = '" . (int)$_POST['custom'] . "'");
I originally thought it might have been the variables $_POST['invoice'] and (int)$_POST['custom'] but I tried hardcoding these with the expected results and got the same type of response on my next try.


Im using
MySQL 5.0.45
Apache Server
w/ PHP version 4.3.11 (Zend: 1.3.0)
register_globals are on
server OS is Linux 2.4.21-40.ELsmp


anyone see a problem with the code
Code:
$order_query = tep_db_query("select currency, currency_value from " . TABLE_ORDERS . " where orders_id = '" . $_POST['invoice'] . "' and customers_id = '" . (int)$_POST['custom'] . "'");
?