Merge branch 'develop' into debug

This commit is contained in:
Grand Philippe 2014-04-06 15:59:03 +02:00
commit 3734c4de0b
7 changed files with 168 additions and 73 deletions

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org> * Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
* *
* This program is free software; you can redistribute it and/or modify * 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); $invoice=new Facture($db);
$customer=new Societe($db); $customer=new Societe($db);
$result=$customer->fetch($object->fk_soc);
if ($result <= 0)
{
$errmsg=$customer->error;
$error++;
}
// Create draft invoice if (! $error)
$invoice->type= Facture::TYPE_STANDARD;
$invoice->cond_reglement_id=$customer->cond_reglement_id;
if (empty($invoice->cond_reglement_id))
{ {
$paymenttermstatic=new PaymentTerm($db); if (! ($object->fk_soc > 0))
$invoice->cond_reglement_id=$paymenttermstatic->getDefaultId(); {
if (empty($invoice->cond_reglement_id)) $langs->load("errors");
{ $errmsg=$langs->trans("ErrorMemberNotLinkedToAThirpartyLinkOrCreateFirst");
$error++; $error++;
$errmsg='ErrorNoPaymentTermRECEPFound'; }
}
} }
$invoice->socid=$object->fk_soc; if (! $error)
$invoice->date=$datecotisation;
$result=$invoice->create($user);
if ($result <= 0)
{ {
$errmsg=$invoice->error; $result=$customer->fetch($object->fk_soc);
$error++; if ($result <= 0)
{
$errmsg=$customer->error;
$error++;
}
} }
// Add line to draft invoice if (! $error)
$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); // 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 (! $error)
if ($result <= 0)
{ {
$errmsg=$invoice->error; // Add line to draft invoice
$error++; $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 // Add payment onto invoice
if ($option == 'bankviainvoice' && $accountid) if ($option == 'bankviainvoice' && $accountid)
{ {
@ -486,8 +505,8 @@ if ($rowid)
dol_fiche_head($head, 'subscription', $langs->trans("Member"), 0, 'user'); dol_fiche_head($head, 'subscription', $langs->trans("Member"), 0, 'user');
$rowspan=9; $rowspan=10;
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) $rowspan+=1; if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) $rowspan++;
if (! empty($conf->societe->enabled)) $rowspan++; if (! empty($conf->societe->enabled)) $rowspan++;
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">'; print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
@ -764,9 +783,9 @@ if ($rowid)
} }
else 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 == '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<!-- Form add subscription -->\n"; print "\n\n<!-- Form add subscription -->\n";
@ -917,12 +936,14 @@ if ($rowid)
if (! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) if (! empty($conf->societe->enabled) && ! empty($conf->facture->enabled))
{ {
print '<input type="radio" class="moreaction" id="invoiceonly" name="paymentsave" value="invoiceonly"'.(! empty($invoiceonly)?' checked="checked"':''); print '<input type="radio" class="moreaction" id="invoiceonly" name="paymentsave" value="invoiceonly"'.(! empty($invoiceonly)?' checked="checked"':'');
if (empty($object->fk_soc)) print ' disabled="disabled"'; //if (empty($object->fk_soc)) print ' disabled="disabled"';
print '> '.$langs->trans("MoreActionInvoiceOnly"); print '> '.$langs->trans("MoreActionInvoiceOnly");
if ($object->fk_soc) print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')'; if ($object->fk_soc) print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')';
else else
{ {
print ' ('.$langs->trans("NoThirdPartyAssociatedToMember"); print ' (';
if (empty($object->fk_soc)) print img_warning($langs->trans("NoThirdPartyAssociatedToMember"));
print $langs->trans("NoThirdPartyAssociatedToMember");
print ' - <a href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&amp;action=create_thirdparty">'; print ' - <a href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&amp;action=create_thirdparty">';
print $langs->trans("CreateDolibarrThirdParty"); print $langs->trans("CreateDolibarrThirdParty");
print '</a>)'; print '</a>)';
@ -934,12 +955,14 @@ if ($rowid)
if (! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) if (! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled))
{ {
print '<input type="radio" class="moreaction" id="bankviainvoice" name="paymentsave" value="bankviainvoice"'.(! empty($bankviainvoice)?' checked="checked"':''); print '<input type="radio" class="moreaction" id="bankviainvoice" name="paymentsave" value="bankviainvoice"'.(! empty($bankviainvoice)?' checked="checked"':'');
if (empty($object->fk_soc)) print ' disabled="disabled"'; //if (empty($object->fk_soc)) print ' disabled="disabled"';
print '> '.$langs->trans("MoreActionBankViaInvoice"); print '> '.$langs->trans("MoreActionBankViaInvoice");
if ($object->fk_soc) print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')'; if ($object->fk_soc) print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')';
else else
{ {
print ' ('.$langs->trans("NoThirdPartyAssociatedToMember"); print ' (';
if (empty($object->fk_soc)) print img_warning($langs->trans("NoThirdPartyAssociatedToMember"));
print $langs->trans("NoThirdPartyAssociatedToMember");
print ' - <a href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&amp;action=create_thirdparty">'; print ' - <a href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&amp;action=create_thirdparty">';
print $langs->trans("CreateDolibarrThirdParty"); print $langs->trans("CreateDolibarrThirdParty");
print '</a>)'; print '</a>)';

View File

@ -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 * Convert an array with RGB value into hex RGB value
* *

View File

@ -134,6 +134,7 @@ ErrorOpenIDSetupNotComplete=You setup Dolibarr config file to allow OpenID authe
ErrorWarehouseMustDiffers=Source and target warehouses must differs ErrorWarehouseMustDiffers=Source and target warehouses must differs
ErrorBadFormat=Bad format! ErrorBadFormat=Bad format!
ErrorPaymentDateLowerThanInvoiceDate=Payment date (%s) cant' be before invoice date (%s) for invoice %s. 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 # Warnings
WarningMandatorySetupNotComplete=Mandatory setup parameters are not yet defined WarningMandatorySetupNotComplete=Mandatory setup parameters are not yet defined
WarningSafeModeOnCheckExecDir=Warning, PHP option <b>safe_mode</b> is on so command must be stored inside a directory declared by php parameter <b>safe_mode_exec_dir</b>. WarningSafeModeOnCheckExecDir=Warning, PHP option <b>safe_mode</b> is on so command must be stored inside a directory declared by php parameter <b>safe_mode_exec_dir</b>.

View File

@ -94,6 +94,7 @@ InformationLastAccessInError=Information for last database access in error
DolibarrHasDetectedError=Dolibarr has detected a technical error DolibarrHasDetectedError=Dolibarr has detected a technical error
InformationToHelpDiagnose=This is information that can help diagnostic InformationToHelpDiagnose=This is information that can help diagnostic
MoreInformation=More information MoreInformation=More information
TechnicalInformation=Technical information
NotePublic=Note (public) NotePublic=Note (public)
NotePrivate=Note (private) NotePrivate=Note (private)
PrecisionUnitIsLimitedToXDecimals=Dolibarr was setup to limit precision of unit prices to <b>%s</b> decimals. PrecisionUnitIsLimitedToXDecimals=Dolibarr was setup to limit precision of unit prices to <b>%s</b> decimals.

View File

@ -20,3 +20,6 @@ YouAreCurrentlyInSandboxMode=You are currently in the "sandbox" mode
NewPaypalPaymentReceived=New Paypal payment received NewPaypalPaymentReceived=New Paypal payment received
NewPaypalPaymentFailed=New Paypal payment tried but failed NewPaypalPaymentFailed=New Paypal payment tried but failed
PAYPAL_PAYONLINE_SENDEMAIL=EMail to warn after a payment (success or not) PAYPAL_PAYONLINE_SENDEMAIL=EMail to warn after a payment (success or not)
ReturnURLAfterPayment=Return URL after payment
ValidationOfPaypalPaymentFailed=Validation of Paypal payment failed
PaypalConfirmPaymentPageWasCalledButFailed=Payment confirmation page for Paypal was called by Paypal but confirmation failed

View File

@ -104,13 +104,22 @@ if (! empty($conf->global->PAYBOX_PAYONLINE_SENDEMAIL))
{ {
$sendto=$conf->global->PAYBOX_PAYONLINE_SENDEMAIL; $sendto=$conf->global->PAYBOX_PAYONLINE_SENDEMAIL;
$from=$conf->global->MAILING_EMAIL_FROM; $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'; require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
$mailfile = new CMailFile( $mailfile = new CMailFile($topic, $sendto, $from, $content);
'['.$conf->global->MAIN_APPLICATION_TITLE.'] '.$langs->transnoentitiesnoconv("NewPayboxPaymentReceived"),
$sendto,
$from,
$langs->transnoentitiesnoconv("NewPayboxPaymentReceived")."\n".$fulltag
);
$result=$mailfile->sendfile(); $result=$mailfile->sendfile();
if ($result) if ($result)

View File

@ -21,7 +21,7 @@
* \file htdocs/public/paypal/paymentok.php * \file htdocs/public/paypal/paymentok.php
* \ingroup paypal * \ingroup paypal
* \brief File to show page after a successful payment * \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. * This token can be used to get more informations.
* \author Laurent Destailleur * \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 // 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' $PAYMENTSTATUS=urldecode($resArray["PAYMENTSTATUS"]); // Should contains 'Completed'
$TRANSACTIONID=urldecode($resArray["TRANSACTIONID"]); $TRANSACTIONID=urldecode($resArray["TRANSACTIONID"]);
$TAXAMT=urldecode($resArray["TAXAMT"]);
$NOTE=urldecode($resArray["NOTE"]); $NOTE=urldecode($resArray["NOTE"]);
print $langs->trans("YourPaymentHasBeenRecorded")."<br>\n"; print $langs->trans("YourPaymentHasBeenRecorded")."<br>\n";
@ -172,13 +173,33 @@ if ($PAYPALTOKEN)
{ {
$sendto=$conf->global->PAYPAL_PAYONLINE_SENDEMAIL; $sendto=$conf->global->PAYPAL_PAYONLINE_SENDEMAIL;
$from=$conf->global->MAILING_EMAIL_FROM; $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").': <a href="'.$url.'">'.$url.'</a>'."\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'; require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
$mailfile = new CMailFile( $mailfile = new CMailFile($topic, $sendto, $from, $content);
'['.$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
);
$result=$mailfile->sendfile(); $result=$mailfile->sendfile();
if ($result) if ($result)
@ -199,26 +220,35 @@ if ($PAYPALTOKEN)
$ErrorLongMsg = urldecode($resArray["L_LONGMESSAGE0"]); $ErrorLongMsg = urldecode($resArray["L_LONGMESSAGE0"]);
$ErrorSeverityCode = urldecode($resArray["L_SEVERITYCODE0"]); $ErrorSeverityCode = urldecode($resArray["L_SEVERITYCODE0"]);
echo "DoExpressCheckoutPayment API call failed. "; echo "DoExpressCheckoutPayment API call failed.<br>\n";
echo "Detailed Error Message: " . $ErrorLongMsg; echo "Detailed Error Message: " . $ErrorLongMsg."<br>\n";
echo "Short Error Message: " . $ErrorShortMsg; echo "Short Error Message: " . $ErrorShortMsg."<br>\n";
echo "Error Code: " . $ErrorCode; echo "Error Code: " . $ErrorCode."<br>\n";
echo "Error Severity Code: " . $ErrorSeverityCode; echo "Error Severity Code: " . $ErrorSeverityCode."<br>\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."<br>\n";
// Send an email // Send an email
if (! empty($conf->global->PAYPAL_PAYONLINE_SENDEMAIL)) if (! empty($conf->global->PAYPAL_PAYONLINE_SENDEMAIL))
{ {
$sendto=$conf->global->PAYPAL_PAYONLINE_SENDEMAIL; $sendto=$conf->global->PAYPAL_PAYONLINE_SENDEMAIL;
$from=$conf->global->MAILING_EMAIL_FROM; $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")."\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'; require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
$mailfile = new CMailFile( $mailfile = new CMailFile($topic, $sendto, $from, $content);
'['.$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
);
$result=$mailfile->sendfile(); $result=$mailfile->sendfile();
if ($result) if ($result)