Shades Posted August 16, 2019 Share Posted August 16, 2019 Hello, so I just need a simple IPN for me to credit an item. If anyone has an example or would be able to help would be amazing! So with my donator page people would be able to purchase the item however there is different options for different quantity’s however it’s the same item if that makes sense Quote Link to comment Share on other sites More sharing options...
sniko Posted August 18, 2019 Share Posted August 18, 2019 What payment processor are you needing integration with? Once you figure that out, look at their documentation. Quote Link to comment Share on other sites More sharing options...
Lithium Posted August 21, 2019 Share Posted August 21, 2019 IPN is the standard name for Paypal (Instant Payment Notification), if not mistaken, and they do supply a simple IPN sample.https://developer.paypal.com/docs/classic/ipn/integration-guide/IPNIntro/ Quote Link to comment Share on other sites More sharing options...
Djkanna Posted August 27, 2019 Share Posted August 27, 2019 (edited) Could be Stripe, or any payment merchant ( or whatever they're known as ) - IPN isn't specific to PayPal. On the same note: Stripe IPN: https://github.com/denis-dima/stripe-ipn ? (nb: No idea on the code quality/working, just first thing on Google... ) Edited August 27, 2019 by Djkanna Quote Link to comment Share on other sites More sharing options...
KingKong Posted August 28, 2019 Share Posted August 28, 2019 For mccodes? My developer made me an IPN for mccodes if that interests you. Quote Link to comment Share on other sites More sharing options...
Shades Posted September 18, 2019 Author Share Posted September 18, 2019 So below is my donator page. I need it for Paypal. Finding it difficult to understand the IPN. Can anyone help? Quote Link to comment Share on other sites More sharing options...
Alan Posted September 20, 2019 Share Posted September 20, 2019 IPN is very simple - Paypal can make life rather tricky however as the documentation often varies from the actual code and in fact the sandbox api has been known to differ from the production api making testing potentially expensive. There's certainly a couple of peeps here how could implement this for you in double-quick time; and/or point you in the right direction. You state that you are finding to difficult to understand .. exactly what aspect? https://developer.paypal.com/docs/classic/ipn/ht-ipn/ Makes things reasonably clear though it may not be the architecture you require. Quote Link to comment Share on other sites More sharing options...
Shades Posted September 29, 2019 Author Share Posted September 29, 2019 Willing to pay £20 for whoever makes me an secured IPN Quote Link to comment Share on other sites More sharing options...
Shades Posted October 5, 2019 Author Share Posted October 5, 2019 (edited) Coding for donate page - $enableSandbox = true; $paypalUrl = $enableSandbox ? 'https://www.sandbox.paypal.com/cgi-bin/webscr' : 'https://www.paypal.com/cgi-bin/webscr'; ?> <form action="<?php echo $paypalUrl; ?>" method="post"> <input type=hidden name=cmd value=_xclick> <input type="hidden" name="business" value="<?php echo $set['paypal'];?>"> <input type="hidden" name="item_name" value="<?php echo $set['game_name'];?>|<?php echo $r['userid'];?>DP|1|"> <input type="hidden" name="amount" value="5.00"> <input type="hidden" name="no_shipping" value="1"> <input type="hidden" name="return" value="http://localhost/Game/payments.php?action=done&type=standard"> <input type="hidden" name="cancel_return" value="http://localhost/Game/payments.php?action=cancel"> <input type="hidden" name="userid" value="<?php echo $set['userid'];?>"> <input type="hidden" name="qty" value="1"> <input type="hidden" name="currency_code" value="GBP"> <input type="hidden" name="tax" value="0"> <input type="image" src="images/paypal.png" alt="Donate £5.00" name="submit" > </form> Coding for payments.php - <?php require('globals_nonauth.php'); header('HTTP/1.1 200 OK'); $resp = 'cmd=_notify-validate'; foreach ($_POST as $parm => $var) { $var = urlencode(stripslashes($var)); $resp .= "&$parm=$var"; } $item_name = $_POST['item_name']; $payment_status = $_POST['payment_status']; $payment_amount = $_POST['mc_gross']; $payment_currency = $_POST['mc_currency']; $txn_id = $_POST['txn_id']; $receiver_email = $_POST['receiver_email']; $payer_email = $_POST['payer_email']; $qty = $_POST['qty']; $httphead = "POST /cgi-bin/webscr HTTP/1.0\r\n"; $httphead .= "Content-Type: application/x-www-form-urlencoded\r\n"; $httphead .= "Content-Length: " . strlen($resp) . "\r\n\r\n"; $errno =''; $errstr =''; $fh = fsockopen ('ssl://www.paypal.com', 443, $errno, $errstr, 30); if (!$fh) { } else { fputs ($fh, $httphead . $resp); while (!feof($fh)) { $readresp = fgets ($fh, 1024); if (strcmp ($readresp, "VERIFIED") == 0) { item_add($_POST['userid'], 1, $_POST['qty']); } else if (strcmp ($readresp, "INVALID") == 0) { echo "Bye"; } } fclose ($fh); } ?> Still doesn't work? What am I doing wrong. Can someone please help. Edited October 5, 2019 by Shades Quote Link to comment Share on other sites More sharing options...
Shades Posted October 9, 2019 Author Share Posted October 9, 2019 did the community die? Quote Link to comment Share on other sites More sharing options...
AdamHull Posted October 9, 2019 Share Posted October 9, 2019 (edited) Are you facing any errors? Is your PayPal set up correctly? Edited October 9, 2019 by adamhull Quote Link to comment Share on other sites More sharing options...
Samurai Legend Posted November 4, 2019 Share Posted November 4, 2019 Does anyone have a working IPN? Quote Link to comment 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.