Shades Posted August 16, 2019 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
sniko Posted August 18, 2019 Posted August 18, 2019 What payment processor are you needing integration with? Once you figure that out, look at their documentation. Quote
Lithium Posted August 21, 2019 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
Djkanna Posted August 27, 2019 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
KingKong Posted August 28, 2019 Posted August 28, 2019 For mccodes? My developer made me an IPN for mccodes if that interests you. Quote
Shades Posted September 18, 2019 Author 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
Alan Posted September 20, 2019 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
Shades Posted September 29, 2019 Author Posted September 29, 2019 Willing to pay £20 for whoever makes me an secured IPN Quote
Shades Posted October 5, 2019 Author 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
AdamHull Posted October 9, 2019 Posted October 9, 2019 (edited) Are you facing any errors? Is your PayPal set up correctly? Edited October 9, 2019 by adamhull Quote
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.