29 require
'../../main.inc.php';
30 require_once DOL_DOCUMENT_ROOT.
'/stripe/lib/stripe.lib.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
33 require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
34 require_once DOL_DOCUMENT_ROOT.
'/stripe/class/stripe.class.php';
36 $servicename =
'Stripe';
39 $langs->loadLangs(array(
'admin',
'other',
'paypal',
'paybox',
'stripe'));
41 if (empty($user->admin)) {
44 if (empty($conf->stripe->enabled)) {
48 $action =
GETPOST(
'action',
'aZ09');
55 if ($action ==
'setvalue' && $user->admin) {
58 if (empty($conf->stripeconnect->enabled)) {
59 $result =
dolibarr_set_const($db,
"STRIPE_TEST_PUBLISHABLE_KEY",
GETPOST(
'STRIPE_TEST_PUBLISHABLE_KEY',
'alpha'),
'chaine', 0,
'', $conf->entity);
63 $result =
dolibarr_set_const($db,
"STRIPE_TEST_SECRET_KEY",
GETPOST(
'STRIPE_TEST_SECRET_KEY',
'alpha'),
'chaine', 0,
'', $conf->entity);
67 $result =
dolibarr_set_const($db,
"STRIPE_TEST_WEBHOOK_ID",
GETPOST(
'STRIPE_TEST_WEBHOOK_ID',
'alpha'),
'chaine', 0,
'', $conf->entity);
71 $result =
dolibarr_set_const($db,
"STRIPE_TEST_WEBHOOK_KEY",
GETPOST(
'STRIPE_TEST_WEBHOOK_KEY',
'alpha'),
'chaine', 0,
'', $conf->entity);
75 $result =
dolibarr_set_const($db,
"STRIPE_LIVE_PUBLISHABLE_KEY",
GETPOST(
'STRIPE_LIVE_PUBLISHABLE_KEY',
'alpha'),
'chaine', 0,
'', $conf->entity);
79 $result =
dolibarr_set_const($db,
"STRIPE_LIVE_SECRET_KEY",
GETPOST(
'STRIPE_LIVE_SECRET_KEY',
'alpha'),
'chaine', 0,
'', $conf->entity);
83 $result =
dolibarr_set_const($db,
"STRIPE_LIVE_WEBHOOK_ID",
GETPOST(
'STRIPE_LIVE_WEBHOOK_ID',
'alpha'),
'chaine', 0,
'', $conf->entity);
87 $result =
dolibarr_set_const($db,
"STRIPE_LIVE_WEBHOOK_KEY",
GETPOST(
'STRIPE_LIVE_WEBHOOK_KEY',
'alpha'),
'chaine', 0,
'', $conf->entity);
92 $result =
dolibarr_set_const($db,
"ONLINE_PAYMENT_CREDITOR",
GETPOST(
'ONLINE_PAYMENT_CREDITOR',
'alpha'),
'chaine', 0,
'', $conf->entity);
96 $result =
dolibarr_set_const($db,
"STRIPE_BANK_ACCOUNT_FOR_PAYMENTS",
GETPOST(
'STRIPE_BANK_ACCOUNT_FOR_PAYMENTS',
'int'),
'chaine', 0,
'', $conf->entity);
100 $result =
dolibarr_set_const($db,
"STRIPE_USER_ACCOUNT_FOR_ACTIONS",
GETPOST(
'STRIPE_USER_ACCOUNT_FOR_ACTIONS',
'int'),
'chaine', 0,
'', $conf->entity);
101 if (!($result > 0)) {
104 $result =
dolibarr_set_const($db,
"STRIPE_BANK_ACCOUNT_FOR_BANKTRANSFERS",
GETPOST(
'STRIPE_BANK_ACCOUNT_FOR_BANKTRANSFERS',
'int'),
'chaine', 0,
'', $conf->entity);
105 if (!($result > 0)) {
109 $result =
dolibarr_set_const($db,
"STRIPE_LOCATION",
GETPOST(
'STRIPE_LOCATION',
'alpha'),
'chaine', 0,
'', $conf->entity);
114 $result =
dolibarr_set_const($db,
"ONLINE_PAYMENT_CSS_URL",
GETPOST(
'ONLINE_PAYMENT_CSS_URL',
'alpha'),
'chaine', 0,
'', $conf->entity);
115 if (!($result > 0)) {
118 $result =
dolibarr_set_const($db,
"ONLINE_PAYMENT_MESSAGE_FORM",
GETPOST(
'ONLINE_PAYMENT_MESSAGE_FORM',
'restricthtml'),
'chaine', 0,
'', $conf->entity);
119 if (!($result > 0)) {
122 $result =
dolibarr_set_const($db,
"ONLINE_PAYMENT_MESSAGE_OK",
GETPOST(
'ONLINE_PAYMENT_MESSAGE_OK',
'restricthtml'),
'chaine', 0,
'', $conf->entity);
123 if (!($result > 0)) {
126 $result =
dolibarr_set_const($db,
"ONLINE_PAYMENT_MESSAGE_KO",
GETPOST(
'ONLINE_PAYMENT_MESSAGE_KO',
'restricthtml'),
'chaine', 0,
'', $conf->entity);
127 if (!($result > 0)) {
130 $result =
dolibarr_set_const($db,
"ONLINE_PAYMENT_SENDEMAIL",
GETPOST(
'ONLINE_PAYMENT_SENDEMAIL'),
'chaine', 0,
'', $conf->entity);
131 if (!($result > 0)) {
140 $result =
dolibarr_set_const($db,
"PAYMENT_SECURITY_TOKEN",
GETPOST(
'PAYMENT_SECURITY_TOKEN',
'alpha'),
'chaine', 0,
'', $conf->entity);
141 if (!($result > 0)) {
144 if (empty($conf->use_javascript_ajax)) {
145 $result =
dolibarr_set_const($db,
"PAYMENT_SECURITY_TOKEN_UNIQUE",
GETPOST(
'PAYMENT_SECURITY_TOKEN_UNIQUE',
'alpha'),
'chaine', 0,
'', $conf->entity);
146 if (!($result > 0)) {
160 if ($action ==
"setlive") {
161 $liveenable =
GETPOST(
'value',
'int');
162 $res =
dolibarr_set_const($db,
"STRIPE_LIVE", $liveenable,
'yesno', 0,
'', $conf->entity);
179 llxHeader(
'', $langs->trans(
"StripeSetup"));
181 $linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
186 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
187 print
'<input type="hidden" name="token" value="'.newToken().
'">';
188 print
'<input type="hidden" name="action" value="setvalue">';
192 $stripearrayofwebhookevents = array(
'account.updated',
'payout.created',
'payout.paid',
'charge.pending',
'charge.refunded',
'charge.succeeded',
'charge.failed',
'payment_intent.succeeded',
'payment_intent.payment_failed',
'payment_method.attached',
'payment_method.updated',
'payment_method.card_automatically_updated',
'payment_method.detached',
'source.chargeable',
'customer.deleted');
194 print
'<span class="opacitymedium">'.$langs->trans(
"StripeDesc").
"</span><br>\n";
198 print
'<div class="div-table-responsive-no-min">';
199 print
'<table class="noborder centpercent">';
200 print
'<tr class="liste_titre">';
201 print
'<td>'.$langs->trans(
"AccountParameter").
'</td>';
202 print
'<td>'.$langs->trans(
"Value").
'</td>';
206 print
'<tr class="oddeven">';
208 print $langs->trans(
"StripeLiveEnabled").
'</td><td>';
209 if ($conf->use_javascript_ajax) {
212 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
213 print
$form->selectarray(
"STRIPE_LIVE", $arrval, $conf->global->STRIPE_LIVE);
215 print
'</td><td></td></tr>';
217 if (empty($conf->stripeconnect->enabled)) {
218 print
'<tr class="oddeven"><td>';
219 print
'<span class="fieldrequired">'.$langs->trans(
"STRIPE_TEST_PUBLISHABLE_KEY").
'</span></td><td>';
220 print
'<input class="minwidth300" type="text" name="STRIPE_TEST_PUBLISHABLE_KEY" value="'.$conf->global->STRIPE_TEST_PUBLISHABLE_KEY.
'" placeholder="'.$langs->trans(
"Example").
': pk_test_xxxxxxxxxxxxxxxxxxxxxxxx">';
221 print
'</td><td></td></tr>';
223 print
'<tr class="oddeven"><td>';
224 print
'<span class="titlefield fieldrequired">'.$langs->trans(
"STRIPE_TEST_SECRET_KEY").
'</span></td><td>';
225 print
'<input class="minwidth300" type="text" name="STRIPE_TEST_SECRET_KEY" value="'.$conf->global->STRIPE_TEST_SECRET_KEY.
'" placeholder="'.$langs->trans(
"Example").
': sk_test_xxxxxxxxxxxxxxxxxxxxxxxx">';
226 print
'</td><td></td></tr>';
228 print
'<tr class="oddeven"><td>';
229 print
'<span class="titlefield">'.$langs->trans(
"STRIPE_TEST_WEBHOOK_KEY").
'</span></td><td>';
230 if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
231 print
'<input class="minwidth300" type="text" name="STRIPE_TEST_WEBHOOK_ID" value="'.getDolGlobalString(
'STRIPE_TEST_WEBHOOK_ID').
'" placeholder="'.$langs->trans(
"Example").
': we_xxxxxxxxxxxxxxxxxxxxxxxx">';
234 print
'<input class="minwidth300" type="text" name="STRIPE_TEST_WEBHOOK_KEY" value="'.getDolGlobalString(
'STRIPE_TEST_WEBHOOK_KEY').
'" placeholder="'.$langs->trans(
"Example").
': whsec_xxxxxxxxxxxxxxxxxxxxxxxx">';
235 $out =
img_picto(
'',
'globe').
' <span class="opacitymedium">'.$langs->trans(
"ToOfferALinkForTestWebhook").
'</span> ';
240 $out .=
'<input type="text" id="onlinetestwebhookurl" class="minwidth500" value="'.$url.
'" disabled>';
244 if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
245 if (!empty($conf->global->STRIPE_TEST_WEBHOOK_KEY) && !empty($conf->global->STRIPE_TEST_SECRET_KEY) && !empty($conf->global->STRIPE_TEST_WEBHOOK_ID)) {
246 \Stripe\Stripe::setApiKey($conf->global->STRIPE_TEST_SECRET_KEY);
247 $endpoint = \Stripe\WebhookEndpoint::retrieve($conf->global->STRIPE_TEST_WEBHOOK_ID);
248 $endpoint->enabled_events = $stripearrayofwebhookevents;
249 if (
GETPOST(
'webhook',
'alpha') == $conf->global->STRIPE_TEST_WEBHOOK_ID) {
250 if (!
GETPOST(
'status',
'alpha')) {
251 $endpoint->disabled =
true;
253 $endpoint->disabled =
false;
256 $endpoint->url = $url;
258 if ($endpoint->status ==
'enabled') {
259 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=ipn&webhook='.$endpoint->id.
'&status=0">';
260 print
img_picto($langs->trans(
"Activated"),
'switch_on');
262 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=ipn&webhook='.$endpoint->id.
'&status=1">';
263 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
267 print
img_picto($langs->trans(
"Inactive"),
'statut5');
272 print
'<tr class="oddeven"><td>'.$langs->trans(
"StripeConnect").
'</td>';
273 print
'<td><b>'.$langs->trans(
"StripeConnect_Mode").
'</b><br>';
274 print $langs->trans(
"STRIPE_APPLICATION_FEE_PLATFORM").
' ';
275 print
price($conf->global->STRIPE_APPLICATION_FEE_PERCENT);
277 print
price($conf->global->STRIPE_APPLICATION_FEE);
278 print
' '.$langs->getCurrencySymbol($conf->currency).
' '.$langs->trans(
"minimum").
' '.
price($conf->global->STRIPE_APPLICATION_FEE_MINIMAL).
' '.$langs->getCurrencySymbol($conf->currency);
279 print
'</td><td></td></tr>';
282 if (empty($conf->stripeconnect->enabled)) {
283 print
'<tr class="oddeven"><td>';
284 print
'<span class="fieldrequired">'.$langs->trans(
"STRIPE_LIVE_PUBLISHABLE_KEY").
'</span></td><td>';
285 print
'<input class="minwidth300" type="text" name="STRIPE_LIVE_PUBLISHABLE_KEY" value="'.getDolGlobalString(
'STRIPE_LIVE_PUBLISHABLE_KEY').
'" placeholder="'.$langs->trans(
"Example").
': pk_live_xxxxxxxxxxxxxxxxxxxxxxxx">';
286 print
'</td><td></td></tr>';
288 print
'<tr class="oddeven"><td>';
289 print
'<span class="fieldrequired">'.$langs->trans(
"STRIPE_LIVE_SECRET_KEY").
'</span></td><td>';
290 print
'<input class="minwidth300" type="text" name="STRIPE_LIVE_SECRET_KEY" value="'.getDolGlobalString(
'STRIPE_LIVE_SECRET_KEY').
'" placeholder="'.$langs->trans(
"Example").
': sk_live_xxxxxxxxxxxxxxxxxxxxxxxx">';
291 print
'</td><td></td></tr>';
293 print
'<tr class="oddeven"><td>';
294 print
'<span class="titlefield">'.$langs->trans(
"STRIPE_LIVE_WEBHOOK_KEY").
'</span></td><td>';
295 if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
296 print
'<input class="minwidth300" type="text" name="STRIPE_LIVE_WEBHOOK_ID" value="'.getDolGlobalString(
'STRIPE_LIVE_WEBHOOK_ID').
'" placeholder="'.$langs->trans(
"Example").
': we_xxxxxxxxxxxxxxxxxxxxxxxx">';
299 print
'<input class="minwidth300" type="text" name="STRIPE_LIVE_WEBHOOK_KEY" value="'.getDolGlobalString(
'STRIPE_LIVE_WEBHOOK_KEY').
'" placeholder="'.$langs->trans(
"Example").
': whsec_xxxxxxxxxxxxxxxxxxxxxxxx">';
300 $out =
img_picto(
'',
'globe',
'class="pictofixedwidth"').
' <span class="opacitymedium">'.$langs->trans(
"ToOfferALinkForLiveWebhook").
'</span> ';
304 $out .=
'<input type="text" id="onlinelivewebhookurl" class="minwidth500" value="'.$url.
'" disabled>';
308 if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
309 if (!empty($conf->global->STRIPE_LIVE_WEBHOOK_KEY) && !empty($conf->global->STRIPE_LIVE_SECRET_KEY) && !empty($conf->global->STRIPE_LIVE_WEBHOOK_ID)) {
310 \Stripe\Stripe::setApiKey($conf->global->STRIPE_LIVE_SECRET_KEY);
311 $endpoint = \Stripe\WebhookEndpoint::retrieve($conf->global->STRIPE_LIVE_WEBHOOK_ID);
312 $endpoint->enabled_events = $stripearrayofwebhookevents;
313 if (
GETPOST(
'webhook',
'alpha') == $conf->global->STRIPE_LIVE_WEBHOOK_ID) {
314 if (empty(
GETPOST(
'status',
'alpha'))) {
315 $endpoint->disabled =
true;
317 $endpoint->disabled =
false;
320 $endpoint->url = $url;
322 if ($endpoint->status ==
'enabled') {
323 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=ipn&webhook='.$endpoint->id.
'&status=0">';
324 print
img_picto($langs->trans(
"Activated"),
'switch_on');
326 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=ipn&webhook='.$endpoint->id.
'&status=1">';
327 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
331 print
img_picto($langs->trans(
"Inactive"),
'statut5');
336 print
'<tr class="oddeven"><td>'.$langs->trans(
"StripeConnect").
'</td>';
337 print
'<td>'.$langs->trans(
"StripeConnect_Mode").
'</td><td></td></tr>';
347 print
'<div class="div-table-responsive-no-min">';
348 print
'<table class="noborder centpercent">';
349 print
'<tr class="liste_titre">';
350 print
'<td>'.$langs->trans(
"UsageParameter").
'</td>';
351 print
'<td>'.$langs->trans(
"Value").
'</td>';
354 print
'<tr class="oddeven"><td>';
355 print $langs->trans(
"PublicVendorName").
'</td><td>';
356 print
'<input class="minwidth300" type="text" name="ONLINE_PAYMENT_CREDITOR" value="'.getDolGlobalString(
'ONLINE_PAYMENT_CREDITOR').
'">';
357 print
' <span class="opacitymedium">'.$langs->trans(
"Example").
': '.$mysoc->name.
'</span>';
360 print
'<tr class="oddeven"><td>';
361 print $langs->trans(
"StripeUserAccountForActions").
'</td><td>';
362 print
img_picto(
'',
'user',
'class="pictofixedwidth"').$form->select_dolusers(
getDolGlobalString(
'STRIPE_USER_ACCOUNT_FOR_ACTIONS'),
'STRIPE_USER_ACCOUNT_FOR_ACTIONS', 0);
365 print
'<tr class="oddeven"><td>';
366 print $langs->trans(
"BankAccount").
'</td><td>';
367 print
img_picto(
'',
'bank_account',
'class="pictofixedwidth"');
368 $form->select_comptes(
getDolGlobalString(
'STRIPE_BANK_ACCOUNT_FOR_PAYMENTS'),
'STRIPE_BANK_ACCOUNT_FOR_PAYMENTS', 0,
'', 1);
372 print
'<tr class="oddeven"><td>';
373 print $langs->trans(
"BankAccountForBankTransfer").
'</td><td>';
374 print
img_picto(
'',
'bank_account',
'class="pictofixedwidth"');
375 $form->select_comptes(
getDolGlobalString(
'STRIPE_BANK_ACCOUNT_FOR_BANKTRANSFERS'),
'STRIPE_BANK_ACCOUNT_FOR_BANKTRANSFERS', 0,
'', 1);
380 if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
381 print
'<tr class="oddeven"><td>';
382 print $langs->trans(
"STRIPE_CARD_PRESENT").
'</td><td>';
383 if ($conf->use_javascript_ajax) {
386 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
387 print
$form->selectarray(
"STRIPE_CARD_PRESENT", $arrval, $conf->global->STRIPE_CARD_PRESENT);
393 if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
394 print
'<tr class="oddeven"><td>';
395 print $langs->trans(
"TERMINAL_LOCATION").
'</td><td>';
396 $service =
'StripeTest';
398 if (!empty($conf->global->STRIPE_LIVE) && !
GETPOST(
'forcesandbox',
'alpha')) {
399 $service =
'StripeLive';
404 global $stripearrayofkeysbyenv;
405 $site_account = $stripearrayofkeysbyenv[$servicestatus][
'secret_key'];
406 if (!empty($site_account)) {
407 \Stripe\Stripe::setApiKey($site_account);
409 if (
isModEnabled(
'stripe') && (empty($conf->global->STRIPE_LIVE) ||
GETPOST(
'forcesandbox',
'alpha'))) {
410 $service =
'StripeTest';
411 $servicestatus =
'0';
412 dol_htmloutput_mesg($langs->trans(
'YouAreCurrentlyInSandboxMode',
'Stripe'),
'',
'warning');
414 $service =
'StripeLive';
415 $servicestatus =
'1';
417 $stripe =
new Stripe($db);
418 if (!empty($site_account)) {
420 $stripeacc = $stripe->getStripeAccount($service);
422 $locations = \Stripe\Terminal\Location::all(
'', array(
"stripe_account" => $stripeacc));
424 $locations = \Stripe\Terminal\Location::all();
428 print $e->getMessage().
'<br>';
433 $location[
""] = $langs->trans(
"NotDefined");
434 if (!empty($locations)) {
435 foreach ($locations as $tmplocation) {
436 $location[$tmplocation->id] = $tmplocation->display_name;
444 print
'<tr class="oddeven"><td>';
445 print $langs->trans(
"STRIPE_SEPA_DIRECT_DEBIT").
'</td><td>';
446 if ($conf->use_javascript_ajax) {
449 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
456 if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
457 print
'<tr class="oddeven"><td>';
458 print $langs->trans(
"STRIPE_KLARNA").
'</td><td>';
459 if ($conf->use_javascript_ajax) {
462 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
463 print
$form->selectarray(
"STRIPE_KLARNA", $arrval, $conf->global->STRIPE_KLARNA);
465 print
' <span class="opacitymedium">'.$langs->trans(
"ExampleOnlyForKlarnaCustomers").
'</span>';
470 if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
471 print
'<tr class="oddeven"><td>';
472 print $langs->trans(
"STRIPE_BANCONTACT").
'</td><td>';
473 if ($conf->use_javascript_ajax) {
476 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
477 print
$form->selectarray(
"STRIPE_BANCONTACT", $arrval, $conf->global->STRIPE_BANCONTACT);
479 print
' <span class="opacitymedium">'.$langs->trans(
"ExampleOnlyForBECustomers").
'</span>';
484 if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
485 print
'<tr class="oddeven"><td>';
486 print $langs->trans(
"STRIPE_IDEAL").
'</td><td>';
487 if ($conf->use_javascript_ajax) {
490 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
491 print
$form->selectarray(
"STRIPE_IDEAL", $arrval, $conf->global->STRIPE_SEPA_DIRECT_DEBIT);
493 print
' <span class="opacitymedium">'.$langs->trans(
"ExampleOnlyForNLCustomers").
'</span>';
498 if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
499 print
'<tr class="oddeven"><td>';
500 print $langs->trans(
"STRIPE_GIROPAY").
'</td><td>';
501 if ($conf->use_javascript_ajax) {
504 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
505 print
$form->selectarray(
"STRIPE_GIROPAY", $arrval, $conf->global->STRIPE_GIROPAY);
507 print
' <span class="opacitymedium">'.$langs->trans(
"ExampleOnlyForDECustomers").
'</span>';
512 if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
513 print
'<tr class="oddeven"><td>';
514 print $langs->trans(
"STRIPE_SOFORT").
'</td><td>';
515 if ($conf->use_javascript_ajax) {
518 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
519 print
$form->selectarray(
"STRIPE_SOFORT", $arrval, $conf->global->STRIPE_SOFORT);
521 print
' <span class="opacitymedium">'.$langs->trans(
"ExampleOnlyForATBEDEITNLESCustomers").
'</span>';
525 print
'<tr class="oddeven"><td>';
526 print $langs->trans(
"CSSUrlForPaymentForm").
'</td><td>';
527 print
'<input class="width500" type="text" name="ONLINE_PAYMENT_CSS_URL" value="'.$conf->global->ONLINE_PAYMENT_CSS_URL.
'">';
528 print
' <span class="opacitymedium">'.$langs->trans(
"Example").
': http://mysite/mycss.css</span>';
531 print
'<tr class="oddeven"><td>';
532 print $langs->trans(
"MessageForm").
'</td><td>';
533 $doleditor =
new DolEditor(
'ONLINE_PAYMENT_MESSAGE_FORM', $conf->global->ONLINE_PAYMENT_MESSAGE_FORM,
'', 100,
'dolibarr_details',
'In',
false,
true,
true, ROWS_2,
'90%');
534 $doleditor->Create();
537 print
'<tr class="oddeven"><td>';
538 print $langs->trans(
"MessageOK").
'</td><td>';
539 $doleditor =
new DolEditor(
'ONLINE_PAYMENT_MESSAGE_OK', $conf->global->ONLINE_PAYMENT_MESSAGE_OK,
'', 100,
'dolibarr_details',
'In',
false,
true,
true, ROWS_2,
'90%');
540 $doleditor->Create();
543 print
'<tr class="oddeven"><td>';
544 print $langs->trans(
"MessageKO").
'</td><td>';
545 $doleditor =
new DolEditor(
'ONLINE_PAYMENT_MESSAGE_KO', $conf->global->ONLINE_PAYMENT_MESSAGE_KO,
'', 100,
'dolibarr_details',
'In',
false,
true,
true, ROWS_2,
'90%');
546 $doleditor->Create();
549 print
'<tr class="oddeven"><td>';
550 print $langs->trans(
"ONLINE_PAYMENT_SENDEMAIL").
'</td><td>';
551 print
img_picto(
'',
'email',
'class="pictofixedwidth"');
552 print
'<input class="minwidth200" type="text" name="ONLINE_PAYMENT_SENDEMAIL" value="'.$conf->global->ONLINE_PAYMENT_SENDEMAIL.
'">';
553 print
' <span class="opacitymedium">'.$langs->trans(
"Example").
': myemail@myserver.com, Payment service <myemail2@myserver2.com></span>';
561 print
'<div class="div-table-responsive-no-min">';
562 print
'<table class="noborder centpercent">';
564 print
'<tr class="liste_titre">';
565 print
'<td>'.$langs->trans(
"UrlGenerationParameters").
'</td>';
566 print
'<td>'.$langs->trans(
"Value").
'</td>';
570 print
'<tr class="oddeven"><td>';
571 print $langs->trans(
"SecurityToken").
'</td><td>';
572 print
'<input class="minwidth300" type="text" id="PAYMENT_SECURITY_TOKEN" name="PAYMENT_SECURITY_TOKEN" value="'.$conf->global->PAYMENT_SECURITY_TOKEN.
'">';
573 if (!empty($conf->use_javascript_ajax)) {
574 print
' '.img_picto($langs->trans(
'Generate'),
'refresh',
'id="generate_token" class="linkobject"');
576 if (!empty($conf->global->PAYMENT_SECURITY_ACCEPT_ANY_TOKEN)) {
577 $langs->load(
"errors");
578 print
img_warning($langs->trans(
"WarningTheHiddenOptionIsOn",
'PAYMENT_SECURITY_ACCEPT_ANY_TOKEN'),
'',
'pictowarning marginleftonly');
582 print
'<tr class="oddeven"><td>';
583 print $langs->trans(
"SecurityTokenIsUnique").
'</td><td>';
584 if ($conf->use_javascript_ajax) {
587 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
588 print
$form->selectarray(
"PAYMENT_SECURITY_TOKEN_UNIQUE", $arrval, $conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE);
597 print
$form->buttonsSaveCancel(
"Save",
'');
606 include DOL_DOCUMENT_ROOT.
'/core/tpl/onlinepaymentlinks.tpl.php';
608 print
info_admin($langs->trans(
"ExampleOfTestCreditCard",
'4242424242424242 (no 3DSecure) or 4000000000003063 (3DSecure required) or 4000002760003184 (3DSecure2 required on all transaction) or 4000003800000446 (3DSecure2 required, the off-session allowed)',
'4000000000000101',
'4000000000000069',
'4000000000000341'));
611 print
info_admin($langs->trans(
"ExampleOfTestBankAcountForSEPA",
'AT611904300234573201 (pending->succeed) or AT861904300235473202 (pending->failed)'));
616 if (!empty($conf->use_javascript_ajax)) {
617 print
"\n".
'<script type="text/javascript">';
618 print
'$(document).ready(function () {
620 $("#apidoca").click(function() {
621 console.log("We click on apidoca show/hide");
623 $("#apidoca").hide();
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).
ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0, $strict=0, $forcereload=0, $marginleftonlyshort=2, $forcenoajax=0, $setzeroinsteadofdel=0, $suffix='', $mode='', $morecss='inline-block')
On/off button for constant.
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.
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
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.
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
ajax_autoselect($htmlname, $addlink='', $textonlink='Link')
Make content of an input box selected when we click into input field.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='')
Show information for admin users or standard users.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_htmloutput_mesg($mesgstring='', $mesgarray=array(), $style='ok', $keepembedded=0)
Print formated messages to output (Used to show messages on html output).
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.
stripeadmin_prepare_head()
Define head array for tabs of stripe tools setup pages.