27require
'../../main.inc.php';
28require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
29require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
31$servicename =
'PayBox';
34$langs->loadLangs(array(
'admin',
'other',
'paybox',
'paypal',
'stripe'));
40$action =
GETPOST(
'action',
'aZ09');
43if ($action ==
'setvalue' && $user->admin) {
46 $result =
dolibarr_set_const($db,
"PAYBOX_CGI_URL_V1",
GETPOST(
'PAYBOX_CGI_URL_V1',
'alpha'),
'chaine', 0,
'', $conf->entity);
50 $result =
dolibarr_set_const($db,
"PAYBOX_CGI_URL_V2",
GETPOST(
'PAYBOX_CGI_URL_V2',
'alpha'),
'chaine', 0,
'', $conf->entity);
54 $result =
dolibarr_set_const($db,
"PAYBOX_IBS_SITE",
GETPOST(
'PAYBOX_IBS_SITE',
'alpha'),
'chaine', 0,
'', $conf->entity);
58 $result =
dolibarr_set_const($db,
"PAYBOX_IBS_RANG",
GETPOST(
'PAYBOX_IBS_RANG',
'alpha'),
'chaine', 0,
'', $conf->entity);
62 $result =
dolibarr_set_const($db,
"PAYBOX_PBX_IDENTIFIANT",
GETPOST(
'PAYBOX_PBX_IDENTIFIANT',
'alpha'),
'chaine', 0,
'', $conf->entity);
66 $result =
dolibarr_set_const($db,
"ONLINE_PAYMENT_CREDITOR",
GETPOST(
'ONLINE_PAYMENT_CREDITOR',
'alpha'),
'chaine', 0,
'', $conf->entity);
70 $result =
dolibarr_set_const($db,
"PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS",
GETPOST(
'PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS',
'int'),
'chaine', 0,
'', $conf->entity);
74 $result =
dolibarr_set_const($db,
"ONLINE_PAYMENT_CSS_URL",
GETPOST(
'ONLINE_PAYMENT_CSS_URL',
'alpha'),
'chaine', 0,
'', $conf->entity);
78 $result =
dolibarr_set_const($db,
"ONLINE_PAYMENT_MESSAGE_FORM",
GETPOST(
'ONLINE_PAYMENT_MESSAGE_FORM',
'restricthtml'),
'chaine', 0,
'', $conf->entity);
82 $result =
dolibarr_set_const($db,
"ONLINE_PAYMENT_MESSAGE_OK",
GETPOST(
'ONLINE_PAYMENT_MESSAGE_OK',
'restricthtml'),
'chaine', 0,
'', $conf->entity);
86 $result =
dolibarr_set_const($db,
"ONLINE_PAYMENT_MESSAGE_KO",
GETPOST(
'ONLINE_PAYMENT_MESSAGE_KO',
'restricthtml'),
'chaine', 0,
'', $conf->entity);
90 $result =
dolibarr_set_const($db,
"ONLINE_PAYMENT_SENDEMAIL",
GETPOST(
'ONLINE_PAYMENT_SENDEMAIL',
'alpha'),
'chaine', 0,
'', $conf->entity);
95 $result =
dolibarr_set_const($db,
"PAYMENT_SECURITY_TOKEN",
GETPOST(
'PAYMENT_SECURITY_TOKEN',
'alpha'),
'chaine', 0,
'', $conf->entity);
99 $result =
dolibarr_set_const($db,
"PAYMENT_SECURITY_TOKEN_UNIQUE",
GETPOST(
'PAYMENT_SECURITY_TOKEN_UNIQUE',
'alpha'),
'chaine', 0,
'', $conf->entity);
100 if (!($result > 0)) {
104 if (!($result > 0)) {
123$IBS_SITE =
"1999888";
124if (empty($conf->global->PAYBOX_IBS_SITE)) {
125 $conf->global->PAYBOX_IBS_SITE = $IBS_SITE;
128if (empty($conf->global->PAYBOX_IBS_RANG)) {
129 $conf->global->PAYBOX_IBS_RANG = $IBS_RANG;
132if (empty($conf->global->PAYBOX_IBS_DEVISE)) {
133 $conf->global->PAYBOX_IBS_DEVISE = $IBS_DEVISE;
138$linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
139print
load_fiche_titre($langs->trans(
"PayBoxSetup"), $linkback,
'title_setup');
144$head[$h][0] = DOL_URL_ROOT.
"/paybox/admin/paybox.php";
145$head[$h][1] = $langs->trans(
"PayBox");
146$head[$h][2] =
'payboxaccount';
149print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
150print
'<input type="hidden" name="token" value="'.newToken().
'">';
151print
'<input type="hidden" name="action" value="setvalue">';
155print $langs->trans(
"PayBoxDesc").
"<br>\n";
158print
'<table class="noborder centpercent">';
159print
'<tr class="liste_titre">';
160print
'<td>'.$langs->trans(
"AccountParameter").
'</td>';
161print
'<td>'.$langs->trans(
"Value").
'</td>';
165print
'<tr class="oddeven"><td>';
166print
'<span class="fieldrequired">'.$langs->trans(
"PAYBOX_PBX_SITE").
'</span></td><td>';
167print
'<input size="32" type="text" name="PAYBOX_IBS_SITE" value="'.$conf->global->PAYBOX_IBS_SITE.
'">';
168print
'<span class="opacitymedium"><br>'.$langs->trans(
"Example").
': 1999888 ('.$langs->trans(
"Test").
')</span>';
172print
'<tr class="oddeven"><td>';
173print
'<span class="fieldrequired">'.$langs->trans(
"PAYBOX_PBX_RANG").
'</span></td><td>';
174print
'<input size="32" type="text" name="PAYBOX_IBS_RANG" value="'.$conf->global->PAYBOX_IBS_RANG.
'">';
175print
'<span class="opacitymedium"><br>'.$langs->trans(
"Example").
': 99 ('.$langs->trans(
"Test").
')</span>';
179print
'<tr class="oddeven"><td>';
180print
'<span class="fieldrequired">'.$langs->trans(
"PAYBOX_PBX_IDENTIFIANT").
'</span></td><td>';
181print
'<input size="32" type="text" name="PAYBOX_PBX_IDENTIFIANT" value="'.$conf->global->PAYBOX_PBX_IDENTIFIANT.
'">';
182print
'<span class="opacitymedium"><br>'.$langs->trans(
"Example").
': 2 ('.$langs->trans(
"Test").
')</span>';
185print
'<tr class="oddeven"><td>';
186print
'<span class="fieldrequired">'.$langs->trans(
"PAYBOX_HMAC_KEY").
'</span></td><td>';
187print
'<input size="100" type="text" name="PAYBOX_HMAC_KEY" value="'.dol_decode($conf->global->PAYBOX_HMAC_KEY).
'">';
188print
'<span class="opacitymedium"><br>'.$langs->trans(
"Example").
': 1A2B3C4D5E6F</span>';
191print
'<tr class="liste_titre">';
192print
'<td>'.$langs->trans(
"UsageParameter").
'</td>';
193print
'<td>'.$langs->trans(
"Value").
'</td>';
215print
'<tr class="oddeven"><td>';
216print
'<span class="fieldrequired">'.$langs->trans(
"PAYBOX_CGI_URL_V2").
'</span></td><td>';
217print
'<input size="64" type="text" name="PAYBOX_CGI_URL_V2" value="'.$conf->global->PAYBOX_CGI_URL_V2.
'">';
218print
'<span class="opacitymedium"><br>'.$langs->trans(
"Example").
' (preprod): https://preprod-tpeweb.paybox.com/php/';
219print
'<br>'.$langs->trans(
"Example").
' (prod): https://tpeweb.paybox.com/php/</span>';
223print
'<tr class="oddeven"><td>';
224print $langs->trans(
"PublicVendorName").
'</td><td>';
225print
'<input type="text" class="minwidth300" name="ONLINE_PAYMENT_CREDITOR" value="'.$conf->global->ONLINE_PAYMENT_CREDITOR.
'">';
226print
'<br><span class="opacitymedium">'.$langs->trans(
"Example").
': '.$mysoc->name.
'</span>';
230if (isModEnabled(
"banque")) {
231 print
'<tr class="oddeven"><td>';
232 print $langs->trans(
"BankAccount").
'</td><td>';
233 $form->select_comptes($conf->global->PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS,
'PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS', 0,
'', 1);
238print
'<tr class="oddeven"><td>';
239print $langs->trans(
"CSSUrlForPaymentForm").
'</td><td>';
240print
'<input size="64" type="text" name="ONLINE_PAYMENT_CSS_URL" value="'.$conf->global->ONLINE_PAYMENT_CSS_URL.
'">';
241print
'<span class="opacitymedium"><br>'.$langs->trans(
"Example").
': http://mysite/mycss.css</span>';
245print
'<tr class="oddeven"><td>';
246print $langs->trans(
"MessageForm").
'</td><td>';
247$doleditor =
new DolEditor(
'ONLINE_PAYMENT_MESSAGE_FORM', $conf->global->ONLINE_PAYMENT_MESSAGE_FORM,
'', 100,
'dolibarr_details',
'In',
false,
true,
true, ROWS_2,
'90%');
251print
'<tr class="oddeven"><td>';
252print $langs->trans(
"MessageOK").
'</td><td>';
253$doleditor =
new DolEditor(
'ONLINE_PAYMENT_MESSAGE_OK', $conf->global->ONLINE_PAYMENT_MESSAGE_OK,
'', 100,
'dolibarr_details',
'In',
false,
true,
true, ROWS_2,
'90%');
258print
'<tr class="oddeven"><td>';
259print $langs->trans(
"MessageKO").
'</td><td>';
260$doleditor =
new DolEditor(
'ONLINE_PAYMENT_MESSAGE_KO', $conf->global->ONLINE_PAYMENT_MESSAGE_KO,
'', 100,
'dolibarr_details',
'In',
false,
true,
true, ROWS_2,
'90%');
265print
'<tr class="oddeven"><td class="fieldrequired">';
266print $langs->trans(
"ONLINE_PAYMENT_SENDEMAIL").
'</td><td>';
267print
'<input size="32" type="text" name="ONLINE_PAYMENT_SENDEMAIL" value="'.$conf->global->ONLINE_PAYMENT_SENDEMAIL.
'">';
268print
' <span class="opacitymedium">'.$langs->trans(
"Example").
': myemail@myserver.com, Payment service <myemail2@myserver2.com></span>';
272print
'<tr class="oddeven"><td>';
273print $langs->trans(
"SecurityToken").
'</td><td>';
274print
'<input size="48" type="text" id="PAYMENT_SECURITY_TOKEN" name="PAYMENT_SECURITY_TOKEN" value="'.$conf->global->PAYMENT_SECURITY_TOKEN.
'">';
275if (!empty($conf->use_javascript_ajax)) {
276 print
' '.img_picto($langs->trans(
'Generate'),
'refresh',
'id="generate_token" class="linkobject"');
280print
'<tr class="oddeven"><td>';
281print $langs->trans(
"SecurityTokenIsUnique").
'</td><td>';
282print $form->selectyesno(
"PAYMENT_SECURITY_TOKEN_UNIQUE", (empty($conf->global->PAYMENT_SECURITY_TOKEN) ? 0 : $conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE), 1);
289print $form->buttonsSaveCancel(
"Modify",
'');
295include DOL_DOCUMENT_ROOT.
'/core/tpl/onlinepaymentlinks.tpl.php';
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage a WYSIWYG editor.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_get_fiche_end($notab=0)
Return tab footer of a card.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_encode($chain, $key='1')
Encode a string with base 64 algorithm + specific delta change.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.