Bonjour je me suis aider de cette page:
<lien>https://www.paypaltech.com/SG2/scriptparse.php</lien>

pour faire ma page ipn avec email

mais comme apres une semaine je ne comprend toujours pk je ne recoit aucun POST sur ma page.

Pour securite on m'avait conseiler d enregistrer la commande apres validation du paiement chez paypal sur ma page IPN, mais comme je peux pas faire autrement.

Comment pourrai je securiser au mieux le traitement.

1) confirmer la commande insertion commande dans ma BDD.
2)redirection sur paypal avec paiment.
3) redirection dur mon site avec reponse de confirmation de commande.

Je voudrai securiser ces etapes au mieux auriez vosu des conseils?

MON CODE QUI FONCTIONNE PAS:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
 
<form action="https://www.sandbox.paypal.com/fr/cgi-bin/webscr" method="POST">
 
<img alt="" border="0" src="https://www.paypal.com/fr_FR/i/scr/pixel.gif" width="1" height="1">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="my.bab_1324302424_biz@gmail.com">
<input type="hidden" name="item_name_1" value="mon objet">
<input type="hidden" name="item_number_1" value="6">
<input type="hidden" name="custom" value="22">
<input type="hidden" name="amount_1" value="15.00">
<input type="hidden" name="no_shipping" value="0">
<input name="return" type="text" value="http://www.webcreation66.com/mybabylove/test3.php" />
<input name="cancel_return" type="text" value="http://www.webcreation66.com/mybabylove/test3.php" />
<input name="notify_url" type="text" value="http://www.webcreation66.com/mybabylove/test3.php" />
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="lc" value="FR">
 
<input type="image" src=" <lien url="https://www.paypal.com/fr_FR/i/bnr/horizontal_solution_PP.gif">https://www.paypal.com/fr_FR/i/bnr/horizontal_solution_PP.gif</lien>
border="0" name="submit" alt="Paiement sécurisé par carte bancaire"/>
</form>

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
 
<?php
// Revision Notes
// 11/04/11 - changed post back url from <lien>https://www.paypal.com/cgi-bin/webscr</lien> to <lien>https://ipnpb.paypal.com/cgi-bin/webscr</lien>
// For more info see below:
// <lien url="https://www.x.com/content/bulletin-ip-address-expansion-paypal-services">https://www.x.com/content/bulletin-ip-address-expansion-paypal-services</lien>
// "ACTION REQUIRED: if you are using IPN (Instant Payment Notification) for Order Management and your IPN listener script is behind a firewall that uses ACL (Access Control List) rules which restrict outbound traffic to a limited number of IP addresses, then you may need to do one of the following: 
// To continue posting back to <lien>https://www.paypal.com</lien>  to perform IPN validation you will need to update your firewall ACL to allow outbound access to *any* IP address for the servers that host your IPN script
// OR Alternatively, you will need to modify  your IPN script to post back IPNs to the newly created URL <lien>https://ipnpb.paypal.com</lien> using HTTPS (port 443) and update firewall ACL rules to allow outbound access to the ipnpb.paypal.com IP ranges (see end of message)."
 
 
// 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";
 
	// If testing on Sandbox use: 
	 $header .= "Host: www.sandbox.paypal.com:443\r\n";
//$header .= "Host: ipnpb.paypal.com:443\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://ipnpb.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 = "my.babylove66140@gmail.com";
$payer_email = $_POST['payer_email'];
 
//set email variables
$From_email = "From: <a href="mailto:my.babylove66140@gmail.com">my.babylove66140@gmail.com</a>";
$Subject_line = "SUBJ";
 
$email_msg = "TEXT";
$email_msg .= "\n\nThe details of your order are as follows:";
$email_msg .= "\n\n" . "Transaction ID: " .  $txn_id ;
$email_msg .= "\n" . "Payment Date: " . $payment_date;
 
if (!$fp) {
// HTTP ERROR
} else {
fputs ($fp, $header . $req);
while (!feof($fp)) {
$res = fgets ($fp, 1024);
if (strcmp ($res, "VERIFIED") == 0) {
// check the payment_status is Completed
// check that txn_id has not been previously processed
// check that receiver_email is your Primary PayPal email
// check that payment_amount/payment_currency are correct
// process payment
 
$mail_From = $From_email;
$mail_To = $payer_email;
$mail_Subject = $Subject_line;
$mail_Body = $email_msg;
 
mail($mail_To, $mail_Subject, $mail_Body, $mail_From);
 
 
}
else if (strcmp ($res, "INVALID") == 0) {
// log for manual investigation
 
$mail_From = $From_email;
$mail_To = $receiver_email;
$mail_Subject = "INVALID IPN POST";
$mail_Body = "INVALID IPN POST. The raw POST string is below.\n\n" . $req;
 
mail($mail_To, $mail_Subject, $mail_Body, $mail_From);
 
}
}
fclose ($fp);
}
?>
le recoit un email mais aucun post j'ai ce message dans l'email:
INVALID IPN POST cmd=_notify-validate.


Merci.