'."\n";
if (! empty($conf->paypal->enabled))
{
- if ($PAYPALTOKEN)
+ if ($paymentmethod == 'paypal')
{
- // Get on url call
- $onlinetoken = $PAYPALTOKEN;
- $fulltag = $FULLTAG;
- $payerID = $PAYPALPAYERID;
- // Set by newpayment.php
- $paymentType = $_SESSION['PaymentType'];
- $currencyCodeType = $_SESSION['currencyCodeType'];
- $FinalPaymentAmt = $_SESSION["Payment_Amount"];
- // From env
- $ipaddress = $_SESSION['ipaddress'];
-
- dol_syslog("Call paymentok with token=".$onlinetoken." paymentType=".$paymentType." currencyCodeType=".$currencyCodeType." payerID=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt." fulltag=".$fulltag, LOG_DEBUG, 0, '_paypal');
-
- // Validate record
- if (! empty($paymentType))
- {
- dol_syslog("We call GetExpressCheckoutDetails", LOG_DEBUG, 0, '_payment');
- $resArray=getDetails($onlinetoken);
- //var_dump($resarray);
-
- dol_syslog("We call DoExpressCheckoutPayment token=".$onlinetoken." paymentType=".$paymentType." currencyCodeType=".$currencyCodeType." payerID=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt." fulltag=".$fulltag, LOG_DEBUG, 0, '_payment');
- $resArray=confirmPayment($onlinetoken, $paymentType, $currencyCodeType, $payerID, $ipaddress, $FinalPaymentAmt, $fulltag);
-
- $ack = strtoupper($resArray["ACK"]);
- if ($ack=="SUCCESS" || $ack=="SUCCESSWITHWARNING")
- {
- $object->source = $source;
- $object->ref = $ref;
- $object->payerID = $payerID;
- $object->fulltag = $fulltag;
- $object->resArray = $resArray;
-
- // resArray was built from a string like that
- // TOKEN=EC%2d1NJ057703V9359028&TIMESTAMP=2010%2d11%2d01T11%3a40%3a13Z&CORRELATIONID=1efa8c6a36bd8&ACK=Success&VERSION=56&BUILD=1553277&TRANSACTIONID=9B994597K9921420R&TRANSACTIONTYPE=expresscheckout&PAYMENTTYPE=instant&ORDERTIME=2010%2d11%2d01T11%3a40%3a12Z&AMT=155%2e57&FEEAMT=5%2e54&TAXAMT=0%2e00&CURRENCYCODE=EUR&PAYMENTSTATUS=Completed&PENDINGREASON=None&REASONCODE=None
- $PAYMENTSTATUS=urldecode($resArray["PAYMENTSTATUS"]); // Should contains 'Completed'
- $TRANSACTIONID=urldecode($resArray["TRANSACTIONID"]);
- $TAXAMT=urldecode($resArray["TAXAMT"]);
- $NOTE=urldecode($resArray["NOTE"]);
+ if ($PAYPALTOKEN)
+ {
+ // Get on url call
+ $onlinetoken = $PAYPALTOKEN;
+ $fulltag = $FULLTAG;
+ $payerID = $PAYPALPAYERID;
+ // Set by newpayment.php
+ $paymentType = $_SESSION['PaymentType'];
+ $currencyCodeType = $_SESSION['currencyCodeType'];
+ $FinalPaymentAmt = $_SESSION["FinalPaymentAmt"];
+ // From env
+ $ipaddress = $_SESSION['ipaddress'];
- $ispaymentok=True;
- }
- else
- {
- //Display a user friendly Error on the page using any of the following error information returned by PayPal
- $ErrorCode = urldecode($resArray["L_ERRORCODE0"]);
- $ErrorShortMsg = urldecode($resArray["L_SHORTMESSAGE0"]);
- $ErrorLongMsg = urldecode($resArray["L_LONGMESSAGE0"]);
- $ErrorSeverityCode = urldecode($resArray["L_SEVERITYCODE0"]);
- }
- }
- else
- {
- dol_print_error('','Session expired');
- }
+ dol_syslog("Call paymentok with token=".$onlinetoken." paymentType=".$paymentType." currencyCodeType=".$currencyCodeType." payerID=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt." fulltag=".$fulltag, LOG_DEBUG, 0, '_paypal');
+
+ // Validate record
+ if (! empty($paymentType))
+ {
+ dol_syslog("We call GetExpressCheckoutDetails", LOG_DEBUG, 0, '_payment');
+ $resArray=getDetails($onlinetoken);
+ //var_dump($resarray);
+
+ dol_syslog("We call DoExpressCheckoutPayment token=".$onlinetoken." paymentType=".$paymentType." currencyCodeType=".$currencyCodeType." payerID=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt." fulltag=".$fulltag, LOG_DEBUG, 0, '_payment');
+ $resArray=confirmPayment($onlinetoken, $paymentType, $currencyCodeType, $payerID, $ipaddress, $FinalPaymentAmt, $fulltag);
+
+ $ack = strtoupper($resArray["ACK"]);
+ if ($ack=="SUCCESS" || $ack=="SUCCESSWITHWARNING")
+ {
+ $object->source = $source;
+ $object->ref = $ref;
+ $object->payerID = $payerID;
+ $object->fulltag = $fulltag;
+ $object->resArray = $resArray;
+
+ // resArray was built from a string like that
+ // TOKEN=EC%2d1NJ057703V9359028&TIMESTAMP=2010%2d11%2d01T11%3a40%3a13Z&CORRELATIONID=1efa8c6a36bd8&ACK=Success&VERSION=56&BUILD=1553277&TRANSACTIONID=9B994597K9921420R&TRANSACTIONTYPE=expresscheckout&PAYMENTTYPE=instant&ORDERTIME=2010%2d11%2d01T11%3a40%3a12Z&AMT=155%2e57&FEEAMT=5%2e54&TAXAMT=0%2e00&CURRENCYCODE=EUR&PAYMENTSTATUS=Completed&PENDINGREASON=None&REASONCODE=None
+ $PAYMENTSTATUS=urldecode($resArray["PAYMENTSTATUS"]); // Should contains 'Completed'
+ $TRANSACTIONID=urldecode($resArray["TRANSACTIONID"]);
+ $TAXAMT=urldecode($resArray["TAXAMT"]);
+ $NOTE=urldecode($resArray["NOTE"]);
+
+ $ispaymentok=True;
+ }
+ else
+ {
+ //Display a user friendly Error on the page using any of the following error information returned by PayPal
+ $ErrorCode = urldecode($resArray["L_ERRORCODE0"]);
+ $ErrorShortMsg = urldecode($resArray["L_SHORTMESSAGE0"]);
+ $ErrorLongMsg = urldecode($resArray["L_LONGMESSAGE0"]);
+ $ErrorSeverityCode = urldecode($resArray["L_SEVERITYCODE0"]);
+ }
+ }
+ else
+ {
+ dol_print_error('','Session expired');
+ }
+ }
+ else
+ {
+ dol_print_error('','$PAYPALTOKEN not defined');
+ }
}
- else
- {
- dol_print_error('','$PAYPALTOKEN not defined');
- }
}
+if (! empty($conf->paybox->enabled))
+{
+ if ($paymentmethod == 'paybox') $ispaymentok = true; // We call this page only if payment is ok
+}
+
+if (! empty($conf->stripe->enabled))
+{
+ if ($paymentmethod == 'stripe') $ispaymentok = true; // We call this page only if payment is ok
+}
if ($ispaymentok)
@@ -240,10 +237,11 @@ if ($ispaymentok)
// Set by newpayment.php
$paymentType = $_SESSION['PaymentType'];
$currencyCodeType = $_SESSION['currencyCodeType'];
- $FinalPaymentAmt = $_SESSION["Payment_Amount"];
+ $FinalPaymentAmt = $_SESSION["FinalPaymentAmt"];
// From env
$ipaddress = $_SESSION['ipaddress'];
-
+ $TRANSACTIONID = $_SESSION['TRANSACTIONID'];
+
// Appel des triggers
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($db);
@@ -251,18 +249,14 @@ if ($ispaymentok)
if ($result < 0) { $error++; $errors=$interface->errors; }
// Fin appel triggers
-
+
print $langs->trans("YourPaymentHasBeenRecorded")."
\n";
print $langs->trans("ThisIsTransactionId",$TRANSACTIONID)."
\n";
- if (! empty($conf->global->PAYMENT_MESSAGE_OK)) print $conf->global->PAYMENT_MESSAGE_OK;
-
+ if (! empty($conf->global->ONLINE_PAYMENT_MESSAGE_OK)) print $conf->global->ONLINE_PAYMENT_MESSAGE_OK;
+
$sendemail = '';
- if (! empty($conf->global->PAYMENTONLINE_SENDEMAIL)) $sendemail=$conf->global->PAYMENTONLINE_SENDEMAIL;
- // TODO Remove local option to keep only the generic one ?
- if ($paymentmethod == 'paypal' && ! empty($conf->global->PAYPAL_PAYONLINE_SENDEMAIL)) $sendemail=$conf->global->PAYPAL_PAYONLINE_SENDEMAIL;
- if ($paymentmethod == 'paybox' && ! empty($conf->global->PAYBOX_PAYONLINE_SENDEMAIL)) $sendemail=$conf->global->PAYBOX_PAYONLINE_SENDEMAIL;
- if ($paymentmethod == 'stripe' && ! empty($conf->global->STRIPE_PAYONLINE_SENDEMAIL)) $sendemail=$conf->global->STRIPE_PAYONLINE_SENDEMAIL;
-
+ if (! empty($conf->global->ONLINE_PAYMENT_SENDEMAIL)) $sendemail=$conf->global->ONLINE_PAYMENT_SENDEMAIL;
+
// Send an email
if ($sendemail)
{
@@ -285,7 +279,7 @@ if ($ispaymentok)
else $appli.=" ".DOL_VERSION;
}
else $appli.=" ".DOL_VERSION;
-
+
$urlback=$_SERVER["REQUEST_URI"];
$topic='['.$appli.'] '.$langs->transnoentitiesnoconv("NewOnlinePaymentReceived");
$tmptag=dolExplodeIntoArray($fulltag,'.','=');
@@ -333,33 +327,33 @@ else
// Set by newpayment.php
$paymentType = $_SESSION['PaymentType'];
$currencyCodeType = $_SESSION['currencyCodeType'];
- $FinalPaymentAmt = $_SESSION["Payment_Amount"];
+ $FinalPaymentAmt = $_SESSION["FinalPaymentAmt"];
// From env
$ipaddress = $_SESSION['ipaddress'];
-
+
// Appel des triggers
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($db);
$result=$interface->run_triggers('PAYMENTONLINE_PAYMENT_KO',$object,$user,$langs,$conf);
if ($result < 0) { $error++; $errors=$interface->errors; }
// Fin appel triggers
-
+
print $langs->trans('DoExpressCheckoutPaymentAPICallFailed') . "
\n";
print $langs->trans('DetailedErrorMessage') . ": " . $ErrorLongMsg."
\n";
print $langs->trans('ShortErrorMessage') . ": " . $ErrorShortMsg."
\n";
print $langs->trans('ErrorCode') . ": " . $ErrorCode."
\n";
print $langs->trans('ErrorSeverityCode') . ": " . $ErrorSeverityCode."
\n";
-
+
if ($mysoc->email) print "\nPlease, send a screenshot of this page to ".$mysoc->email."
\n";
-
+
$sendemail = '';
if (! empty($conf->global->PAYMENTONLINE_SENDEMAIL)) $sendemail=$conf->global->PAYMENTONLINE_SENDEMAIL;
// TODO Remove local option to keep only the generic one ?
if ($paymentmethod == 'paypal' && ! empty($conf->global->PAYPAL_PAYONLINE_SENDEMAIL)) $sendemail=$conf->global->PAYPAL_PAYONLINE_SENDEMAIL;
if ($paymentmethod == 'paybox' && ! empty($conf->global->PAYBOX_PAYONLINE_SENDEMAIL)) $sendemail=$conf->global->PAYBOX_PAYONLINE_SENDEMAIL;
if ($paymentmethod == 'stripe' && ! empty($conf->global->STRIPE_PAYONLINE_SENDEMAIL)) $sendemail=$conf->global->STRIPE_PAYONLINE_SENDEMAIL;
-
+
// Send an email
if ($sendemail)
{
@@ -369,7 +363,7 @@ else
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root));
$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
-
+
// Define link to login card
$appli=constant('DOL_APPLICATION_TITLE');
if (! empty($conf->global->MAIN_APPLICATION_TITLE))
@@ -382,7 +376,7 @@ else
else $appli.=" ".DOL_VERSION;
}
else $appli.=" ".DOL_VERSION;
-
+
$urlback=$_SERVER["REQUEST_URI"];
$topic='['.$appli.'] '.$langs->transnoentitiesnoconv("ValidationOfPaymentFailed");
$content="";
@@ -392,12 +386,12 @@ else
$content.=$langs->transnoentitiesnoconv("OnlinePaymentSystem").': '.$paymentmethod."\n";
$content.=$langs->transnoentitiesnoconv("ReturnURLAfterPayment").': '.$urlback."\n";
$content.="tag=".$fulltag."\ntoken=".$onlinetoken." paymentType=".$paymentType." currencycodeType=".$currencyCodeType." payerId=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt;
-
+
$ishtml=dol_textishtml($content); // May contain urls
-
+
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
$mailfile = new CMailFile($topic, $sendto, $from, $content, array(), array(), array(), '', '', 0, $ishtml);
-
+
$result=$mailfile->sendfile();
if ($result)
{
diff --git a/htdocs/public/paypal/newpayment.php b/htdocs/public/paypal/newpayment.php
index 65fbfbd38a7..8616d434e38 100644
--- a/htdocs/public/paypal/newpayment.php
+++ b/htdocs/public/paypal/newpayment.php
@@ -3,9 +3,9 @@
* Copyright (C) 2006-2017 Laurent Destailleur
* Copyright (C) 2009-2012 Regis Houssin
*
- * This program is free software: you can redistribute it and/or modify
+ * 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
- * the Free Software Foundation, either version 3 of the License, or
+ * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
@@ -16,7 +16,8 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*
- * For test: https://developer.paypal.com/
+ * For paypal test: https://developer.paypal.com/
+ * For paybox test: ???
*/
/**
@@ -242,7 +243,7 @@ if (GETPOST('action','aZ09') == 'dopayment')
dol_syslog("SCRIPT_URI: ".(empty($_SERVER["SCRIPT_URI"])?'':$_SERVER["SCRIPT_URI"]), LOG_DEBUG); // If defined script uri must match domain of PAYPAL_API_OK and PAYPAL_API_KO
//$_SESSION["PaymentType"]=$PAYPAL_PAYMENT_TYPE;
//$_SESSION["currencyCodeType"]=$PAYPAL_API_DEVISE;
- //$_SESSION["Payment_Amount"]=$PAYPAL_API_PRICE;
+ //$_SESSION["FinalPaymentAmt"]=$PAYPAL_API_PRICE;
// A redirect is added if API call successfull
print_paypal_redirect($PAYPAL_API_PRICE,$PAYPAL_API_DEVISE,$PAYPAL_PAYMENT_TYPE,$PAYPAL_API_OK,$PAYPAL_API_KO, $FULLTAG);
@@ -258,7 +259,7 @@ if (GETPOST('action','aZ09') == 'dopayment')
*/
$head='';
-if (! empty($conf->global->PAYPAL_CSS_URL)) $head=''."\n";
+if (! empty($conf->global->ONLINE_PAYMENT_CSS_URL)) $head=''."\n";
$conf->dol_hide_topmenu=1;
$conf->dol_hide_leftmenu=1;
@@ -267,9 +268,9 @@ llxHeader($head, $langs->trans("PaymentForm"), '', '', 0, 0, '', '', '', 'online
// Common variables
$creditor=$mysoc->name;
-$paramcreditor='PAYPAL_CREDITOR_'.$suffix;
+$paramcreditor='ONLINE_PAYMENT_CREDITOR_'.$suffix;
if (! empty($conf->global->$paramcreditor)) $creditor=$conf->global->$paramcreditor;
-else if (! empty($conf->global->PAYPAL_CREDITOR)) $creditor=$conf->global->PAYPAL_CREDITOR;
+else if (! empty($conf->global->ONLINE_PAYMENT_CREDITOR)) $creditor=$conf->global->ONLINE_PAYMENT_CREDITOR;
// Check link validity
if (! empty($SOURCE) && in_array($ref, array('member_ref', 'contractline_ref', 'invoice_ref', 'order_ref', '')))
@@ -306,14 +307,14 @@ print "\n";
print ''."\n";
-// Show logo (search order: logo defined by PAYBOX_LOGO_suffix, then PAYBOX_LOGO, then small company logo, large company logo, theme logo, common logo)
+// Show logo (search order: logo defined by PAYMENT_LOGO_suffix, then PAYMENT_LOGO, then small company logo, large company logo, theme logo, common logo)
$width=0;
// Define logo and logosmall
$logosmall=$mysoc->logo_small;
$logo=$mysoc->logo;
-$paramlogo='PAYBOX_LOGO_'.$suffix;
+$paramlogo='PAYMENT_LOGO_'.$suffix;
if (! empty($conf->global->$paramlogo)) $logosmall=$conf->global->$paramlogo;
-else if (! empty($conf->global->PAYBOX_LOGO)) $logosmall=$conf->global->PAYBOX_LOGO;
+else if (! empty($conf->global->PAYMENT_LOGO)) $logosmall=$conf->global->PAYMENT_LOGO;
//print ''."\n";
// Define urllogo
$urllogo='';
@@ -338,11 +339,11 @@ if ($urllogo)
// Output introduction text
$text='';
-if (! empty($conf->global->PAYPAL_NEWFORM_TEXT))
+if (! empty($conf->global->PAYMENT_NEWFORM_TEXT))
{
$langs->load("members");
- if (preg_match('/^\((.*)\)$/',$conf->global->PAYPAL_NEWFORM_TEXT,$reg)) $text.=$langs->trans($reg[1])."
\n";
- else $text.=$conf->global->PAYPAL_NEWFORM_TEXT."
\n";
+ if (preg_match('/^\((.*)\)$/',$conf->global->PAYMENT_NEWFORM_TEXT,$reg)) $text.=$langs->trans($reg[1])."
\n";
+ else $text.=$conf->global->PAYMENT_NEWFORM_TEXT."
\n";
$text=' '.$text.'
|
'."\n";
}
if (empty($text))
diff --git a/htdocs/public/paypal/paymentko.php b/htdocs/public/paypal/paymentko.php
index f7dd0cf6eeb..aff6509e390 100644
--- a/htdocs/public/paypal/paymentko.php
+++ b/htdocs/public/paypal/paymentko.php
@@ -91,7 +91,7 @@ if (! empty($_SESSION['ipaddress'])) // To avoid to make action twice
// Set by newpayment.php
$paymentType = $_SESSION['PaymentType'];
$currencyCodeType = $_SESSION['currencyCodeType'];
- $FinalPaymentAmt = $_SESSION["Payment_Amount"];
+ $FinalPaymentAmt = $_SESSION["FinalPaymentAmt"];
// From env
$ipaddress = $_SESSION['ipaddress'];
@@ -104,7 +104,7 @@ if (! empty($_SESSION['ipaddress'])) // To avoid to make action twice
// Send an email
$sendemail = '';
- if (! empty($conf->global->PAYPAL_PAYONLINE_SENDEMAIL)) $sendemail=$conf->global->PAYPAL_PAYONLINE_SENDEMAIL;
+ if (! empty($conf->global->ONLINE_PAYMENT_SENDEMAIL)) $sendemail=$conf->global->ONLINE_PAYMENT_SENDEMAIL;
if ($sendemail)
{
@@ -153,7 +153,7 @@ if (! empty($_SESSION['ipaddress'])) // To avoid to make action twice
$head='';
-if (! empty($conf->global->PAYPAL_CSS_URL)) $head=''."\n";
+if (! empty($conf->global->ONLINE_PAYMENT_CSS_URL)) $head=''."\n";
$conf->dol_hide_topmenu=1;
$conf->dol_hide_leftmenu=1;
@@ -166,7 +166,7 @@ print ''."\n";
print ''."\n";
print $langs->trans("YourPaymentHasNotBeenRecorded")."
";
-if (! empty($conf->global->PAYPAL_MESSAGE_KO)) print $conf->global->PAYPAL_MESSAGE_KO;
+if (! empty($conf->global->ONLINE_PAYMENT_MESSAGE_KO)) print $conf->global->ONLINE_PAYMENT_MESSAGE_KO;
print "\n
\n";
diff --git a/htdocs/public/paypal/paymentok.php b/htdocs/public/paypal/paymentok.php
index e52a79057f4..ec0ba7df46e 100644
--- a/htdocs/public/paypal/paymentok.php
+++ b/htdocs/public/paypal/paymentok.php
@@ -114,7 +114,7 @@ dol_syslog("POST=".$tracepost, LOG_DEBUG, 0, '_paypal');
$head='';
-if (! empty($conf->global->PAYPAL_CSS_URL)) $head=''."\n";
+if (! empty($conf->global->ONLINE_PAYMENT_CSS_URL)) $head=''."\n";
$conf->dol_hide_topmenu=1;
$conf->dol_hide_leftmenu=1;
@@ -135,7 +135,7 @@ if ($PAYPALTOKEN)
// Set by newpayment.php
$paymentType = $_SESSION['PaymentType'];
$currencyCodeType = $_SESSION['currencyCodeType'];
- $FinalPaymentAmt = $_SESSION["Payment_Amount"];
+ $FinalPaymentAmt = $_SESSION["FinalPaymentAmt"];
// From env
$ipaddress = $_SESSION['ipaddress'];
@@ -170,7 +170,7 @@ if ($PAYPALTOKEN)
print $langs->trans("YourPaymentHasBeenRecorded")."
\n";
print $langs->trans("ThisIsTransactionId",$TRANSACTIONID)."
\n";
- if (! empty($conf->global->PAYPAL_MESSAGE_OK)) print $conf->global->PAYPAL_MESSAGE_OK;
+ if (! empty($conf->global->ONLINE_PAYMENT_MESSAGE_OK)) print $conf->global->ONLINE_PAYMENT_MESSAGE_OK;
// Appel des triggers
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
@@ -180,9 +180,9 @@ if ($PAYPALTOKEN)
// Fin appel triggers
// Send an email
- if (! empty($conf->global->PAYPAL_PAYONLINE_SENDEMAIL))
+ if (! empty($conf->global->ONLINE_PAYMENT_SENDEMAIL))
{
- $sendto=$conf->global->PAYPAL_PAYONLINE_SENDEMAIL;
+ $sendto=$conf->global->ONLINE_PAYMENT_SENDEMAIL;
$from=$conf->global->MAILING_EMAIL_FROM;
// Define $urlwithroot
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root));
@@ -201,7 +201,7 @@ if ($PAYPALTOKEN)
else $appli.=" ".DOL_VERSION;
}
else $appli.=" ".DOL_VERSION;
-
+
$urlback=$_SERVER["REQUEST_URI"];
$topic='['.$appli.'] '.$langs->transnoentitiesnoconv("NewOnlinePaymentReceived");
$tmptag=dolExplodeIntoArray($fulltag,'.','=');
@@ -248,7 +248,7 @@ if ($PAYPALTOKEN)
$result=$interface->run_triggers('PAYPAL_PAYMENT_KO',$object,$user,$langs,$conf);
if ($result < 0) { $error++; $errors=$interface->errors; }
// Fin appel triggers
-
+
//Display a user friendly Error on the page using any of the following error information returned by PayPal
$ErrorCode = urldecode($resArray["L_ERRORCODE0"]);
$ErrorShortMsg = urldecode($resArray["L_SHORTMESSAGE0"]);
@@ -264,9 +264,9 @@ if ($PAYPALTOKEN)
if ($mysoc->email) echo "\nPlease, send a screenshot of this page to ".$mysoc->email."
\n";
// Send an email
- if (! empty($conf->global->PAYPAL_PAYONLINE_SENDEMAIL))
+ if (! empty($conf->global->ONLINE_PAYMENT_SENDEMAIL))
{
- $sendto=$conf->global->PAYPAL_PAYONLINE_SENDEMAIL;
+ $sendto=$conf->global->ONLINE_PAYMENT_SENDEMAIL;
$from=$conf->global->MAILING_EMAIL_FROM;
// Define $urlwithroot
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root));
@@ -285,7 +285,7 @@ if ($PAYPALTOKEN)
else $appli.=" ".DOL_VERSION;
}
else $appli.=" ".DOL_VERSION;
-
+
$urlback=$_SERVER["REQUEST_URI"];
$topic='['.$appli.'] '.$langs->transnoentitiesnoconv("ValidationOfPaymentFailed");
$content="";
diff --git a/htdocs/public/stripe/newpayment.php b/htdocs/public/stripe/newpayment.php
index 962185b8397..259c78f72b5 100644
--- a/htdocs/public/stripe/newpayment.php
+++ b/htdocs/public/stripe/newpayment.php
@@ -183,9 +183,9 @@ if (! empty($conf->global->STRIPE_SECURITY_TOKEN))
// Common variables
$creditor=$mysoc->name;
-$paramcreditor='STRIPE_CREDITOR_'.$suffix;
+$paramcreditor='ONLINE_PAYMENT_CREDITOR_'.$suffix;
if (! empty($conf->global->$paramcreditor)) $creditor=$conf->global->$paramcreditor;
-else if (! empty($conf->global->STRIPE_CREDITOR)) $creditor=$conf->global->STRIPE_CREDITOR;
+else if (! empty($conf->global->ONLINE_PAYMENT_CREDITOR)) $creditor=$conf->global->ONLINE_PAYMENT_CREDITOR;
@@ -297,7 +297,7 @@ if ($action == 'charge')
}
$_SESSION["onlinetoken"] = $stripeToken;
- $_SESSION["Payment_Amount"] = $amount;
+ $_SESSION["FinalPaymentAmt"] = $amount;
$_SESSION["currencyCodeType"] = $currency;
$_SESSION["paymentType"] = '';
$_SESSION['ipaddress'] = $_SERVER['REMOTE_ADDR']; // Payer ip
@@ -328,7 +328,7 @@ if ($action == 'charge')
*/
$head='';
-if (! empty($conf->global->STRIPE_CSS_URL)) $head=''."\n";
+if (! empty($conf->global->ONLINE_PAYMENT_CSS_URL)) $head=''."\n";
$conf->dol_hide_topmenu=1;
$conf->dol_hide_leftmenu=1;
@@ -369,14 +369,14 @@ print "\n";
print ''."\n";
-// Show logo (search order: logo defined by PAYBOX_LOGO_suffix, then PAYBOX_LOGO, then small company logo, large company logo, theme logo, common logo)
+// Show logo (search order: logo defined by PAYMENT_LOGO_suffix, then PAYMENT_LOGO, then small company logo, large company logo, theme logo, common logo)
$width=0;
// Define logo and logosmall
$logosmall=$mysoc->logo_small;
$logo=$mysoc->logo;
-$paramlogo='STRIPE_LOGO_'.$suffix;
+$paramlogo='PAYMENT_LOGO_'.$suffix;
if (! empty($conf->global->$paramlogo)) $logosmall=$conf->global->$paramlogo;
-else if (! empty($conf->global->STRIPE_LOGO)) $logosmall=$conf->global->STRIPE_LOGO;
+else if (! empty($conf->global->PAYMENT_LOGO)) $logosmall=$conf->global->PAYMENT_LOGO;
//print ''."\n";
// Define urllogo
$urllogo='';
@@ -401,11 +401,11 @@ if ($urllogo)
// Output introduction text
$text='';
-if (! empty($conf->global->STRIPE_NEWFORM_TEXT))
+if (! empty($conf->global->PAYMENT_NEWFORM_TEXT))
{
$langs->load("members");
- if (preg_match('/^\((.*)\)$/',$conf->global->STRIPE_NEWFORM_TEXT,$reg)) $text.=$langs->trans($reg[1])."
\n";
- else $text.=$conf->global->STRIPE_NEWFORM_TEXT."
\n";
+ if (preg_match('/^\((.*)\)$/',$conf->global->PAYMENT_NEWFORM_TEXT,$reg)) $text.=$langs->trans($reg[1])."
\n";
+ else $text.=$conf->global->PAYMENT_NEWFORM_TEXT."
\n";
$text=' '.$text.'
|
'."\n";
}
if (empty($text))
diff --git a/htdocs/public/stripe/paymentko.php b/htdocs/public/stripe/paymentko.php
index 01000939b37..c3c8672eb84 100644
--- a/htdocs/public/stripe/paymentko.php
+++ b/htdocs/public/stripe/paymentko.php
@@ -82,24 +82,24 @@ if (! empty($_SESSION['ipaddress'])) // To avoid to make action twice
$paymentType = $_SESSION['paymentType'];
$FinalPaymentAmt = $_SESSION['FinalPaymentAmt'];
$ipaddress = $_SESSION['ipaddress'];
-
+
// Appel des triggers
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($db);
$result=$interface->run_triggers('STRIPE_PAYMENT_KO',$object,$user,$langs,$conf);
if ($result < 0) { $error++; $errors=$interface->errors; }
// Fin appel triggers
-
+
// Send an email
$sendemail = '';
- if (! empty($conf->global->PAYPAL_PAYONLINE_SENDEMAIL)) $sendemail=$conf->global->PAYPAL_PAYONLINE_SENDEMAIL;
-
+ if (! empty($conf->global->ONLINE_PAYMENT_SENDEMAIL)) $sendemail=$conf->global->ONLINE_PAYMENT_SENDEMAIL;
+
if ($sendemail)
{
// Get on url call
$sendto=$sendemail;
$from=$conf->global->MAILING_EMAIL_FROM;
-
+
// Define link to login card
$appli=constant('DOL_APPLICATION_TITLE');
if (! empty($conf->global->MAIN_APPLICATION_TITLE))
@@ -112,7 +112,7 @@ if (! empty($_SESSION['ipaddress'])) // To avoid to make action twice
else $appli.=" ".DOL_VERSION;
}
else $appli.=" ".DOL_VERSION;
-
+
$urlback=$_SERVER["REQUEST_URI"];
$topic='['.$appli.'] '.$langs->transnoentitiesnoconv("NewOnlinePaymentFailed");
$content="";
@@ -124,7 +124,7 @@ if (! empty($_SESSION['ipaddress'])) // To avoid to make action twice
$content.="tag=".$fulltag."\ntoken=".$onlinetoken." paymentType=".$paymentType." currencycodeType=".$currencyCodeType." payerId=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt;
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
$mailfile = new CMailFile($topic, $sendto, $from, $content);
-
+
$result=$mailfile->sendfile();
if ($result)
{
@@ -140,7 +140,7 @@ if (! empty($_SESSION['ipaddress'])) // To avoid to make action twice
}
$head='';
-if (! empty($conf->global->STRIPE_CSS_URL)) $head=''."\n";
+if (! empty($conf->global->ONLINE_PAYMENT_CSS_URL)) $head=''."\n";
$conf->dol_hide_topmenu=1;
$conf->dol_hide_leftmenu=1;
@@ -153,7 +153,7 @@ print ''."\n";
print ''."\n";
print $langs->trans("YourPaymentHasNotBeenRecorded")."
";
-if (! empty($conf->global->STRIPE_MESSAGE_KO)) print $conf->global->STRIPE_MESSAGE_KO;
+if (! empty($conf->global->ONLINE_PAYMENT_MESSAGE_KO)) print $conf->global->ONLINE_PAYMENT_MESSAGE_KO;
print "\n
\n";
diff --git a/htdocs/public/stripe/paymentok.php b/htdocs/public/stripe/paymentok.php
index 4eede2e9544..1b8854c2de1 100644
--- a/htdocs/public/stripe/paymentok.php
+++ b/htdocs/public/stripe/paymentok.php
@@ -82,7 +82,7 @@ foreach($_POST as $k => $v) $tracepost .= "{$k} - {$v}\n";
dol_syslog("POST=".$tracepost, LOG_DEBUG, 0, '_stripe');
$head='';
-if (! empty($conf->global->STRIPE_CSS_URL)) $head=''."\n";
+if (! empty($conf->global->ONLINE_PAYMENT_CSS_URL)) $head=''."\n";
$conf->dol_hide_topmenu=1;
$conf->dol_hide_leftmenu=1;
@@ -105,7 +105,7 @@ if ($ispaymentok)
// Set by newpayment.php
$paymentType = $_SESSION['PaymentType'];
$currencyCodeType = $_SESSION['currencyCodeType'];
- $FinalPaymentAmt = $_SESSION["Payment_Amount"];
+ $FinalPaymentAmt = $_SESSION["FinalPaymentAmt"];
// From env
$ipaddress = $_SESSION['ipaddress'];
$TRANSACTIONID = $_SESSION['TRANSACTIONID'];
@@ -117,14 +117,14 @@ if ($ispaymentok)
if ($result < 0) { $error++; $errors=$interface->errors; }
// Fin appel triggers
-
+
print $langs->trans("YourPaymentHasBeenRecorded")."
\n";
print $langs->trans("ThisIsTransactionId",$TRANSACTIONID)."
\n";
- if (! empty($conf->global->STRIPE_MESSAGE_OK)) print $conf->global->STRIPE_MESSAGE_OK;
-
+ if (! empty($conf->global->ONLINE_PAYMENT_MESSAGE_OK)) print $conf->global->ONLINE_PAYMENT_MESSAGE_OK;
+
$sendemail = '';
- if (! empty($conf->global->STRIPE_PAYONLINE_SENDEMAIL)) $sendemail=$conf->global->STRIPE_PAYONLINE_SENDEMAIL;
-
+ if (! empty($conf->global->ONLINE_PAYMENT_SENDEMAIL)) $sendemail=$conf->global->ONLINE_PAYMENT_SENDEMAIL;
+
// Send an email
if ($sendemail)
{
@@ -147,7 +147,7 @@ if ($ispaymentok)
else $appli.=" ".DOL_VERSION;
}
else $appli.=" ".DOL_VERSION;
-
+
$urlback=$_SERVER["REQUEST_URI"];
$topic='['.$appli.'] '.$langs->transnoentitiesnoconv("NewOnlinePaymentReceived");
$tmptag=dolExplodeIntoArray($fulltag,'.','=');
diff --git a/htdocs/stripe/admin/stripe.php b/htdocs/stripe/admin/stripe.php
index c2c33edc189..3b9477f48fb 100644
--- a/htdocs/stripe/admin/stripe.php
+++ b/htdocs/stripe/admin/stripe.php
@@ -37,7 +37,7 @@ $langs->load("paybox");
$langs->load("stripe");
if (! $user->admin) accessforbidden();
-
+
$action = GETPOST('action','alpha');
@@ -55,17 +55,17 @@ if ($action == 'setvalue' && $user->admin)
if (! $result > 0) $error++;
$result=dolibarr_set_const($db, "STRIPE_LIVE_SECRET_KEY",GETPOST('STRIPE_LIVE_SECRET_KEY','alpha'),'chaine',0,'',$conf->entity);
if (! $result > 0) $error++;
- $result=dolibarr_set_const($db, "STRIPE_CREDITOR",GETPOST('STRIPE_CREDITOR','alpha'),'chaine',0,'',$conf->entity);
+ $result=dolibarr_set_const($db, "ONLINE_PAYMENT_CREDITOR",GETPOST('ONLINE_PAYMENT_CREDITOR','alpha'),'chaine',0,'',$conf->entity);
if (! $result > 0) $error++;
- $result=dolibarr_set_const($db, "STRIPE_CSS_URL",GETPOST('STRIPE_CSS_URL','alpha'),'chaine',0,'',$conf->entity);
+ $result=dolibarr_set_const($db, "ONLINE_PAYMENT_CSS_URL",GETPOST('ONLINE_PAYMENT_CSS_URL','alpha'),'chaine',0,'',$conf->entity);
if (! $result > 0) $error++;
- $result=dolibarr_set_const($db, "STRIPE_MESSAGE_OK",GETPOST('STRIPE_MESSAGE_OK','alpha'),'chaine',0,'',$conf->entity);
+ $result=dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_OK",GETPOST('ONLINE_PAYMENT_MESSAGE_OK','alpha'),'chaine',0,'',$conf->entity);
if (! $result > 0) $error++;
- $result=dolibarr_set_const($db, "STRIPE_MESSAGE_KO",GETPOST('STRIPE_MESSAGE_KO','alpha'),'chaine',0,'',$conf->entity);
+ $result=dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_KO",GETPOST('ONLINE_PAYMENT_MESSAGE_KO','alpha'),'chaine',0,'',$conf->entity);
if (! $result > 0) $error++;
- $result=dolibarr_set_const($db, "STRIPE_PAYONLINE_SENDEMAIL",GETPOST('STRIPE_PAYONLINE_SENDEMAIL'),'chaine',0,'',$conf->entity);
+ $result=dolibarr_set_const($db, "ONLINE_PAYMENT_SENDEMAIL",GETPOST('ONLINE_PAYMENT_SENDEMAIL'),'chaine',0,'',$conf->entity);
if (! $result > 0) $error++;
-
+
if (! $error)
{
$db->commit();
@@ -190,25 +190,25 @@ print '';
print '| ';
print $langs->trans("CSSUrlForPaymentForm").' | ';
-print '';
+print '';
print ' '.$langs->trans("Example").': http://mysite/mycss.css';
print ' |
';
print '| ';
print $langs->trans("MessageOK").' | ';
-$doleditor=new DolEditor('STRIPE_MESSAGE_OK',$conf->global->STRIPE_MESSAGE_OK,'',100,'dolibarr_details','In',false,true,true,ROWS_2,'90%');
+$doleditor=new DolEditor('ONLINE_PAYMENT_MESSAGE_OK',$conf->global->ONLINE_PAYMENT_MESSAGE_OK,'',100,'dolibarr_details','In',false,true,true,ROWS_2,'90%');
$doleditor->Create();
print ' |
';
print '| ';
print $langs->trans("MessageKO").' | ';
-$doleditor=new DolEditor('STRIPE_MESSAGE_KO',$conf->global->STRIPE_MESSAGE_KO,'',100,'dolibarr_details','In',false,true,true,ROWS_2,'90%');
+$doleditor=new DolEditor('ONLINE_PAYMENT_MESSAGE_KO',$conf->global->ONLINE_PAYMENT_MESSAGE_KO,'',100,'dolibarr_details','In',false,true,true,ROWS_2,'90%');
$doleditor->Create();
print ' |
';
print '| ';
-print $langs->trans("STRIPE_PAYONLINE_SENDEMAIL").' | ';
-print '';
+print $langs->trans("ONLINE_PAYMENT_SENDEMAIL").' | ';
+print '';
print ' '.$langs->trans("Example").': myemail@myserver.com';
print ' |
';
diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php
index b2fe6d923e9..ba189ee1be1 100644
--- a/htdocs/theme/eldy/style.css.php
+++ b/htdocs/theme/eldy/style.css.php
@@ -343,6 +343,26 @@ input.smallpadd { /* Used for timesheet input */
input.buttongen {
vertical-align: middle;
}
+input.buttonpayment {
+ width: 300px;
+ margin-bottom: 15px;
+ background-image: none;
+}
+input.buttonpaymentpaypal {
+ background-image: url();
+ background-repeat: no-repeat;
+ background-position: 5px 4px;
+}
+input.buttonpaymentpaybox {
+ background-image: url();
+ background-repeat: no-repeat;
+ background-position: 5px 4px;
+}
+input.buttonpaymentstripe {
+ background-image: url();
+ background-repeat: no-repeat;
+ background-position: 5px 3px;
+}
span.timesheetalreadyrecorded input {
border: none;
border-bottom: solid 1px rgba(0,0,0,0.4);
@@ -1224,21 +1244,6 @@ div#id-top {
display:none;
background: rgb();
- /*-webkit-box-shadow: 0 0 6px rgba(0,0,0,0.4);
- box-shadow: 0 0 6px rgba(0,0,0,0.4); */
- /*
- background-image: linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%);
- background-image: -o-linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%);
- background-image: -moz-linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%);
- background-image: -webkit-linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%);
- background-image: -ms-linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%);
- background-image: -webkit-gradient( linear, left top, left bottom, color-stop(0, rgba(255,255,255,.1)), color-stop(1, rgba(0,0,0,.4)) );
- */
- /*
- height: 34px;
-
- height: px;
- */
}
@@ -1310,15 +1315,6 @@ ul.tmenu { /* t r b l */
display: table;
}
ul.tmenu li { /* We need this to have background color when menu entry wraps on new lines */
- /* background: rgb();
- /*
- background-image: linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%);
- background-image: -o-linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%);
- background-image: -moz-linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%);
- background-image: -webkit-linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%);
- background-image: -ms-linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%);
- background-image: -webkit-gradient( linear, left top, left bottom, color-stop(0, rgba(255,255,255,.1)), color-stop(1, rgba(0,0,0,.4)) );
- */
}
li.tmenu, li.tmenusel {