gameduels Posted January 16, 2008 Share Posted January 16, 2008 Help me out i cant get the items to show up on paypal. Ive been working on this for 1-3 weeks. I cant get this to work. I think its in the IPN.php or Payment.php i cant get that to work. It shows a # but not a item name. Can you please help me out thanks and i hope we can get this to work . Code IPN.php: <?php // this page only process a POST from paypal website // so make sure that the one requesting this page comes // from paypal. we can do this by checking the remote address // the IP must begin with 66.135.197. if (strpos($_SERVER['REMOTE_ADDR'], '66.135.197.') === false) { exit; } require_once './paypal.inc.php'; // repost the variables we get to paypal site // for validation purpose $result = fsockPost($paypal['url'], $_POST); //check the ipn result received back from paypal if (eregi("VERIFIED", $result)) { require_once '../library/config.php'; // check that the invoice has not been previously processed $sql = "SELECT od_status FROM tbl_order WHERE od_id = {$_POST['invoice']}"; $result = dbQuery($sql); // if no invoice with such number is found, exit if (dbNumRows($result) == 0) { exit; } else { $row = dbFetchAssoc($result); // process this order only if the status is still 'New' if ($row['od_status'] !== 'New') { exit; } else { // check that the buyer sent the right amount of money $sql = "SELECT SUM(pd_price * od_qty) AS subtotal FROM tbl_order_item oi, tbl_product p WHERE oi.od_id = {$_POST['invoice']} AND oi.pd_id = p.pd_id GROUP by oi.od_id"; $result = dbQuery($sql); $row = dbFetchAssoc($result); $subTotal = $row['subtotal']; $total = $subTotal + $shopConfig['shippingCost']; if ($_POST['payment_gross'] != $total) { exit; } else { $invoice = $_POST['invoice']; $memo = $_POST['memo']; if (!get_magic_quotes_gpc()) { $memo = addslashes($memo); } // ok, so this order looks perfectly okay // now we can update the order status to 'Paid' // update the memo too $sql = "UPDATE tbl_order SET od_status = 'Paid', od_memo = '$memo', od_last_update = NOW() WHERE od_id = $invoice"; $result = dbQuery($sql); } } } } else { exit; } ?> payment.php <?php /* This page will submit the order information to paypal website. After the customer completed the payment she will return to this site */ if (!isset($orderId)) exit; require_once 'paypal.inc.php'; $paypal['invoice'] = $orderId; $paypal['amount'] = $orderAmount; ?> <center> <p> </p> <p><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#FF0000"><strong>Processing Transaction . . . </strong></font></p> </center> <form action="<?= $paypal['url']; ?>" method="post" name="frmPaypal" id="frmPaypal"> <div align="center"> <input type="hidden" name="amount" value="<?= $paypal['amount']; ?>"> <input type="hidden" name="invoice" value="<?= $paypal['invoice']; ?>"> <input type="hidden" name="item_name" value="<?= $paypal['item_name']; ?>"> <input type="hidden" name="business" value="<?= $paypal['business']; ?>"> <input type="hidden" name="cmd" value="<?= $paypal['cmd']; ?>"> <input type="hidden" name="return" value="<?= $paypal['site_url'] . $paypal['success_url']; ?>"> <input type="hidden" name="cancel_return" value="<?= $paypal['site_url'] . $paypal['cancel_url']; ?>"> <input type="hidden" name="notify_url" value="<?= $paypal['site_url'] . $paypal['notify_url']; ?>"> <input type="hidden" name="rm" value="<?= $paypal['return_method']; ?>"> <input type="hidden" name="currency_code" value="<?= $paypal['currency_code']; ?>"> <input type="hidden" name="lc" value="<?= $paypal['lc']; ?>"> <input type="hidden" name="bn" value="<?=$paypal['bn']; ?>"> <input type="hidden" name="no_shipping" value="<?= $paypal['display_shipping_address']; ?>"> </div> </form> <script language="JavaScript" type="text/javascript"> window.onload=function() { window.document.frmPaypal.submit(); } </script> thanks and i hope you can get this to work for me i add the files to attachment.. Thanks. Cody. [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/86309-paypal-paymentphp-ipnphp-help/ Share on other sites More sharing options...
gameduels Posted January 16, 2008 Author Share Posted January 16, 2008 any1 ? Quote Link to comment https://forums.phpfreaks.com/topic/86309-paypal-paymentphp-ipnphp-help/#findComment-440986 Share on other sites More sharing options...
tapos Posted January 16, 2008 Share Posted January 16, 2008 Please check your $paypal variable at payment.php. user var_dump to check the variable. -- Thanks, Tapos Pal http://tapos.wordpress.com Quote Link to comment https://forums.phpfreaks.com/topic/86309-paypal-paymentphp-ipnphp-help/#findComment-441020 Share on other sites More sharing options...
gameduels Posted January 16, 2008 Author Share Posted January 16, 2008 what you mean ? Tell me more so iget what your talking about ... im kinda new to php so im kinda working my way up Quote Link to comment https://forums.phpfreaks.com/topic/86309-paypal-paymentphp-ipnphp-help/#findComment-441227 Share on other sites More sharing options...
gameduels Posted January 16, 2008 Author Share Posted January 16, 2008 ? Quote Link to comment https://forums.phpfreaks.com/topic/86309-paypal-paymentphp-ipnphp-help/#findComment-441431 Share on other sites More sharing options...
gameduels Posted January 17, 2008 Author Share Posted January 17, 2008 Bump Help Quote Link to comment https://forums.phpfreaks.com/topic/86309-paypal-paymentphp-ipnphp-help/#findComment-441799 Share on other sites More sharing options...
gameduels Posted January 17, 2008 Author Share Posted January 17, 2008 Anyone know whats wrong with this ? Quote Link to comment https://forums.phpfreaks.com/topic/86309-paypal-paymentphp-ipnphp-help/#findComment-441830 Share on other sites More sharing options...
phpretard Posted January 17, 2008 Share Posted January 17, 2008 I have just finished working with a paypal PHP project. I might be able to help. What do you mean "show up on paypal"? Quote Link to comment https://forums.phpfreaks.com/topic/86309-paypal-paymentphp-ipnphp-help/#findComment-441864 Share on other sites More sharing options...
gameduels Posted January 17, 2008 Author Share Posted January 17, 2008 what i mean is I bought DTEC FC to test out the script and it gives me a feild here and type in the product. I want it were it tells you what you bought , inside of you typing in the item. So what i mean is i want paypal or the script above i gave you to apply the item what you bought in that item box there. i dont want customers to add a products in the feild. So i want the feild gone and i want paypal to apply the items that the client bought. I have all the paypal files above attached to the forum. Thank you i added a picture to the attachments. [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/86309-paypal-paymentphp-ipnphp-help/#findComment-441883 Share on other sites More sharing options...
gameduels Posted January 17, 2008 Author Share Posted January 17, 2008 Bump anyone ? Quote Link to comment https://forums.phpfreaks.com/topic/86309-paypal-paymentphp-ipnphp-help/#findComment-442138 Share on other sites More sharing options...
atlanta Posted January 17, 2008 Share Posted January 17, 2008 Check this variable $paypal['item_name'] . echo it and see do u get anything. <input type="hidden" name="item_name" value="<?= $paypal['item_name']; ?>"> Quote Link to comment https://forums.phpfreaks.com/topic/86309-paypal-paymentphp-ipnphp-help/#findComment-442172 Share on other sites More sharing options...
tinker Posted January 17, 2008 Share Posted January 17, 2008 yep as atlanta say's, also you need to validate all the POST variables. Use that page, comment out the js and print out all the vars, check that your getting/sending all the variables your expecting... Quote Link to comment https://forums.phpfreaks.com/topic/86309-paypal-paymentphp-ipnphp-help/#findComment-442189 Share on other sites More sharing options...
revraz Posted January 17, 2008 Share Posted January 17, 2008 If you don't know how to check a variable, then this code is over your head. I would suggest start off with the basics first. what you mean ? Tell me more so iget what your talking about ... im kinda new to php so im kinda working my way up Quote Link to comment https://forums.phpfreaks.com/topic/86309-paypal-paymentphp-ipnphp-help/#findComment-442191 Share on other sites More sharing options...
gameduels Posted January 17, 2008 Author Share Posted January 17, 2008 i tryed this <input type="hidden" name="item_name" value="<? echo "$paypal ['item_name']"; ?>"> and now in paypal i get Array ['item_name'] under the item section on paypal. I tryed with out "" for the echo i tryed and didnt work. Quote Link to comment https://forums.phpfreaks.com/topic/86309-paypal-paymentphp-ipnphp-help/#findComment-442206 Share on other sites More sharing options...
gameduels Posted January 17, 2008 Author Share Posted January 17, 2008 I tryed echoing it . It didnt work. i tryed <input type="hidden" name="item_name" value="<? echo "$paypal ['item_name']"; ?>"> <input type="hidden" name="item_name" value="<? echo paypal ['item_name'] ?>"> and nothing showed up Quote Link to comment https://forums.phpfreaks.com/topic/86309-paypal-paymentphp-ipnphp-help/#findComment-442238 Share on other sites More sharing options...
tinker Posted January 17, 2008 Share Posted January 17, 2008 No, I don't think anybody would expect it to, do you know why? Try this instead: <?php echo $paypal ['item_name']; ?> whoa, whoa, whoa, where is the $paypal array being filled? Quote Link to comment https://forums.phpfreaks.com/topic/86309-paypal-paymentphp-ipnphp-help/#findComment-442247 Share on other sites More sharing options...
gameduels Posted January 17, 2008 Author Share Posted January 17, 2008 That still dosent work . ... . .. I dont know im about to quit on this script and say cuddle it . This flower is making me feel all warm and fuzzy .. ive been trying to get this to work 1-4 weeks and it wont work.... edit by neylitalo: aw I was hoping that our members wouldn't have that sort of potty mouth. Seriously, though, knock it off. Quote Link to comment https://forums.phpfreaks.com/topic/86309-paypal-paymentphp-ipnphp-help/#findComment-442249 Share on other sites More sharing options...
tinker Posted January 17, 2008 Share Posted January 17, 2008 learn the basics before doing something like this, it could cost you a lot of money! Quote Link to comment https://forums.phpfreaks.com/topic/86309-paypal-paymentphp-ipnphp-help/#findComment-442265 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.