From d595b96c8e5017005f6baab0377b15e06ae709a4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 6 Apr 2014 14:22:08 +0200 Subject: [PATCH 1/4] New: Paypal return for subscription show more information and direct link into email. Qual: Better management of error when creating subscription of member not linked to a third party. --- htdocs/adherents/card_subscriptions.php | 119 ++++++++++++++---------- htdocs/core/lib/functions.lib.php | 28 ++++++ htdocs/langs/en_US/errors.lang | 1 + htdocs/langs/en_US/main.lang | 1 + htdocs/langs/en_US/paypal.lang | 1 + htdocs/public/paypal/paymentok.php | 35 +++++-- 6 files changed, 130 insertions(+), 55 deletions(-) diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php index 2e8822b75d2..28e75e36694 100644 --- a/htdocs/adherents/card_subscriptions.php +++ b/htdocs/adherents/card_subscriptions.php @@ -1,7 +1,7 @@ * Copyright (C) 2002-2003 Jean-Louis Bergamo - * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2004-2014 Laurent Destailleur * Copyright (C) 2012 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -330,54 +330,73 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $ $invoice=new Facture($db); $customer=new Societe($db); - $result=$customer->fetch($object->fk_soc); - if ($result <= 0) - { - $errmsg=$customer->error; - $error++; - } - // Create draft invoice - $invoice->type= Facture::TYPE_STANDARD; - $invoice->cond_reglement_id=$customer->cond_reglement_id; - if (empty($invoice->cond_reglement_id)) + if (! $error) { - $paymenttermstatic=new PaymentTerm($db); - $invoice->cond_reglement_id=$paymenttermstatic->getDefaultId(); - if (empty($invoice->cond_reglement_id)) - { - $error++; - $errmsg='ErrorNoPaymentTermRECEPFound'; - } + if (! ($object->fk_soc > 0)) + { + $langs->load("errors"); + $errmsg=$langs->trans("ErrorMemberNotLinkedToAThirpartyLinkOrCreateFirst"); + $error++; + } } - $invoice->socid=$object->fk_soc; - $invoice->date=$datecotisation; - - $result=$invoice->create($user); - if ($result <= 0) + if (! $error) { - $errmsg=$invoice->error; - $error++; + $result=$customer->fetch($object->fk_soc); + if ($result <= 0) + { + $errmsg=$customer->error; + $error++; + } } - - // Add line to draft invoice - $idprodsubscription=0; - $vattouse=0; - if (isset($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) && $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS == 'defaultforfoundationcountry') + + if (! $error) { - $vattouse=get_default_tva($mysoc, $mysoc, $idprodsubscription); + // Create draft invoice + $invoice->type= Facture::TYPE_STANDARD; + $invoice->cond_reglement_id=$customer->cond_reglement_id; + if (empty($invoice->cond_reglement_id)) + { + $paymenttermstatic=new PaymentTerm($db); + $invoice->cond_reglement_id=$paymenttermstatic->getDefaultId(); + if (empty($invoice->cond_reglement_id)) + { + $error++; + $errmsg='ErrorNoPaymentTermRECEPFound'; + } + } + $invoice->socid=$object->fk_soc; + $invoice->date=$datecotisation; + + $result=$invoice->create($user); + if ($result <= 0) + { + $errmsg=$invoice->error; + $error++; + } } - //print xx".$vattouse." - ".$mysoc." - ".$customer;exit; - $result=$invoice->addline($label,0,1,$vattouse,0,0,$idprodsubscription,0,$datecotisation,$datesubend,0,0,'','TTC',$cotisation,1); - if ($result <= 0) + + if (! $error) { - $errmsg=$invoice->error; - $error++; + // Add line to draft invoice + $idprodsubscription=0; + $vattouse=0; + if (isset($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) && $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS == 'defaultforfoundationcountry') + { + $vattouse=get_default_tva($mysoc, $mysoc, $idprodsubscription); + } + //print xx".$vattouse." - ".$mysoc." - ".$customer;exit; + $result=$invoice->addline($label,0,1,$vattouse,0,0,$idprodsubscription,0,$datecotisation,$datesubend,0,0,'','TTC',$cotisation,1); + if ($result <= 0) + { + $errmsg=$invoice->error; + $error++; + } + + // Validate invoice + $result=$invoice->validate($user); } - - // Validate invoice - $result=$invoice->validate($user); - + // Add payment onto invoice if ($option == 'bankviainvoice' && $accountid) { @@ -486,8 +505,8 @@ if ($rowid) dol_fiche_head($head, 'subscription', $langs->trans("Member"), 0, 'user'); - $rowspan=9; - if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) $rowspan+=1; + $rowspan=10; + if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) $rowspan++; if (! empty($conf->societe->enabled)) $rowspan++; print '
'; @@ -764,9 +783,9 @@ if ($rowid) } else { - if (! empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankviainvoice' && ! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled) && $object->fk_soc) $bankviainvoice=1; + if (! empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankviainvoice' && ! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) $bankviainvoice=1; else if (! empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankdirect' && ! empty($conf->banque->enabled)) $bankdirect=1; - else if (! empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'invoiceonly' && ! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled) && $object->fk_soc) $invoiceonly=1; + else if (! empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'invoiceonly' && ! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) $invoiceonly=1; } print "\n\n\n"; @@ -917,12 +936,14 @@ if ($rowid) if (! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) { print 'fk_soc)) print ' disabled="disabled"'; + //if (empty($object->fk_soc)) print ' disabled="disabled"'; print '> '.$langs->trans("MoreActionInvoiceOnly"); if ($object->fk_soc) print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')'; else { - print ' ('.$langs->trans("NoThirdPartyAssociatedToMember"); + print ' ('; + if (empty($object->fk_soc)) print img_warning($langs->trans("NoThirdPartyAssociatedToMember")); + print $langs->trans("NoThirdPartyAssociatedToMember"); print ' - '; print $langs->trans("CreateDolibarrThirdParty"); print ')'; @@ -934,12 +955,14 @@ if ($rowid) if (! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) { print 'fk_soc)) print ' disabled="disabled"'; + //if (empty($object->fk_soc)) print ' disabled="disabled"'; print '> '.$langs->trans("MoreActionBankViaInvoice"); if ($object->fk_soc) print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')'; else { - print ' ('.$langs->trans("NoThirdPartyAssociatedToMember"); + print ' ('; + if (empty($object->fk_soc)) print img_warning($langs->trans("NoThirdPartyAssociatedToMember")); + print $langs->trans("NoThirdPartyAssociatedToMember"); print ' - '; print $langs->trans("CreateDolibarrThirdParty"); print ')'; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index e38ed4c0bcb..5b52ba0a44b 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4490,6 +4490,34 @@ function printCommonFooter($zone='private') } +/** + * Split a string with 2 keys into key array. + * For example: "A=1;B=2;C=2" is exploded into array('A'=>1,'B'=>2,'C'=>3) + * + * @param string $string String to explode + * @param string $delimiter Delimiter between each couple of data + * @param string $kv Delimiter between key and value + * @return array Array of data exploded + */ +function dolExplodeIntoArray($string, $delimiter = ';', $kv = '=') +{ + if ($a = explode($delimiter, $string)) + { + foreach ($a as $s) { // each part + if ($s) { + if ($pos = strpos($s, $kv)) { // key/value delimiter + $ka[trim(substr($s, 0, $pos))] = trim(substr($s, $pos + strlen($kv))); + } else { // key delimiter not found + $ka[] = trim($s); + } + } + } + return $ka; + } + return array(); +} + + /** * Convert an array with RGB value into hex RGB value * diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 2edfa4effce..02fc7f4d9e1 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -134,6 +134,7 @@ ErrorOpenIDSetupNotComplete=You setup Dolibarr config file to allow OpenID authe ErrorWarehouseMustDiffers=Source and target warehouses must differs ErrorBadFormat=Bad format! ErrorPaymentDateLowerThanInvoiceDate=Payment date (%s) cant' be before invoice date (%s) for invoice %s. +ErrorMemberNotLinkedToAThirpartyLinkOrCreateFirst=Error, this member is not yet linked to any thirdparty. Link member to an existing third party or create a new thirdparty before creating subscription with invoice. # Warnings WarningMandatorySetupNotComplete=Mandatory setup parameters are not yet defined WarningSafeModeOnCheckExecDir=Warning, PHP option safe_mode is on so command must be stored inside a directory declared by php parameter safe_mode_exec_dir. diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 56f970696cf..0897fc53535 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -94,6 +94,7 @@ InformationLastAccessInError=Information for last database access in error DolibarrHasDetectedError=Dolibarr has detected a technical error InformationToHelpDiagnose=This is information that can help diagnostic MoreInformation=More information +TechnicalInformation=Technical information NotePublic=Note (public) NotePrivate=Note (private) PrecisionUnitIsLimitedToXDecimals=Dolibarr was setup to limit precision of unit prices to %s decimals. diff --git a/htdocs/langs/en_US/paypal.lang b/htdocs/langs/en_US/paypal.lang index 64602c96aa8..e4589bf6312 100644 --- a/htdocs/langs/en_US/paypal.lang +++ b/htdocs/langs/en_US/paypal.lang @@ -20,3 +20,4 @@ YouAreCurrentlyInSandboxMode=You are currently in the "sandbox" mode NewPaypalPaymentReceived=New Paypal payment received NewPaypalPaymentFailed=New Paypal payment tried but failed PAYPAL_PAYONLINE_SENDEMAIL=EMail to warn after a payment (success or not) +ReturnURLAfterPayment=Return URL after payment \ No newline at end of file diff --git a/htdocs/public/paypal/paymentok.php b/htdocs/public/paypal/paymentok.php index 32aa3fd4b49..a43387ffe00 100644 --- a/htdocs/public/paypal/paymentok.php +++ b/htdocs/public/paypal/paymentok.php @@ -21,7 +21,7 @@ * \file htdocs/public/paypal/paymentok.php * \ingroup paypal * \brief File to show page after a successful payment - * This page is called by paypal with url provided to payal competed with parameter TOKEN=xxx + * This page is called by paypal with url provided to payal completed with parameter TOKEN=xxx * This token can be used to get more informations. * \author Laurent Destailleur */ @@ -154,6 +154,7 @@ if ($PAYPALTOKEN) // 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"]); print $langs->trans("YourPaymentHasBeenRecorded")."
\n"; @@ -172,13 +173,33 @@ if ($PAYPALTOKEN) { $sendto=$conf->global->PAYPAL_PAYONLINE_SENDEMAIL; $from=$conf->global->MAILING_EMAIL_FROM; + // Define $urlwithroot + $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 + + $urlback=$_SERVER["REQUEST_URI"]; + $topic='['.$conf->global->MAIN_APPLICATION_TITLE.'] '.$langs->transnoentitiesnoconv("NewPaypalPaymentReceived"); + $tmptag=dolExplodeIntoArray($tag,'.','='); + $content=""; + if (! empty($tmptag['MEM'])) + { + $url=$urlwithroot."/adherents/card_subscriptions.php?rowid=".$tmptag['MEM']; + $content.=$langs->trans("PaymentSubscription")."\n"; + $content.=$langs->trans("MemberId").': '.$tmptag['MEM']."\n"; + $content.=$langs->trans("Link").': '.$url.''."\n"; + } + else + { + $content.=$langs->transnoentitiesnoconv("NewPaypalPaymentReceived")."\n"; + } + $content.="\n"; + $content.=$langs->transnoentitiesnoconv("TechnicalInformation").":\n"; + $content.=$langs->transnoentitiesnoconv("ReturnURLAfterPayment").': '.$urlback."\n"; + $content.="tag=".$fulltag."\ntoken=".$token." paymentType=".$paymentType." currencycodeType=".$currencyCodeType." payerId=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt; + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $mailfile = new CMailFile( - '['.$conf->global->MAIN_APPLICATION_TITLE.'] '.$langs->transnoentitiesnoconv("NewPaypalPaymentReceived"), - $sendto, - $from, - $langs->transnoentitiesnoconv("NewPaypalPaymentReceived")."\ntag=".$fulltag."\ntoken=".$token." paymentType=".$paymentType." currencycodeType=".$currencyCodeType." payerId=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt - ); + $mailfile = new CMailFile($topic, $sendto, $from, $content); $result=$mailfile->sendfile(); if ($result) From 6cb39ea3dc8eb139dca646a3933ebfe8783a4d86 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 6 Apr 2014 14:49:04 +0200 Subject: [PATCH 2/4] Fix: Missing message keys --- htdocs/langs/en_US/paypal.lang | 4 +++- htdocs/public/paypal/paymentok.php | 27 +++++++++++++++------------ 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/htdocs/langs/en_US/paypal.lang b/htdocs/langs/en_US/paypal.lang index e4589bf6312..b6b6d59d4a0 100644 --- a/htdocs/langs/en_US/paypal.lang +++ b/htdocs/langs/en_US/paypal.lang @@ -20,4 +20,6 @@ YouAreCurrentlyInSandboxMode=You are currently in the "sandbox" mode NewPaypalPaymentReceived=New Paypal payment received NewPaypalPaymentFailed=New Paypal payment tried but failed PAYPAL_PAYONLINE_SENDEMAIL=EMail to warn after a payment (success or not) -ReturnURLAfterPayment=Return URL after payment \ No newline at end of file +ReturnURLAfterPayment=Return URL after payment +ValidationOfPaypalPaymentFailed=Validation of Paypal payment failed +PaypalConfirmPaymentPageWasCalledButFailed=Payment confirmation page for Paypal was called by Paypal but confirmation failed diff --git a/htdocs/public/paypal/paymentok.php b/htdocs/public/paypal/paymentok.php index a43387ffe00..fce2fdf4aa9 100644 --- a/htdocs/public/paypal/paymentok.php +++ b/htdocs/public/paypal/paymentok.php @@ -220,26 +220,29 @@ if ($PAYPALTOKEN) $ErrorLongMsg = urldecode($resArray["L_LONGMESSAGE0"]); $ErrorSeverityCode = urldecode($resArray["L_SEVERITYCODE0"]); - echo "DoExpressCheckoutPayment API call failed. "; - echo "Detailed Error Message: " . $ErrorLongMsg; - echo "Short Error Message: " . $ErrorShortMsg; - echo "Error Code: " . $ErrorCode; - echo "Error Severity Code: " . $ErrorSeverityCode; + echo "DoExpressCheckoutPayment API call failed.
\n"; + echo "Detailed Error Message: " . $ErrorLongMsg."
\n"; + echo "Short Error Message: " . $ErrorShortMsg."
\n"; + echo "Error Code: " . $ErrorCode."
\n"; + echo "Error Severity Code: " . $ErrorSeverityCode."
\n"; - if ($mysoc->email) echo "\nPlease, send a screenshot of this page to ".$mysoc->email; + 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)) { $sendto=$conf->global->PAYPAL_PAYONLINE_SENDEMAIL; $from=$conf->global->MAILING_EMAIL_FROM; + $topic='['.$conf->global->MAIN_APPLICATION_TITLE.'] '.$langs->transnoentitiesnoconv("ValidationOfPaypalPaymentFailed"); + $content=""; + $content.=$langs->transnoentitiesnoconv("PaypalConfirmPaymentPageWasCalledButFailed"); + $content.="\n"; + $content.=$langs->transnoentitiesnoconv("TechnicalInformation").":\n"; + $content.=$langs->transnoentitiesnoconv("ReturnURLAfterPayment").': '.$urlback."\n"; + $content.="tag=".$fulltag."\ntoken=".$token." paymentType=".$paymentType." currencycodeType=".$currencyCodeType." payerId=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt; + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $mailfile = new CMailFile( - '['.$conf->global->MAIN_APPLICATION_TITLE.'] '.$langs->transnoentitiesnoconv("ValidationOfPaypalPaymentFailed"), - $sendto, - $from, - $langs->transnoentitiesnoconv("PaypalConfirmPaymentPageWasCalledButFailed")."\ntag=".$fulltag."\ntoken=".$token." paymentType=".$paymentType." currencycodeType=".$currencyCodeType." payerId=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt."\nErrorCode=".$ErrorCode."\nErrorLongMsg=".$ErrorLongMsg - ); + $mailfile = new CMailFile($topic, $sendto, $from, $content); $result=$mailfile->sendfile(); if ($result) From 2be6b2ecf7f3a290222b57f8ea87a636332970c0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 6 Apr 2014 14:53:42 +0200 Subject: [PATCH 3/4] Fix: var not initialized --- htdocs/public/paypal/paymentok.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/public/paypal/paymentok.php b/htdocs/public/paypal/paymentok.php index fce2fdf4aa9..764db8d306d 100644 --- a/htdocs/public/paypal/paymentok.php +++ b/htdocs/public/paypal/paymentok.php @@ -233,6 +233,12 @@ if ($PAYPALTOKEN) { $sendto=$conf->global->PAYPAL_PAYONLINE_SENDEMAIL; $from=$conf->global->MAILING_EMAIL_FROM; + // Define $urlwithroot + $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 + + $urlback=$_SERVER["REQUEST_URI"]; $topic='['.$conf->global->MAIN_APPLICATION_TITLE.'] '.$langs->transnoentitiesnoconv("ValidationOfPaypalPaymentFailed"); $content=""; $content.=$langs->transnoentitiesnoconv("PaypalConfirmPaymentPageWasCalledButFailed"); From b77e068a72bb06721a8603222ecae2868625d403 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 6 Apr 2014 15:01:45 +0200 Subject: [PATCH 4/4] New: More information into email confirm for paybox payment. --- htdocs/public/paybox/paymentok.php | 21 +++++++++++++++------ htdocs/public/paypal/paymentok.php | 2 +- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/htdocs/public/paybox/paymentok.php b/htdocs/public/paybox/paymentok.php index 159d29bb78c..691d85838f3 100644 --- a/htdocs/public/paybox/paymentok.php +++ b/htdocs/public/paybox/paymentok.php @@ -104,13 +104,22 @@ if (! empty($conf->global->PAYBOX_PAYONLINE_SENDEMAIL)) { $sendto=$conf->global->PAYBOX_PAYONLINE_SENDEMAIL; $from=$conf->global->MAILING_EMAIL_FROM; + // Define $urlwithroot + $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 + + $urlback=$_SERVER["REQUEST_URI"]; + $topic='['.$conf->global->MAIN_APPLICATION_TITLE.'] '.$langs->transnoentitiesnoconv("NewPayboxPaymentReceived"); + $content=""; + $content.=$langs->transnoentitiesnoconv("NewPayboxPaymentReceived")."\n"; + $content.="\n"; + $content.=$langs->transnoentitiesnoconv("TechnicalInformation").":\n"; + $content.=$langs->transnoentitiesnoconv("ReturnURLAfterPayment").': '.$urlback."\n"; + $content.="tag=".$fulltag."\n"; + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $mailfile = new CMailFile( - '['.$conf->global->MAIN_APPLICATION_TITLE.'] '.$langs->transnoentitiesnoconv("NewPayboxPaymentReceived"), - $sendto, - $from, - $langs->transnoentitiesnoconv("NewPayboxPaymentReceived")."\n".$fulltag - ); + $mailfile = new CMailFile($topic, $sendto, $from, $content); $result=$mailfile->sendfile(); if ($result) diff --git a/htdocs/public/paypal/paymentok.php b/htdocs/public/paypal/paymentok.php index 764db8d306d..74e626040cf 100644 --- a/htdocs/public/paypal/paymentok.php +++ b/htdocs/public/paypal/paymentok.php @@ -241,7 +241,7 @@ if ($PAYPALTOKEN) $urlback=$_SERVER["REQUEST_URI"]; $topic='['.$conf->global->MAIN_APPLICATION_TITLE.'] '.$langs->transnoentitiesnoconv("ValidationOfPaypalPaymentFailed"); $content=""; - $content.=$langs->transnoentitiesnoconv("PaypalConfirmPaymentPageWasCalledButFailed"); + $content.=$langs->transnoentitiesnoconv("PaypalConfirmPaymentPageWasCalledButFailed")."\n"; $content.="\n"; $content.=$langs->transnoentitiesnoconv("TechnicalInformation").":\n"; $content.=$langs->transnoentitiesnoconv("ReturnURLAfterPayment").': '.$urlback."\n";