27 require
'../../main.inc.php';
28 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
29 require_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');
43 if ($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";
124 if (empty($conf->global->PAYBOX_IBS_SITE)) {
125 $conf->global->PAYBOX_IBS_SITE = $IBS_SITE;
128 if (empty($conf->global->PAYBOX_IBS_RANG)) {
129 $conf->global->PAYBOX_IBS_RANG = $IBS_RANG;
132 if (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>';
139 print
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';
149 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
150 print
'<input type="hidden" name="token" value="'.newToken().
'">';
151 print
'<input type="hidden" name="action" value="setvalue">';
155 print $langs->trans(
"PayBoxDesc").
"<br>\n";
158 print
'<table class="noborder centpercent">';
159 print
'<tr class="liste_titre">';
160 print
'<td>'.$langs->trans(
"AccountParameter").
'</td>';
161 print
'<td>'.$langs->trans(
"Value").
'</td>';
165 print
'<tr class="oddeven"><td>';
166 print
'<span class="fieldrequired">'.$langs->trans(
"PAYBOX_PBX_SITE").
'</span></td><td>';
167 print
'<input size="32" type="text" name="PAYBOX_IBS_SITE" value="'.$conf->global->PAYBOX_IBS_SITE.
'">';
168 print
'<span class="opacitymedium"><br>'.$langs->trans(
"Example").
': 1999888 ('.$langs->trans(
"Test").
')</span>';
172 print
'<tr class="oddeven"><td>';
173 print
'<span class="fieldrequired">'.$langs->trans(
"PAYBOX_PBX_RANG").
'</span></td><td>';
174 print
'<input size="32" type="text" name="PAYBOX_IBS_RANG" value="'.$conf->global->PAYBOX_IBS_RANG.
'">';
175 print
'<span class="opacitymedium"><br>'.$langs->trans(
"Example").
': 99 ('.$langs->trans(
"Test").
')</span>';
179 print
'<tr class="oddeven"><td>';
180 print
'<span class="fieldrequired">'.$langs->trans(
"PAYBOX_PBX_IDENTIFIANT").
'</span></td><td>';
181 print
'<input size="32" type="text" name="PAYBOX_PBX_IDENTIFIANT" value="'.$conf->global->PAYBOX_PBX_IDENTIFIANT.
'">';
182 print
'<span class="opacitymedium"><br>'.$langs->trans(
"Example").
': 2 ('.$langs->trans(
"Test").
')</span>';
185 print
'<tr class="oddeven"><td>';
186 print
'<span class="fieldrequired">'.$langs->trans(
"PAYBOX_HMAC_KEY").
'</span></td><td>';
187 print
'<input size="100" type="text" name="PAYBOX_HMAC_KEY" value="'.dol_decode($conf->global->PAYBOX_HMAC_KEY).
'">';
188 print
'<span class="opacitymedium"><br>'.$langs->trans(
"Example").
': 1A2B3C4D5E6F</span>';
191 print
'<tr class="liste_titre">';
192 print
'<td>'.$langs->trans(
"UsageParameter").
'</td>';
193 print
'<td>'.$langs->trans(
"Value").
'</td>';
215 print
'<tr class="oddeven"><td>';
216 print
'<span class="fieldrequired">'.$langs->trans(
"PAYBOX_CGI_URL_V2").
'</span></td><td>';
217 print
'<input size="64" type="text" name="PAYBOX_CGI_URL_V2" value="'.$conf->global->PAYBOX_CGI_URL_V2.
'">';
218 print
'<span class="opacitymedium"><br>'.$langs->trans(
"Example").
' (preprod): https://preprod-tpeweb.paybox.com/php/';
219 print
'<br>'.$langs->trans(
"Example").
' (prod): https://tpeweb.paybox.com/php/</span>';
223 print
'<tr class="oddeven"><td>';
224 print $langs->trans(
"PublicVendorName").
'</td><td>';
225 print
'<input type="text" class="minwidth300" name="ONLINE_PAYMENT_CREDITOR" value="'.$conf->global->ONLINE_PAYMENT_CREDITOR.
'">';
226 print
'<br><span class="opacitymedium">'.$langs->trans(
"Example").
': '.$mysoc->name.
'</span>';
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);
238 print
'<tr class="oddeven"><td>';
239 print $langs->trans(
"CSSUrlForPaymentForm").
'</td><td>';
240 print
'<input size="64" type="text" name="ONLINE_PAYMENT_CSS_URL" value="'.$conf->global->ONLINE_PAYMENT_CSS_URL.
'">';
241 print
'<span class="opacitymedium"><br>'.$langs->trans(
"Example").
': http://mysite/mycss.css</span>';
245 print
'<tr class="oddeven"><td>';
246 print $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%');
248 $doleditor->Create();
251 print
'<tr class="oddeven"><td>';
252 print $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%');
254 $doleditor->Create();
258 print
'<tr class="oddeven"><td>';
259 print $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%');
261 $doleditor->Create();
265 print
'<tr class="oddeven"><td class="fieldrequired">';
266 print $langs->trans(
"ONLINE_PAYMENT_SENDEMAIL").
'</td><td>';
267 print
'<input size="32" type="text" name="ONLINE_PAYMENT_SENDEMAIL" value="'.$conf->global->ONLINE_PAYMENT_SENDEMAIL.
'">';
268 print
' <span class="opacitymedium">'.$langs->trans(
"Example").
': myemail@myserver.com, Payment service <myemail2@myserver2.com></span>';
272 print
'<tr class="oddeven"><td>';
273 print $langs->trans(
"SecurityToken").
'</td><td>';
274 print
'<input size="48" type="text" id="PAYMENT_SECURITY_TOKEN" name="PAYMENT_SECURITY_TOKEN" value="'.$conf->global->PAYMENT_SECURITY_TOKEN.
'">';
275 if (!empty($conf->use_javascript_ajax)) {
276 print
' '.img_picto($langs->trans(
'Generate'),
'refresh',
'id="generate_token" class="linkobject"');
280 print
'<tr class="oddeven"><td>';
281 print $langs->trans(
"SecurityTokenIsUnique").
'</td><td>';
282 print
$form->selectyesno(
"PAYMENT_SECURITY_TOKEN_UNIQUE", (empty($conf->global->PAYMENT_SECURITY_TOKEN) ? 0 : $conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE), 1);
289 print
$form->buttonsSaveCancel(
"Modify",
'');
295 include 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.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
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='')
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.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
isModEnabled($module)
Is Dolibarr module enabled.
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.