diff --git a/htdocs/langs/en_US/paypal.lang b/htdocs/langs/en_US/paypal.lang
index 61a92f21960..9dad0e3b14e 100644
--- a/htdocs/langs/en_US/paypal.lang
+++ b/htdocs/langs/en_US/paypal.lang
@@ -15,4 +15,5 @@ ThisIsTransactionId=This is id of transaction: %s
PAYPAL_ADD_PAYMENT_URL=Add the url of Paypal payment when you send a document by mail
PAYPAL_IPN_MAIL_ADDRESS=E-mail address for the instant notification of payment (IPN)
PredefinedMailContentSendOrderWithPaypalLink=You will find here the order __ORDERREF__\n\nYou can click on the secure link below to make your payment via PayPal\n\n%s\n\nSincerely\n\n
-PredefinedMailContentSendInvoiceWithPaypalLink=You will find here the invoice __FACREF__\n\nYou can click on the secure link below to make your payment via PayPal\n\n%s\n\nSincerely\n\n
\ No newline at end of file
+PredefinedMailContentSendInvoiceWithPaypalLink=You will find here the invoice __FACREF__\n\nYou can click on the secure link below to make your payment via PayPal\n\n%s\n\nSincerely\n\n
+YouAreCurrentlyInSandboxMode=You are currently in the "sandbox" mode
\ No newline at end of file
diff --git a/htdocs/langs/fr_FR/paypal.lang b/htdocs/langs/fr_FR/paypal.lang
index a55313f69db..3d60d57c104 100644
--- a/htdocs/langs/fr_FR/paypal.lang
+++ b/htdocs/langs/fr_FR/paypal.lang
@@ -15,4 +15,5 @@ ThisIsTransactionId=Voici l'identifiant de la transaction: %s
PAYPAL_ADD_PAYMENT_URL=Ajouter l'url de paiement Paypal lors de l'envoi d'un document par mail
PAYPAL_IPN_MAIL_ADDRESS=Adresse e-mail pour les notifications instantanées de paiement (IPN)
PredefinedMailContentSendOrderWithPaypalLink=Bonjour\nVeuillez trouver ci-joint la commande __ORDERREF__\n\nVous pouvez cliquer sur le lien sécurisé ci-dessous pour effectuer votre paiement via Paypal\n\n%s\n\nCordialement\n\n
-PredefinedMailContentSendInvoiceWithPaypalLink=Bonjour\nVeuillez trouver ci-joint la facture __FACREF__\n\nVous pouvez cliquer sur le lien sécurisé ci-dessous pour effectuer votre paiement via Paypal\n\n%s\n\nCordialement\n\n
\ No newline at end of file
+PredefinedMailContentSendInvoiceWithPaypalLink=Bonjour\nVeuillez trouver ci-joint la facture __FACREF__\n\nVous pouvez cliquer sur le lien sécurisé ci-dessous pour effectuer votre paiement via Paypal\n\n%s\n\nCordialement\n\n
+YouAreCurrentlyInSandboxMode=Vous êtes actuellement dans le mode "sandbox"
\ No newline at end of file
diff --git a/htdocs/paypal/admin/paypal.php b/htdocs/paypal/admin/paypal.php
index e54ad7f30c8..cf254f1de30 100644
--- a/htdocs/paypal/admin/paypal.php
+++ b/htdocs/paypal/admin/paypal.php
@@ -1,8 +1,8 @@
- * Copyright (C) 2005-2011 Laurent Destailleur
- * Copyright (C) 2011 Regis Houssin
- * Copyright (C) 2011 Juanjo Menent
+/* Copyright (C) 2004 Rodolphe Quiedeville
+ * Copyright (C) 2005-2011 Laurent Destailleur
+ * Copyright (C) 2011-2012 Regis Houssin
+ * Copyright (C) 2011 Juanjo Menent
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/htdocs/paypal/lib/paypal.lib.php b/htdocs/paypal/lib/paypal.lib.php
index fd68f7f274d..02100b3c3da 100755
--- a/htdocs/paypal/lib/paypal.lib.php
+++ b/htdocs/paypal/lib/paypal.lib.php
@@ -1,6 +1,6 @@
- * Copyright (C) 2011 Regis Houssin
+/* Copyright (C) 2008-2012 Laurent Destailleur
+ * Copyright (C) 2011-2012 Regis Houssin
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -55,6 +55,28 @@ function llxHeaderPaypal($title, $head = "")
print '.CTableRow2 { margin: 1px; padding: 3px; font: 12px verdana,arial; background: #FFFFFF; color: #000000; -moz-border-radius-topleft:6px; -moz-border-radius-topright:6px; -moz-border-radius-bottomleft:6px; -moz-border-radius-bottomright:6px;}';
print '';
}
+
+ if ($conf->use_javascript_ajax)
+ {
+ print ''."\n";
+ print ''."\n"; // JNotify
+
+ // Output standard javascript links
+ $ext='.js';
+ if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x01)) {
+ $ext='.jgz';
+ } // mini='_mini', ext='.gz'
+
+ // JQuery. Must be before other includes
+ print ''."\n";
+ print ''."\n";
+ // jQuery jnotify
+ if (empty($conf->global->MAIN_DISABLE_JQUERY_JNOTIFY))
+ {
+ print ''."\n";
+ print ''."\n";
+ }
+ }
print "\n";
print ''."\n";
}
@@ -207,7 +229,11 @@ function getPaypalPaymentUrl($mode,$type,$ref='',$amount='9.99',$freetag='your_f
if ($type == 'free')
{
$out=DOL_MAIN_URL_ROOT.'/public/paypal/newpayment.php?amount='.($mode?'':'').$amount.($mode?'':'').'&tag='.($mode?'':'').$freetag.($mode?'':'');
- if (! empty($conf->global->PAYPAL_SECURITY_TOKEN)) $out.='&securekey='.$conf->global->PAYPAL_SECURITY_TOKEN;
+ if (! empty($conf->global->PAYPAL_SECURITY_TOKEN))
+ {
+ if (empty($conf->global->PAYPAL_SECURITY_TOKEN_UNIQUE)) $out.='&securekey='.$conf->global->PAYPAL_SECURITY_TOKEN;
+ else $out.='&securekey='.dol_hash($conf->global->PAYPAL_SECURITY_TOKEN, 2);
+ }
}
if ($type == 'order')
{
diff --git a/htdocs/public/paypal/newpayment.php b/htdocs/public/paypal/newpayment.php
index 714b89e39b6..a3a82583bcd 100755
--- a/htdocs/public/paypal/newpayment.php
+++ b/htdocs/public/paypal/newpayment.php
@@ -1,7 +1,7 @@
- * Copyright (C) 2006-2011 Laurent Destailleur
- * Copyright (C) 2009-2011 Regis Houssin
+/* Copyright (C) 2001-2002 Rodolphe Quiedeville
+ * Copyright (C) 2006-2011 Laurent Destailleur
+ * Copyright (C) 2009-2012 Regis Houssin
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -236,6 +236,10 @@ if (GETPOST("action") == 'dopayment')
llxHeaderPaypal($langs->trans("PaymentForm"));
+if (! empty($PAYPAL_API_SANDBOX))
+{
+ dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode'),'','warning');
+}
// Common variables
$creditor=$mysoc->name;