Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 15 of 15
  1. #1
    New Coder
    Join Date
    Oct 2009
    Posts
    71
    Thanks
    16
    Thanked 0 Times in 0 Posts

    notify url problem for IPN

    Hi to all the great community here. I always get best help on this forum and thanks for such a honest and great support. Now my problem is concern to paypal i posted my problem there but from three days there is no reply and i cant move to develop my site until its not finish. My problem is i have setup a shopping cart and used IPN system with notify-url. i used paypal sandbox and when i purchase something as a customer i see the paypal hit my script in my server log but there is no result of its hitting as it should send me an email you will see below in code. both accounts are verified in sandbox and i have also setup IPN in profile. i can see the transaction complete status and upon purchase i receive email for merchant and buyer both in my sandbox. Please somebody help me i am stuck from three days and i really like the support here always i get . here is the code for my checkout page when a user will submit to paypal page:
    Code:
    <h2>Checkout</h2>
    
    <?php 
      if($_SESSION['cart'])
       {
    ?>
    <form action="index.php?view=update_cart" method="post">
    
    <table id="items">
      <thead>
         <tr>
            <th>Item</th>
             <th>Price</th>
             <th">Qty</th>
             <th>Subtotal</th>
           </tr>
        </thead>
       <tbody>
          <?php foreach($_SESSION['cart'] as $id => $qty): 
               $product = find_product($id);
           ?>
          <tr>
          <td><?php echo $product['title']; ?></td>
             <td>&pound;<?php echo number_format($product['price'],2); ?></td>
            <td><input type="text" size="2" name="<?php echo $id ?>" maxlength="2" value="<?php echo $qty; ?>" /></td>
             <td>&pound;<?php echo number_format($product['price'] * $qty, 2); ?></td>
          </tr>
          <?php endforeach; ?>
          </tbody>
       </table>   
       
        <p><input type="submit" name="update" value="update" /></p>
       
       </form>
       <form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
    <input type="hidden" name="cmd" value="_cart">
    <input type="hidden" name="upload" value="1">
    <input type="hidden" name="business" value="myemail@hotmail.com ">
    
    <?php 
      $i = 1;
      foreach($_SESSION['cart'] as $id => $qty): 
      $product = find_product($id);
    ?>
    
    <input type="hidden" name="item_name_<?php echo $i; ?>" value="<?php echo $product['title']; ?>">
    <input type="hidden" name="item_number_<?php echo $i; ?>" value="<?php echo $product['id']; ?>">
    <input type="hidden" name="amount_<?php echo $i; ?>" value="<?php echo $product['price']; ?>">
    <input type="hidden" name="quantity_<?php echo $i; ?>" value="<?php echo $qty; ?>">
    
    <?php 
      $i++;
      endforeach; 
    ?>
    <input type="hidden" name="currency_code" value="GBP">
    <input type="hidden" name="lc" value="GB">
    <input type="hidden" name="rm" value="2">
    <input type="hidden" name="shipping_1" value="2.50">
    <input type="hidden" name="return" value="http://www.mysite.com/includes/index.php?view=thankyou">
    <input type="hidden" name="cancel_return" value="http://www.mysite.com/">
    <input type="hidden" name="notify_url" value="http://www.mysite.com/includes/paypal.php">
    <input type="submit" name="pay now" value="pay" />
    </form>
    
    <?php 
       }
       else
       {
           echo '<p>your cart is empty... <a href="index.php">continue shopping</a></p>';
       }
    ?>
    and here is the code for my notify_url as paypal.php written above in my script for paypal to return there variables i can store in my database later on if it should work now just by sending an email.

    Code:
    <?php
    
     include('db_fns.php');
     
     $paypal_email = "myaccount_1255_biz@hotmail.com";
     $paypal_currency = 'GBP';
     $shipping = 2.50;
     
     
     
     function no_paypal_trans_id($trans_id)
     {
    	 $connection = db_connect();
    	 $query = sprintf("SELECT id from orders WHERE paypal_trans_id = '%s'",
    		                mysql_real_escape_string($trans_id));
    	 $result = mysql_query($query);
    	 
    	 $num_results = mysql_num_rows($result);
    	 
    	 if($num_results == 0)
    	 {
    		 return true; 
    	 }
    	
    	 return false;
    	 
     }
     
     function payment_amount_correct($shipping, $params)
     {
    	  $amount = 0.00;
    		
    		for ($i=1;  $i <= $params['num_cart_items']; $i++)
    		{
    		  $query = sprintf("SELECT price from booklist where id='%s'",
    			mysql_real_escape_string($params["item_number{$i}"]));
    			$result = mysql_query($query);
    			if($result)
    			{
    			  	$item_price = mysql_result($result, 0, 'price');
    			  $amount += $item_price * $params["quantity{$i}"];
    			}
    		}
    		
    		if(($amount+$shipping) == $params['mc_gross'])
    		{
    		  return true;	
    		}
    		else
    		{
    		  return false;	
    		}
       
     }
     
    
    // read the post from PayPal system and add 'cmd'
    $req = 'cmd=_notify-validate';
    
    foreach ($_POST as $key => $value) {
    $value = urlencode(stripslashes($value));
    $req .= "&$key=$value";
    }
    
    // post back to PayPal system to validate
    $header .= "POST /cgi-bin/webscr HTTP/1.0\r\n";
    $header .= "Content-Type: application/x-www-form-urlencoded\r\n";
    $header .= "Content-Length: " . strlen($req) . "\r\n\r\n";
    $fp = fsockopen ('www.sandbox.paypal.com', 80, $errno, $errstr, 30);
    
    // assign posted variables to local variables
    $item_name = $_POST['item_name'];
    $item_number = $_POST['item_number'];
    $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'];
    
    if (!$fp) {
    // HTTP ERROR
    } else {
    fputs ($fp, $header . $req);
    while (!feof($fp)) {
    $res = fgets ($fp, 1024);
    if (strcmp ($res, "VERIFIED") == 0) {
      
    	if ($_POST['payment_status'] == 'Completed' 
    		  && no_paypal_trans_id($_POST['txn_id']) 
    			&& $paypal_email == $_POST['receiver_email'] 
    			&& $paypal_currency == $_POST['mc_currency']
    			&& payment_amount_correct($shipping, $_POST)
    			)
    	{
    
    	$to      = 'myemail@hotmail.com';
    	$subject = 'the subject';
    	$message = 'hello it worked' .$req;
    	$headers = 'From: webmaster@example.com' . "\r\n" .
        'Reply-To: webmaster@example.com' . "\r\n" .
        'X-Mailer: PHP/' . phpversion();
    
    	mail($to, $subject, $message, $headers);
    	
    	  
    	}
    
    }
    else if (strcmp ($res, "INVALID") == 0) {
    // log for manual investigation
    }
    }
    fclose ($fp);
    }
    ?>
    as you see currently i am trying to send an email if the above gone well, and they do well as i can see in my sandbox test email and accounts . Please community help me .... i really appreciate and respect those who helped me before specially Phillip M... Thanks for some early response.

    Best Wishes

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,537
    Thanks
    8
    Thanked 1,093 Times in 1,084 Posts
    Let's take this in steps ....

    Step 1:
    Does the email part work all by itself?

    $to = 'myemail@hotmail.com';
    $subject = 'the subject';
    $message = 'hello it worked' .$req;
    $headers = 'From: webmaster@example.com' . "\r\n" .
    'Reply-To: webmaster@example.com' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

    mail($to, $subject, $message, $headers);


    Verify that it works by making a test script with just the email part.
    If it works, and you get an email, let us know.

    Then we'll proceed to step 2.

  • #3
    New Coder
    Join Date
    Oct 2009
    Posts
    71
    Thanks
    16
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by mlseim View Post
    Let's take this in steps ....

    Step 1:
    Does the email part work all by itself?

    $to = 'myemail@hotmail.com';
    $subject = 'the subject';
    $message = 'hello it worked' .$req;
    $headers = 'From: webmaster@example.com' . "\r\n" .
    'Reply-To: webmaster@example.com' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

    mail($to, $subject, $message, $headers);


    Verify that it works by making a test script with just the email part.
    If it works, and you get an email, let us know.

    Then we'll proceed to step 2.
    Thank you sir for reply i tried this and get email , created a simple file and saved as email.php and run in my browser and i get an email.

    <?php

    $to = 'myemail@hotmail.com';
    $subject = 'the subject';
    $message = 'hello it worked' .$req;
    $headers = 'From: webmaster@example.com' . "\r\n" .
    'Reply-To: webmaster@example.com' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

    mail($to, $subject, $message, $headers);
    ?>
    Last edited by Dshah; 10-14-2009 at 05:05 PM.

  • #4
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,537
    Thanks
    8
    Thanked 1,093 Times in 1,084 Posts
    Step 2:

    Take this part:
    PHP Code:
    if (strcmp ($res"VERIFIED") == 0) {
      
        if (
    $_POST['payment_status'] == 'Completed' 
              
    && no_paypal_trans_id($_POST['txn_id']) 
                && 
    $paypal_email == $_POST['receiver_email'
                && 
    $paypal_currency == $_POST['mc_currency']
                && 
    payment_amount_correct($shipping$_POST)
                )
        {

        
    $to      'myemail@hotmail.com';
        
    $subject 'the subject';
        
    $message 'hello it worked' .$req;
        
    $headers 'From: webmaster@example.com' "\r\n" .
        
    'Reply-To: webmaster@example.com' "\r\n" .
        
    'X-Mailer: PHP/' phpversion();

        
    mail($to$subject$message$headers);
        
          
        }


    and do this:
    PHP Code:
    if (strcmp ($res"VERIFIED") == 0) {
      
    echo 
    "EMAIL SENT - SIMULATED";
    exit;



    It shoudl display the simulated email sent and halt program.
    See if it gets to that part OK or not.

  • #5
    New Coder
    Join Date
    Oct 2009
    Posts
    71
    Thanks
    16
    Thanked 0 Times in 0 Posts
    sir nothing happen i edited and uploaded the script and run test again by Instant Payment Notification (IPN) simulator sending a ipn it says "
    IPN successfully sent. " but nothing happen and i tried just putting the file with above coding and execute but still nothing

  • #6
    New Coder
    Join Date
    Oct 2009
    Posts
    71
    Thanks
    16
    Thanked 0 Times in 0 Posts
    sir i can see in my server log that paypal is hitting my script when i submit any payment or test here are the details:

    Host: 216.113.191.33

    */includes/paypal.php
    Http Code: 200 Date: Oct 14 11:02:12 Http Version: HTTP/1.0 Size in Bytes: -
    Referer: -
    Agent: -

  • #7
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,537
    Thanks
    8
    Thanked 1,093 Times in 1,084 Posts
    OK,
    So now we know that it's never getting to that part of the script (the email part).

    You can put the email part back in and then we probe a different part.
    The idea is to find out where it's failing (or not reporting).

    So let's pick another part and see if you're getting to here.
    Add the part in red (just for testing) ... see if it gets to that spot.

    if (!$fp) {
    // HTTP ERROR
    } else {

    echo "TESTING";
    exit;


    fputs ($fp, $header . $req);
    while (!feof($fp)) {
    $res = fgets ($fp, 1024);
    if (strcmp ($res, "VERIFIED") == 0) {

  • #8
    New Coder
    Join Date
    Oct 2009
    Posts
    71
    Thanks
    16
    Thanked 0 Times in 0 Posts
    nothing again sir, i included the code

    echo "TESTING";
    exit;

    in my file and uploaded then run a test payment on paypal it shows again the ipn sent successfully, in server logs show that it hits the script as above but nothing happen.

  • #9
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,537
    Thanks
    8
    Thanked 1,093 Times in 1,084 Posts
    So you know it's not getting to that part ...

    That's the way you troubleshoot and debug a script. You insert various
    test points and display values of variables using echo to figure out why
    a portion does or does not execute.

    Take out the test and move it to another spot.

    You can see what I'm doing ... If you want, keep moving the
    test echo so you can figure out where the script is failing, or where
    it's not executing. You can do that on your own (faster than using
    this forum back and forth).

    Eventually, you'll see where the script executes and where it doesn't, and
    you'll discover the variable, comparison, or operational statement that is
    causing your problem.

  • #10
    New Coder
    Join Date
    Oct 2009
    Posts
    71
    Thanks
    16
    Thanked 0 Times in 0 Posts
    Thanks for your help sir, i did this on all the code but nothing happen, then i make a new script from here https://www.paypaltech.com/SG2/ for PHP and created a new database to include all those fields there. i run again the test from sandbox test tools, it show like always "IPN successfully sent. " but again nothing happen, this was totally a new script just to add in mysql database. i am struggling from four days now to solve it here is the new code i generated from that site :

    Code:
    <?php
    
    
    
    
    /////////////////////////////////////////////////
    /////////////Begin Script below./////////////////
    /////////////////////////////////////////////////
    
    // read the post from PayPal system and add 'cmd'
    $req = 'cmd=_notify-validate';
    foreach ($_POST as $key => $value) {
    $value = urlencode(stripslashes($value));
    $req .= "&$key=$value";
    }
    // post back to PayPal system to validate
    $header = "POST /cgi-bin/webscr HTTP/1.0\r\n";
    $header .= "Content-Type: application/x-www-form-urlencoded\r\n";
    $header .= "Content-Length: " . strlen($req) . "\r\n\r\n";
    
    // If testing on Sandbox use:
    //$fp = fsockopen ('ssl://www.sandbox.paypal.com', 443, $errno, $errstr, 30);
    
    $fp = fsockopen ('ssl://www.paypal.com', 443, $errno, $errstr, 30);
    
    
    // assign posted variables to local variables
    $item_name = $_POST['item_name'];
    $business = $_POST['business'];
    $item_number = $_POST['item_number'];
    $payment_status = $_POST['payment_status'];
    $mc_gross = $_POST['mc_gross'];
    $payment_currency = $_POST['mc_currency'];
    $txn_id = $_POST['txn_id'];
    $receiver_email = $_POST['receiver_email'];
    $receiver_id = $_POST['receiver_id'];
    $quantity = $_POST['quantity'];
    $num_cart_items = $_POST['num_cart_items'];
    $payment_date = $_POST['payment_date'];
    $first_name = $_POST['first_name'];
    $last_name = $_POST['last_name'];
    $payment_type = $_POST['payment_type'];
    $payment_status = $_POST['payment_status'];
    $payment_gross = $_POST['payment_gross'];
    $payment_fee = $_POST['payment_fee'];
    $settle_amount = $_POST['settle_amount'];
    $memo = $_POST['memo'];
    $payer_email = $_POST['payer_email'];
    $txn_type = $_POST['txn_type'];
    $payer_status = $_POST['payer_status'];
    $address_street = $_POST['address_street'];
    $address_city = $_POST['address_city'];
    $address_state = $_POST['address_state'];
    $address_zip = $_POST['address_zip'];
    $address_country = $_POST['address_country'];
    $address_status = $_POST['address_status'];
    $item_number = $_POST['item_number'];
    $tax = $_POST['tax'];
    $option_name1 = $_POST['option_name1'];
    $option_selection1 = $_POST['option_selection1'];
    $option_name2 = $_POST['option_name2'];
    $option_selection2 = $_POST['option_selection2'];
    $for_auction = $_POST['for_auction'];
    $invoice = $_POST['invoice'];
    $custom = $_POST['custom'];
    $notify_version = $_POST['notify_version'];
    $verify_sign = $_POST['verify_sign'];
    $payer_business_name = $_POST['payer_business_name'];
    $payer_id =$_POST['payer_id'];
    $mc_currency = $_POST['mc_currency'];
    $mc_fee = $_POST['mc_fee'];
    $exchange_rate = $_POST['exchange_rate'];
    $settle_currency  = $_POST['settle_currency'];
    $parent_txn_id  = $_POST['parent_txn_id'];
    $pending_reason = $_POST['pending_reason'];
    $reason_code = $_POST['reason_code'];
    
    
    // subscription specific vars
    
    $subscr_id = $_POST['subscr_id'];
    $subscr_date = $_POST['subscr_date'];
    $subscr_effective  = $_POST['subscr_effective'];
    $period1 = $_POST['period1'];
    $period2 = $_POST['period2'];
    $period3 = $_POST['period3'];
    $amount1 = $_POST['amount1'];
    $amount2 = $_POST['amount2'];
    $amount3 = $_POST['amount3'];
    $mc_amount1 = $_POST['mc_amount1'];
    $mc_amount2 = $_POST['mc_amount2'];
    $mc_amount3 = $_POST['mcamount3'];
    $recurring = $_POST['recurring'];
    $reattempt = $_POST['reattempt'];
    $retry_at = $_POST['retry_at'];
    $recur_times = $_POST['recur_times'];
    $username = $_POST['username'];
    $password = $_POST['password'];
    
    //auction specific vars
    
    $for_auction = $_POST['for_auction'];
    $auction_closing_date  = $_POST['auction_closing_date'];
    $auction_multi_item  = $_POST['auction_multi_item'];
    $auction_buyer_id  = $_POST['auction_buyer_id'];
    
    
    
    //DB connect creds and email 
    $notify_email =  "myemail@hotmail.com";         //email address to which debug emails are sent to
    $DB_Server = "localhost"; //your MySQL Server
    $DB_Username = "username"; //your MySQL User Name
    $DB_Password = "password"; //your MySQL Password
    $DB_DBName = "databasename"; //your MySQL Database Name
    
    
    if (!$fp) {
    // HTTP ERROR
    } else {
    fputs ($fp, $header . $req);
    while (!feof($fp)) {
    $res = fgets ($fp, 1024);
    if (strcmp ($res, "VERIFIED") == 0) {
    
    
    
    //create MySQL connection
    $Connect = @mysql_connect($DB_Server, $DB_Username, $DB_Password)
    or die("Couldn't connect to MySQL:<br>" . mysql_error() . "<br>" . mysql_errno());
    
    
    //select database
    $Db = @mysql_select_db($DB_DBName, $Connect)
    or die("Couldn't select database:<br>" . mysql_error(). "<br>" . mysql_errno());
    
    
    $fecha = date("m")."/".date("d")."/".date("Y");
    $fecha = date("Y").date("m").date("d");
    
    //check if transaction ID has been processed before
    $checkquery = "select txnid from paypal_payment_info where txnid='".$txn_id."'";
    $sihay = mysql_query($checkquery) or die("Duplicate txn id check query failed:<br>" . mysql_error() . "<br>" . mysql_errno());
    $nm = mysql_num_rows($sihay);
    if ($nm == 0){
    
    //execute query
    
    
    
        if ($txn_type == "cart"){
        $strQuery = "insert into paypal_payment_info(paymentstatus,buyer_email,firstname,lastname,street,city,state,zipcode,country,mc_gross,mc_fee,memo,paymenttype,paymentdate,txnid,pendingreason,reasoncode,tax,datecreation) values ('".$payment_status."','".$payer_email."','".$first_name."','".$last_name."','".$address_street."','".$address_city."','".$address_state."','".$address_zip."','".$address_country."','".$mc_gross."','".$mc_fee."','".$memo."','".$payment_type."','".$payment_date."','".$txn_id."','".$pending_reason."','".$reason_code."','".$tax."','".$fecha."')";
    
         $result = mysql_query($strQuery) or die("Cart - paypal_payment_info, Query failed:<br>" . mysql_error() . "<br>" . mysql_errno());
         for ($i = 1; $i <= $num_cart_items; $i++) {
             $itemname = "item_name".$i;
             $itemnumber = "item_number".$i;
             $on0 = "option_name1_".$i;
             $os0 = "option_selection1_".$i;
             $on1 = "option_name2_".$i;
             $os1 = "option_selection2_".$i;
             $quantity = "quantity".$i;
    
             $struery = "insert into paypal_cart_info(txnid,itemnumber,itemname,os0,on0,os1,on1,quantity,invoice,custom) values ('".$txn_id."','".$_POST[$itemnumber]."','".$_POST[$itemname]."','".$_POST[$on0]."','".$_POST[$os0]."','".$_POST[$on1]."','".$_POST[$os1]."','".$_POST[$quantity]."','".$invoice."','".$custom."')";
             $result = mysql_query($struery) or die("Cart - paypal_cart_info, Query failed:<br>" . mysql_error() . "<br>" . mysql_errno());
    
         }
        }
    
    
    
        else{
         $strQuery = "insert into paypal_payment_info(paymentstatus,buyer_email,firstname,lastname,street,city,state,zipcode,country,mc_gross,mc_fee,itemnumber,itemname,os0,on0,os1,on1,quantity,memo,paymenttype,paymentdate,txnid,pendingreason,reasoncode,tax,datecreation) values ('".$payment_status."','".$payer_email."','".$first_name."','".$last_name."','".$address_street."','".$address_city."','".$address_state."','".$address_zip."','".$address_country."','".$mc_gross."','".$mc_fee."','".$item_number."','".$item_name."','".$option_name1."','".$option_selection1."','".$option_name2."','".$option_selection2."','".$quantity."','".$memo."','".$payment_type."','".$payment_date."','".$txn_id."','".$pending_reason."','".$reason_code."','".$tax."','".$fecha."')";
         $result = mysql_query("insert into paypal_payment_info(paymentstatus,buyer_email,firstname,lastname,street,city,state,zipcode,country,mc_gross,mc_fee,itemnumber,itemname,os0,on0,os1,on1,quantity,memo,paymenttype,paymentdate,txnid,pendingreason,reasoncode,tax,datecreation) values ('".$payment_status."','".$payer_email."','".$first_name."','".$last_name."','".$address_street."','".$address_city."','".$address_state."','".$address_zip."','".$address_country."','".$mc_gross."','".$mc_fee."','".$item_number."','".$item_name."','".$option_name1."','".$option_selection1."','".$option_name2."','".$option_selection2."','".$quantity."','".$memo."','".$payment_type."','".$payment_date."','".$txn_id."','".$pending_reason."','".$reason_code."','".$tax."','".$fecha."')") or die("Default - paypal_payment_info, Query failed:<br>" . mysql_error() . "<br>" . mysql_errno());
        }
    
    
        // send an email in any case
     echo "Verified";
         mail($notify_email, "VERIFIED IPN", "$res\n $req\n $strQuery\n $struery\n  $strQuery2");
    }
    else {
    // send an email
    mail($notify_email, "VERIFIED DUPLICATED TRANSACTION", "$res\n $req \n $strQuery\n $struery\n  $strQuery2");
    }
    
        //subscription handling branch
        if ( $txn_type == "subscr_signup"  ||  $txn_type == "subscr_payment"  ) {
    
          // insert subscriber payment info into paypal_payment_info table
          $strQuery = "insert into paypal_payment_info(paymentstatus,buyer_email,firstname,lastname,street,city,state,zipcode,country,mc_gross,mc_fee,memo,paymenttype,paymentdate,txnid,pendingreason,reasoncode,tax,datecreation) values ('".$payment_status."','".$payer_email."','".$first_name."','".$last_name."','".$address_street."','".$address_city."','".$address_state."','".$address_zip."','".$address_country."','".$mc_gross."','".$mc_fee."','".$memo."','".$payment_type."','".$payment_date."','".$txn_id."','".$pending_reason."','".$reason_code."','".$tax."','".$fecha."')";
          $result = mysql_query($strQuery) or die("Subscription - paypal_payment_info, Query failed:<br>" . mysql_error() . "<br>" . mysql_errno());
    
    
             // insert subscriber info into paypal_subscription_info table
            $strQuery2 = "insert into paypal_subscription_info(subscr_id , sub_event, subscr_date ,subscr_effective,period1,period2, period3, amount1 ,amount2 ,amount3,  mc_amount1,  mc_amount2,  mc_amount3, recurring, reattempt,retry_at, recur_times, username ,password, payment_txn_id, subscriber_emailaddress, datecreation) values ('".$subscr_id."', '".$txn_type."','".$subscr_date."','".$subscr_effective."','".$period1."','".$period2."','".$period3."','".$amount1."','".$amount2."','".$amount3."','".$mc_amount1."','".$mc_amount2."','".$mc_amount3."','".$recurring."','".$reattempt."','".$retry_at."','".$recur_times."','".$username."','".$password."', '".$txn_id."','".$payer_email."','".$fecha."')";
            $result = mysql_query($strQuery2) or die("Subscription - paypal_subscription_info, Query failed:<br>" . mysql_error() . "<br>" . mysql_errno());
    
    
                 mail($notify_email, "VERIFIED IPN", "$res\n $req\n $strQuery\n $struery\n  $strQuery2");
    
        }
    }
    
    // if the IPN POST was 'INVALID'...do this
    
    
    else if (strcmp ($res, "INVALID") == 0) {
    // log for manual investigation
    
    mail($notify_email, "INVALID IPN", "$res\n $req");
    }
    }
    fclose ($fp);
    }
    ?>
    it should work if not mine but it is also failing nothing happens, i feel so stuck help

  • #11
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,537
    Thanks
    8
    Thanked 1,093 Times in 1,084 Posts
    Maybe on the PayPal side, it's not returning back to the proper script on your site?
    Go onto PayPal and see where the response is supposed to return.
    I think you need to specify the URL (the URL, path, and name of your script) where
    it will return after the transaction. Do you know what I mean?

  • #12
    New Coder
    Join Date
    Oct 2009
    Posts
    71
    Thanks
    16
    Thanked 0 Times in 0 Posts
    yes sir i know if you checked my first post i had specify those entries but now i am trying to make a manual account and waiting for there verification maybe its some regional thing. I will let you know the updates ... thanks

  • #13
    New to the CF scene
    Join Date
    Oct 2009
    Location
    london
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by mlseim View Post
    Let's take this in steps ....

    Step 1:
    Does the email part work all by itself?

    $to = 'myemail@hotmail.com';
    $subject = 'the subject';
    $message = 'hello it worked' .$req;
    $headers = 'From: webmaster@example.com' . "\r\n" .
    'Reply-To: webmaster@example.com' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

    mail($to, $subject, $message, $headers);


    Verify that it works by making a test script with just the email part.
    If it works, and you get an email, let us know.

    Then we'll proceed to step 2.
    this email model checking is so perfection !

  • #14
    New Coder
    Join Date
    Oct 2009
    Posts
    71
    Thanks
    16
    Thanked 0 Times in 0 Posts
    Hello mlseim i have solved the issue i needed to use cURL method instead of fsockopen, and i think there was not any problem in my code if fosckopen could work on host server, and my shopping cart is now fully working with paypal integration. Thanks for the help

  • #15
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,537
    Thanks
    8
    Thanked 1,093 Times in 1,084 Posts
    You know ...
    I didn't think of that.

    I've seen that some webhosts only allow CURL (instead of fopen),
    but it didn't come to my mind until you mentioned it.

    Glad you got it working.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •