From 48ae4de47b7791d1ffafabfd1ea88a7b282365d2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Sep 2018 16:11:10 +0200 Subject: [PATCH] FIX Add paypal error message in alert email --- htdocs/langs/en_US/paypal.lang | 3 ++- htdocs/public/payment/paymentok.php | 5 +++++ htdocs/public/paypal/paymentok.php | 9 +-------- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/htdocs/langs/en_US/paypal.lang b/htdocs/langs/en_US/paypal.lang index 547b188b4a5..ad8b9612935 100644 --- a/htdocs/langs/en_US/paypal.lang +++ b/htdocs/langs/en_US/paypal.lang @@ -31,4 +31,5 @@ OnlinePaymentSystem=Online payment system PaypalLiveEnabled=Paypal live enabled (otherwise test/sandbox mode) PaypalImportPayment=Import Paypal payments PostActionAfterPayment=Post actions after payments -ARollbackWasPerformedOnPostActions=A rollback was performed on all Post actions. You must complete post actions manually if they are necessary. \ No newline at end of file +ARollbackWasPerformedOnPostActions=A rollback was performed on all Post actions. You must complete post actions manually if they are necessary. +ValidationOfPaymentFailed=Validation of payment has failed \ No newline at end of file diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index a5b6b38ea35..34209877bf3 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -801,6 +801,11 @@ if ($ispaymentok) $content.="
\n"; $content.="tag=".$fulltag."
\ntoken=".$onlinetoken."
\npaymentType=".$paymentType."
\ncurrencycodeType=".$currencyCodeType."
\npayerId=".$payerID."
\nipaddress=".$ipaddress."
\nFinalPaymentAmt=".$FinalPaymentAmt."
\n"; + if (! empty($ErrorCode)) $content.="ErrorCode = ".$ErrorCode."
\n"; + if (! empty($ErrorShortMsg)) $content.="ErrorShortMsg = ".$ErrorShortMsg."
\n"; + if (! empty($ErrorLongMsg)) $content.="ErrorLongMsg = ".$ErrorLongMsg."
\n"; + if (! empty($ErrorSeverityCode)) $content.="ErrorSeverityCode = ".$ErrorSeverityCode."
\n"; + $ishtml=dol_textishtml($content); // May contain urls require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; diff --git a/htdocs/public/paypal/paymentok.php b/htdocs/public/paypal/paymentok.php index 1e6adb7ca51..72a43dcbc7b 100644 --- a/htdocs/public/paypal/paymentok.php +++ b/htdocs/public/paypal/paymentok.php @@ -43,14 +43,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; // Security check if (empty($conf->paypal->enabled)) accessforbidden('',0,0,1); -$langs->load("main"); -$langs->load("other"); -$langs->load("dict"); -$langs->load("bills"); -$langs->load("companies"); -$langs->load("paybox"); -$langs->load("paypal"); -$langs->load("stripe"); +$langs->loadLangs(array("main","other","dict","bills","companies","paybox","paypal","stripe")); // Clean parameters $PAYPAL_API_USER="";