diff --git a/htdocs/admin/paybox.php b/htdocs/admin/paybox.php
index 814d70b30ed..6de7be036b5 100644
--- a/htdocs/admin/paybox.php
+++ b/htdocs/admin/paybox.php
@@ -26,7 +26,7 @@
require("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php");
-$service='PayBox';
+$servicename='PayBox';
$langs->load("admin");
$langs->load("paybox");
@@ -37,8 +37,9 @@ if (!$user->admin)
if ($_POST["action"] == 'setvalue' && $user->admin)
{
- $result=dolibarr_set_const($db, "PAYBOX_IBS_DEVISE",$_POST["PAYBOX_IBS_DEVISE"]);
- $result=dolibarr_set_const($db, "PAYBOX_CGI_URL",$_POST["PAYBOX_CGI_URL"]);
+ //$result=dolibarr_set_const($db, "PAYBOX_IBS_DEVISE",$_POST["PAYBOX_IBS_DEVISE"]);
+ $result=dolibarr_set_const($db, "PAYBOX_CGI_URL_V1",$_POST["PAYBOX_CGI_URL_V1"]);
+ $result=dolibarr_set_const($db, "PAYBOX_CGI_URL_V2",$_POST["PAYBOX_CGI_URL_V2"]);
$result=dolibarr_set_const($db, "PAYBOX_CSS_URL",$_POST["PAYBOX_CSS_URL"]);
$result=dolibarr_set_const($db, "PAYBOX_IBS_SITE",$_POST["PAYBOX_IBS_SITE"]);
$result=dolibarr_set_const($db, "PAYBOX_IBS_RANG",$_POST["PAYBOX_IBS_RANG"]);
@@ -87,19 +88,14 @@ print '
| ';
print $langs->trans("PAYBOX_IBS_SITE").' | ';
@@ -132,14 +142,19 @@ print ''.$langs->trans("FollowingUrlAreAvailableToMakePayments").': ';
$firstpart=$dolibarr_main_url_root;
$regex=DOL_URL_ROOT.'$';
$firstpart=eregi_replace($regex,'',$firstpart);
-//print $firstpart.DOL_URL_ROOT.'/public/paybox/newpayment.php?amount=order&ref=orderref&tag=ATAGOFYOURCHOICE'." \n";
-//print $firstpart.DOL_URL_ROOT.'/public/paybox/newpayment.php?amount=invoice&ref=invoiceref&tag=ATAGOFYOURCHOICE'." \n";
print ' ';
-print $langs->trans("ToOfferALinkForOnlinePaymentOnContractLine",$service).': ';
-print $firstpart.DOL_URL_ROOT.'/public/paybox/newpayment.php?amount=contractline&ref=contractlineref'." \n";
+print img_picto('','puce.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnOrder",$servicename).': ';
+print ''.$firstpart.DOL_URL_ROOT.'/public/paybox/newpayment.php?amount=order&ref=orderref'." \n";
print ' ';
-print $langs->trans("ToOfferALinkForOnlinePaymentOnFreeAmount",$service).': ';
-print $firstpart.DOL_URL_ROOT.'/public/paybox/newpayment.php?amount=9.99&tag=yourfreetag'." \n";
+print img_picto('','puce.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnInvoice",$servicename).': ';
+print ''.$firstpart.DOL_URL_ROOT.'/public/paybox/newpayment.php?amount=invoice&ref=invoiceref'." \n";
+//print $langs->trans("SetupPayBoxToHavePaymentCreatedAutomatically",$langs->transnoentitiesnoconv("FeatureNotYetAvailable"))." \n";
+print ' ';
+print img_picto('','puce.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnContractLine",$servicename).': ';
+print ''.$firstpart.DOL_URL_ROOT.'/public/paybox/newpayment.php?amount=contractline&ref=contractlineref'." \n";
+print ' ';
+print img_picto('','puce.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnFreeAmount",$servicename).': ';
+print ''.$firstpart.DOL_URL_ROOT.'/public/paybox/newpayment.php?amount=9.99&tag=yourfreetag'." \n";
print ' ';
print $langs->trans("YouCanAddTagOnUrl");
diff --git a/htdocs/includes/modules/modPaybox.class.php b/htdocs/includes/modules/modPaybox.class.php
index c6316da667b..54a5c8f7ea4 100644
--- a/htdocs/includes/modules/modPaybox.class.php
+++ b/htdocs/includes/modules/modPaybox.class.php
@@ -1,6 +1,6 @@
- * Copyright (C) 2004-2008 Laurent Destailleur
+ * Copyright (C) 2004-2009 Laurent Destailleur
*
* 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
@@ -56,7 +56,7 @@ class modPayBox extends DolibarrModules
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = eregi_replace('^mod','',get_class($this));
// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
- $this->description = "Paybox module";
+ $this->description = "Module to offer an online payment page by credit card with PayBox";
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
$this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang
index 410565dcbd0..57628864db4 100644
--- a/htdocs/langs/en_US/bills.lang
+++ b/htdocs/langs/en_US/bills.lang
@@ -318,7 +318,7 @@ ChequeDeposits=Cheques deposits
Cheques=Cheques
CreditNoteConvertedIntoDiscount=This credit note has been converted into %s
UsBillingContactAsIncoiveRecipientIfExist=Use customer billing contact address instead of third party address as recipient for invoices
-
+PaymentInvoiceRef=Payment invoice %s
# oursin PDF model
Of=du
diff --git a/htdocs/langs/en_US/orders.lang b/htdocs/langs/en_US/orders.lang
index c2b41eadb38..f235005c70e 100755
--- a/htdocs/langs/en_US/orders.lang
+++ b/htdocs/langs/en_US/orders.lang
@@ -99,6 +99,7 @@ AuthorRequest=Request author
UseCustomerContactAsOrderRecipientIfExist=Use customer contact address if defined instead of third party address as order recipient address
RunningOrders=Orders on process
UserWithApproveOrderGrant=Useres granted with "approve orders" permission.
+PaymentOrderRef=Payment of order %s
Error_COMMANDE_SUPPLIER_ADDON_NotDefined=Constant COMMANDE_SUPPLIER_ADDON not defined
Error_COMMANDE_ADDON_NotDefined=Constant COMMANDE_ADDON not defined
diff --git a/htdocs/langs/en_US/paybox.lang b/htdocs/langs/en_US/paybox.lang
index fdbaf6e4bfa..c8a2cd39583 100644
--- a/htdocs/langs/en_US/paybox.lang
+++ b/htdocs/langs/en_US/paybox.lang
@@ -14,6 +14,9 @@ PayBoxDoPayment=Go on payment
YouWillBeRedirectedOnPayBox=You will be redirected on secured Paybox page to input you credit card informations
PleaseBePatient=Please, be patient
Continue=Next
-ToOfferALinkForOnlinePaymentOnContractLine=URL to offer an %s online payment user interface for a contract line
-ToOfferALinkForOnlinePaymentOnFreeAmount=URL to offer an %s online payment user interface for a free amount
-YouCanAddTagOnUrl=You can also add url parameter &tag=value to any of those URL to add your own tag to the payment comment code.
+ToOfferALinkForOnlinePaymentOnOrder=URL to offer a %s online payment user interface for an order
+ToOfferALinkForOnlinePaymentOnInvoice=URL to offer a %s online payment user interface for an invoice
+ToOfferALinkForOnlinePaymentOnContractLine=URL to offer a %s online payment user interface for a contract line
+ToOfferALinkForOnlinePaymentOnFreeAmount=URL to offer a %s online payment user interface for a free amount
+YouCanAddTagOnUrl=You can also add url parameter &tag=value to any of those URL (required only for free payment) to add your own payment comment tag.
+SetupPayBoxToHavePaymentCreatedAutomatically=Setup your PayBox with url %s to have payment created automatically when validated by paybox.
\ No newline at end of file
diff --git a/htdocs/langs/fr_FR/bills.lang b/htdocs/langs/fr_FR/bills.lang
index 9aa3d4b40e6..aa9618d825a 100644
--- a/htdocs/langs/fr_FR/bills.lang
+++ b/htdocs/langs/fr_FR/bills.lang
@@ -321,6 +321,8 @@ CreditNoteConvertedIntoDiscount=Cet avoir a été converti en %s
UsBillingContactAsIncoiveRecipientIfExist=Utiliser l'adresse du contact facturation client de la facture plutot que l'adresse du tiers comme destinataire des factures
ShowUnpayedAll=Afficher tous les impayés
ShowUnpayedLateOnly=Afficher impayés en retard uniquement
+PaymentInvoiceRef=Paiement facture %s
+
# oursin PDF model
Of=du
diff --git a/htdocs/langs/fr_FR/orders.lang b/htdocs/langs/fr_FR/orders.lang
index b5ae0e7b4c8..e8c1b82d05e 100755
--- a/htdocs/langs/fr_FR/orders.lang
+++ b/htdocs/langs/fr_FR/orders.lang
@@ -99,6 +99,7 @@ AuthorRequest=Auteur/Demandeur
UseCustomerContactAsOrderRecipientIfExist=Utiliser adresse contact suivi client si défini plutot que adresse tiers comme destinataire des commandes
RunningOrders=Commandes en cours
UserWithApproveOrderGrant=Utilisateurs habilités à approuver les commandes
+PaymentOrderRef=Paiement commande %s
Error_COMMANDE_SUPPLIER_ADDON_NotDefined=Constante COMMANDE_SUPPLIER_ADDON non définie
Error_COMMANDE_ADDON_NotDefined=Constante COMMANDE_ADDON non définie
diff --git a/htdocs/langs/fr_FR/paybox.lang b/htdocs/langs/fr_FR/paybox.lang
index 7fd98e558f6..042e0e3a515 100644
--- a/htdocs/langs/fr_FR/paybox.lang
+++ b/htdocs/langs/fr_FR/paybox.lang
@@ -14,7 +14,10 @@ PayBoxDoPayment=Poursuivre le paiement par carte
YouWillBeRedirectedOnPayBox=Vous serez redirigé vers la page sécurisée Paybox de saisie de votre carte bancaire
PleaseBePatient=Merci de patientez quelques secondes
Continue=Continuer
+ToOfferALinkForOnlinePaymentOnOrder=URL offrant une interface de paiement en ligne %s sur la base du montant d'une commande client
+ToOfferALinkForOnlinePaymentOnInvoice=URL offrant une interface de paiement en ligne %s sur la base du montant d'une facture
ToOfferALinkForOnlinePaymentOnContractLine=URL offrant une interface de paiement en ligne %s sur la base du montant d'une ligne de contrat
ToOfferALinkForOnlinePaymentOnFreeAmount=URL offrant une interface de paiement en ligne %s pour un montant libre
-YouCanAddTagOnUrl=Vous pouvez de plus ajouter le paramètre url &tag=value à n'importe quelle de ces URL pour voir votre propre tag au code commentaire de paiement.
+YouCanAddTagOnUrl=Vous pouvez de plus ajouter le paramètre url &tag=value à n'importe quelles de ces URL (obligatoire pour le paiement libre uniquement) pour voir votre propre "code commentaire" du paiement.
+SetupPayBoxToHavePaymentCreatedAutomatically=Configurez votre url PayBox à %s pour avoir le paiement créé automatiquement si validé.
\ No newline at end of file
diff --git a/htdocs/paybox/paybox.lib.php b/htdocs/paybox/paybox.lib.php
index 97a14afb69c..312928c66c4 100644
--- a/htdocs/paybox/paybox.lib.php
+++ b/htdocs/paybox/paybox.lib.php
@@ -68,7 +68,7 @@ function llxFooterPayBox()
* \brief Create a redirect form to paybox form
* \return int 1 if OK, -1 if ERROR
*/
-function print_paybox_redirect($PRICE,$EMAIL,$urlok,$urlko,$TAG,$ID=0)
+function print_paybox_redirect($PRICE,$CURRENCY,$EMAIL,$urlok,$urlko,$TAG)
{
global $conf, $langs, $db;
@@ -79,14 +79,13 @@ function print_paybox_redirect($PRICE,$EMAIL,$urlok,$urlko,$TAG,$ID=0)
if ($conf->global->PAYBOX_IBS_SITE) $IBS_SITE=$conf->global->PAYBOX_IBS_SITE;
$IBS_RANG="99"; # Rang test
if ($conf->global->PAYBOX_IBS_RANG) $IBS_RANG=$conf->global->PAYBOX_IBS_RANG;
- $IBS_DEVISE="978"; # Euro
- if ($conf->global->PAYBOX_IBS_DEVISE) $IBS_DEVISE=$conf->global->PAYBOX_IBS_DEVISE;
+ $IBS_DEVISE=""; # Currency
+ if ($CURRENCY == 'EUR') $IBS_DEVISE="978";
- $ModulePaybox="module_linux.cgi";
- if ($_SERVER["WINDIR"] && eregi("windows",$_SERVER["WINDIR"])) { $ModulePaybox="module_NT_2000.cgi"; }
- $URLPAYBOX=URL_ROOT.'/cgi-bin/'.$ModulePaybox;
- if ($conf->global->PAYBOX_CGI_URL) $URLPAYBOX=$conf->global->PAYBOX_CGI_URL;
+ $URLPAYBOX="";
+ if ($conf->global->PAYBOX_CGI_URL_V1) $URLPAYBOX=$conf->global->PAYBOX_CGI_URL_V1;
+ //if ($conf->global->PAYBOX_CGI_URL_V2) $URLPAYBOX=$conf->global->PAYBOX_CGI_URL_V2;
if (empty($IBS_DEVISE))
{
@@ -95,7 +94,7 @@ function print_paybox_redirect($PRICE,$EMAIL,$urlok,$urlko,$TAG,$ID=0)
}
if (empty($URLPAYBOX))
{
- dol_print_error('',"Paybox setup param PAYBOX_CGI_URL not defined");
+ dol_print_error('',"Paybox setup param PAYBOX_CGI_URL_V1 and PAYBOX_CGI_URL_V2 undefined");
return -1;
}
if (empty($IBS_SITE))
@@ -109,27 +108,27 @@ function print_paybox_redirect($PRICE,$EMAIL,$urlok,$urlko,$TAG,$ID=0)
return -1;
}
-
- dol_syslog("Paypal.lib::print_paybox_redirect PRICE: ".$PRICE, LOG_DEBUG);
-
- $langsiso=new Translate('',$conf);
- $langsiso=$langs;
- $langsiso->charset_output='ISO-8859-1';
-
// Definition des parametres vente produit pour paybox
$IBS_CMD=$TAG;
$IBS_TOTAL=$PRICE*100; # En centimes
$IBS_MODE=1; # Mode formulaire
$IBS_PORTEUR=$EMAIL;
$IBS_RETOUR="montant:M;ref:R;auto:A;trans:T"; # Format des parametres du get de validation en reponse (url a definir sous paybox)
- $IBS_TXT="".$langsiso->trans("YouWillBeRedirectedOnPayBox")." ".$langsiso->trans("PleaseBePatient")."... ";
+ //$IBS_TXT="".$langsiso->trans("YouWillBeRedirectedOnPayBox")." ".$langsiso->trans("PleaseBePatient")."... ";
+ $IBS_TXT=' '; // Use a space
+ $IBS_BOUTPI=$langs->trans("Wait");
+ //$IBS_BOUTPI='';
$IBS_EFFECTUE=$urlok;
$IBS_ANNULE=$urlko;
$IBS_REFUSE=$urlko;
- $IBS_BOUTPI=$langsiso->trans("Continue");
$IBS_BKGD="#FFFFFF";
- $IBS_WAIT="4000";
- $IBS_LANG="ENG"; if (eregi('^FR',$langs->defaultlang)) $IBS_LANG="FRA";
+ $IBS_WAIT="2000";
+ $IBS_LANG="GBR"; // FRA, GBR, ESP, ITA et DEU
+ if (eregi('^FR',$langs->defaultlang)) $IBS_LANG="FRA";
+ if (eregi('^ES',$langs->defaultlang)) $IBS_LANG="ESP";
+ if (eregi('^IT',$langs->defaultlang)) $IBS_LANG="ITA";
+ if (eregi('^DE',$langs->defaultlang)) $IBS_LANG="DEU";
+ $IBS_OUTPUT='E';
dol_syslog("Soumission Paybox", LOG_DEBUG);
dol_syslog("IBS_MODE: $IBS_MODE", LOG_DEBUG);
@@ -146,6 +145,7 @@ function print_paybox_redirect($PRICE,$EMAIL,$urlok,$urlko,$TAG,$ID=0)
dol_syslog("IBS_BKGD: $IBS_BKGD", LOG_DEBUG);
dol_syslog("IBS_WAIT: $IBS_WAIT", LOG_DEBUG);
dol_syslog("IBS_LANG: $IBS_LANG", LOG_DEBUG);
+ dol_syslog("IBS_OUTPUT: $IBS_OUTPUT", LOG_DEBUG);
header("Content-type: text/html; charset=".$conf->character_set_client);
@@ -180,7 +180,7 @@ function print_paybox_redirect($PRICE,$EMAIL,$urlok,$urlko,$TAG,$ID=0)
print "\n";
print ''."\n";
print "\n";
print ' |