Skip to content
Snippets Groups Projects
Commit 7d05be54 authored by Regis Houssin's avatar Regis Houssin
Browse files

Fix: regression

parent d19a756e
No related branches found
No related tags found
No related merge requests found
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
/** \file htdocs/paypal/admin/paypal.php /** \file htdocs/paypal/admin/paypal.php
* \ingroup paypal * \ingroup paypal
* \brief Page to setup paypal module * \brief Page to setup paypal module
* \version $Id: paypal.php,v 1.20 2011/07/08 08:30:49 hregis Exp $ * \version $Id: paypal.php,v 1.21 2011/07/08 18:08:27 hregis Exp $
*/ */
require("../../main.inc.php"); require("../../main.inc.php");
...@@ -52,7 +52,6 @@ if ($_POST["action"] == 'setvalue' && $user->admin) ...@@ -52,7 +52,6 @@ if ($_POST["action"] == 'setvalue' && $user->admin)
$result=dolibarr_set_const($db, "PAYPAL_API_INTEGRAL_OR_PAYPALONLY",$_POST["PAYPAL_API_INTEGRAL_OR_PAYPALONLY"],'chaine',0,'',$conf->entity); $result=dolibarr_set_const($db, "PAYPAL_API_INTEGRAL_OR_PAYPALONLY",$_POST["PAYPAL_API_INTEGRAL_OR_PAYPALONLY"],'chaine',0,'',$conf->entity);
$result=dolibarr_set_const($db, "PAYPAL_CSS_URL",$_POST["PAYPAL_CSS_URL"],'chaine',0,'',$conf->entity); $result=dolibarr_set_const($db, "PAYPAL_CSS_URL",$_POST["PAYPAL_CSS_URL"],'chaine',0,'',$conf->entity);
$result=dolibarr_set_const($db, "PAYPAL_SECURITY_TOKEN",$_POST["PAYPAL_SECURITY_TOKEN"],'chaine',0,'',$conf->entity); $result=dolibarr_set_const($db, "PAYPAL_SECURITY_TOKEN",$_POST["PAYPAL_SECURITY_TOKEN"],'chaine',0,'',$conf->entity);
$result=dolibarr_set_const($db, "PAYPAL_IPN_MAIL_ADDRESS",$_POST["PAYPAL_IPN_MAIL_ADDRESS"],'chaine',0,'',$conf->entity);
$result=dolibarr_set_const($db, "PAYPAL_ADD_PAYMENT_URL",$_POST["PAYPAL_ADD_PAYMENT_URL"],'chaine',0,'',$conf->entity); $result=dolibarr_set_const($db, "PAYPAL_ADD_PAYMENT_URL",$_POST["PAYPAL_ADD_PAYMENT_URL"],'chaine',0,'',$conf->entity);
$result=dolibarr_set_const($db, "PAYPAL_MESSAGE_OK",$_POST["PAYPAL_MESSAGE_OK"],'chaine',0,'',$conf->entity); $result=dolibarr_set_const($db, "PAYPAL_MESSAGE_OK",$_POST["PAYPAL_MESSAGE_OK"],'chaine',0,'',$conf->entity);
$result=dolibarr_set_const($db, "PAYPAL_MESSAGE_KO",$_POST["PAYPAL_MESSAGE_KO"],'chaine',0,'',$conf->entity); $result=dolibarr_set_const($db, "PAYPAL_MESSAGE_KO",$_POST["PAYPAL_MESSAGE_KO"],'chaine',0,'',$conf->entity);
...@@ -175,12 +174,6 @@ print '<input size="64" type="text" name="PAYPAL_CSS_URL" value="'.$conf->global ...@@ -175,12 +174,6 @@ print '<input size="64" type="text" name="PAYPAL_CSS_URL" value="'.$conf->global
print ' &nbsp; '.$langs->trans("Example").': http://mysite/mycss.css'; print ' &nbsp; '.$langs->trans("Example").': http://mysite/mycss.css';
print '</td></tr>'; print '</td></tr>';
$var=!$var;
print '<tr '.$bc[$var].'><td>';
print $langs->trans("PAYPAL_IPN_MAIL_ADDRESS").'</td><td>';
print '<input size="64" type="text" name="PAYPAL_IPN_MAIL_ADDRESS" value="'.$conf->global->PAYPAL_IPN_MAIL_ADDRESS.'">';
print '</td></tr>';
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'><td>'; print '<tr '.$bc[$var].'><td>';
print $langs->trans("SecurityToken").'</td><td>'; print $langs->trans("SecurityToken").'</td><td>';
...@@ -269,5 +262,5 @@ print info_admin($langs->trans("YouCanAddTagOnUrl")); ...@@ -269,5 +262,5 @@ print info_admin($langs->trans("YouCanAddTagOnUrl"));
$db->close(); $db->close();
llxFooter('$Date: 2011/07/08 08:30:49 $ - $Revision: 1.20 $'); llxFooter('$Date: 2011/07/08 18:08:27 $ - $Revision: 1.21 $');
?> ?>
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
* Send an e-mail when the seller has received a Paypal payment. * Send an e-mail when the seller has received a Paypal payment.
* If the transaction is OK, PayPal has the script connects and sends data, then the script sends an e-mail summarizing the seller. * If the transaction is OK, PayPal has the script connects and sends data, then the script sends an e-mail summarizing the seller.
* Add the URL of the script during the creation of a Paypal button or the preferences of his Paypal account was: Preferences Instant Payment Notification. * Add the URL of the script during the creation of a Paypal button or the preferences of his Paypal account was: Preferences Instant Payment Notification.
* \version $Id: ipn.php,v 1.1 2011/07/08 08:30:50 hregis Exp $ * \version $Id: ipn.php,v 1.2 2011/07/08 18:08:28 hregis Exp $
*/ */
if (! defined('NOLOGIN')) define("NOLOGIN",1); // This means this output page does not require to be logged. if (! defined('NOLOGIN')) define("NOLOGIN",1); // This means this output page does not require to be logged.
...@@ -44,11 +44,6 @@ if (! empty($conf->paypal->enabled) && ! empty($conf->global->PAYPAL_IPN_MAIL_AD ...@@ -44,11 +44,6 @@ if (! empty($conf->paypal->enabled) && ! empty($conf->global->PAYPAL_IPN_MAIL_AD
$langs->load("main"); $langs->load("main");
$langs->load("other"); $langs->load("other");
// From
$from = $conf->global->PAYPAL_IPN_MAIL_ADDRESS;
// To
$sendto = $conf->global->PAYPAL_IPN_MAIL_ADDRESS;
// read the post from PayPal system and add 'cmd' // read the post from PayPal system and add 'cmd'
$req = 'cmd=_notify-validate'; $req = 'cmd=_notify-validate';
...@@ -70,9 +65,19 @@ if (! empty($conf->paypal->enabled) && ! empty($conf->global->PAYPAL_IPN_MAIL_AD ...@@ -70,9 +65,19 @@ if (! empty($conf->paypal->enabled) && ! empty($conf->global->PAYPAL_IPN_MAIL_AD
// HTTP ERROR // HTTP ERROR
} else { } else {
fputs ($fp, $header . $req); fputs ($fp, $header . $req);
while (!feof($fp)) { while (!feof($fp))
{
$res = fgets ($fp, 1024); $res = fgets ($fp, 1024);
if (strcmp ($res, "VERIFIED") == 0) { if (strcmp ($res, "VERIFIED") == 0)
{
// From
$from = GETPOST('receiver_email','',2);
// To
$sendto = GETPOST('payer_email','',2);
// CC
$sendtocc = GETPOST('receiver_email','',2);
// Send mail // Send mail
// TODO add translation // TODO add translation
...@@ -136,6 +141,12 @@ if (! empty($conf->paypal->enabled) && ! empty($conf->global->PAYPAL_IPN_MAIL_AD ...@@ -136,6 +141,12 @@ if (! empty($conf->paypal->enabled) && ! empty($conf->global->PAYPAL_IPN_MAIL_AD
} }
else if (strcmp ($res, "INVALID") == 0) else if (strcmp ($res, "INVALID") == 0)
{ {
// From
$from = GETPOST('receiver_email','',2);
// To
$sendto = GETPOST('receiver_email','',2);
// Envoi d'un mail si invalide // Envoi d'un mail si invalide
$subject = "[PAYPAL] Paiement PAYPAL NON VALIDE"; $subject = "[PAYPAL] Paiement PAYPAL NON VALIDE";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment