Paypal IPN help!

Discussion in 'PHP' started by Dmak02, Mar 2, 2009.

  1. #1
    I have paypal IPN setup, but I am trying to have it check for a submitted value in the mysql to see if it exists. If not, then it wouldn't go through, but if it doesn't it goes to paypal page. Please pm me!
     
    Dmak02, Mar 2, 2009 IP
  2. facebook

    facebook Well-Known Member

    Messages:
    390
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    140
    Digital Goods:
    1
    #2
    Is this still open?
     
    facebook, Mar 2, 2009 IP
  3. Vooler

    Vooler Well-Known Member

    Messages:
    1,146
    Likes Received:
    64
    Best Answers:
    4
    Trophy Points:
    150
    #3
    There are severl fields that paypal posts to your IPN script.
    To keep each payment entry unique use txn_id.

    you didn't tell about exact value that you wish to compare, am using txn_id for purpose of example:

    
    $txn_id = htmlspecialchars($_POST['txn_id']);
    $res = mysql_query("select * from <TABLE_NAME> where txn_id='$txn_id'");
    
    if(mysql_numr_rows($res) == 0) {
         #entry not found ......
    } else {
         #ENTRY FOUND
    }
    
    Code (markup):
     
    Vooler, Mar 3, 2009 IP