PDT OR IPN the notification service does not work as attented

Noisettine
Contributor
Contributor

This is my form

 

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="business" value="<?php echo getPaiements('paypal_account'); ?>" />
<input type="hidden" name="item_name" value="Commande no<?php echo $order_id; ?>*<?php echo getInfo("enseigne"); ?>" />
<input type="hidden" name="amount" value="<?php echo $amount; ?>" />
<input type="hidden" name="no_shipping" value="1" />
<input type="hidden" name="no_note" value="0" />
<input type="hidden" name="currency_code" value="EUR" />
<input type="hidden" name="email" value="<?php echo $client['email_fact']; ?>" />
<input type="hidden" name="first_name" value="<?php echo $client['prenom_fact']; ?>" />
<input type="hidden" name="last_name" value="<?php echo $client['nom_fact']; ?>" />
<input type="hidden" name="address1" value="<?php echo $client['adressel1_fact']; ?>" />
<input type="hidden" name="address2" value="<?php echo $client['adressel2_fact']; ?>" />
<input type="hidden" name="city" value="<?php echo $client['ville_fact']; ?>" />
<input type="hidden" name="state" value="<?php echo $client['region_fact']; ?>" />
<input type="hidden" name="zip" value="<?php echo $client['codepostal_fact']; ?>" />
<input type="hidden" name="return" value="<?php echo $bout['url_boutique']; ?>merci.php" />
<input type="hidden" name="cancel_return" value="<?php echo $bout['url_boutique']; ?>erreur.php" />
<input type="hidden" name="notify_url" value="<?php echo $bout['url_boutique']; ?>paypal.php" />
<input type="hidden" name="custom" value="<?php echo md5($customer_id); ?>" />
<input type="hidden" name="invoice" value="<?php echo md5($caddie); ?>" />
<input type="hidden" name="num_paiement" value="<?php echo $num_paiement; ?>" />
<input type="hidden" name="bn" value="IC_Sample">
</form>

 

If i ask IPN service, after about 2 or 3 paiements, IPN stops and send a message prevent disabling IPN and it's always annoying to ask my customers to re-activate the IPN notificaton.

 

NOW, I know, I can use notify_url but it seems not to be operationnal under certain circumstances. (Paypal Accounts, etc)

 

Can you please guide me to use properly the notify_url service ?

 

Thanks

 

File that handle the IPN Contains

<?php

// 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 ('ssl://www.paypal.com', 443, $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'];
$customer_id    = $_POST['custom'];
$caddie = $_POST['invoice'];
$num_paiement = $_POST['num_paiement'];
//
if (!$fp) {
    // HTTP ERROR
} else {
    fputs ($fp, $header . $req);
    while (!feof($fp)) {
        $res = fgets ($fp, 1024);
        if (strcmp ($res, "VERIFIED") == 0) {

// Blah Blah validating locally

}

}

}

 

And it works like a charm.

I can't understand why IPN notifications are automatically disabled.

 

Thanks again for reading

Login to Me Too
0 REPLIES 0

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.