28 require
'../../main.inc.php';
29 require_once DOL_DOCUMENT_ROOT.
'/stripe/lib/stripe.lib.php';
30 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
32 require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
33 require_once DOL_DOCUMENT_ROOT.
'/stripe/class/stripe.class.php';
35 $servicename =
'Stripe';
38 $langs->loadLangs(array(
'admin',
'other',
'paypal',
'paybox',
'stripe'));
40 if (empty($user->admin)) {
43 if (empty($conf->stripe->enabled)) {
47 $action =
GETPOST(
'action',
'aZ09');
54 if ($action ==
'setvalue' && $user->admin) {
57 if (empty($conf->stripeconnect->enabled)) {
58 $result =
dolibarr_set_const($db,
"STRIPE_TEST_PUBLISHABLE_KEY",
GETPOST(
'STRIPE_TEST_PUBLISHABLE_KEY',
'alpha'),
'chaine', 0,
'', $conf->entity);
62 $result =
dolibarr_set_const($db,
"STRIPE_TEST_SECRET_KEY",
GETPOST(
'STRIPE_TEST_SECRET_KEY',
'alpha'),
'chaine', 0,
'', $conf->entity);
66 $result =
dolibarr_set_const($db,
"STRIPE_TEST_WEBHOOK_ID",
GETPOST(
'STRIPE_TEST_WEBHOOK_ID',
'alpha'),
'chaine', 0,
'', $conf->entity);
70 $result =
dolibarr_set_const($db,
"STRIPE_TEST_WEBHOOK_KEY",
GETPOST(
'STRIPE_TEST_WEBHOOK_KEY',
'alpha'),
'chaine', 0,
'', $conf->entity);
74 $result =
dolibarr_set_const($db,
"STRIPE_LIVE_PUBLISHABLE_KEY",
GETPOST(
'STRIPE_LIVE_PUBLISHABLE_KEY',
'alpha'),
'chaine', 0,
'', $conf->entity);
78 $result =
dolibarr_set_const($db,
"STRIPE_LIVE_SECRET_KEY",
GETPOST(
'STRIPE_LIVE_SECRET_KEY',
'alpha'),
'chaine', 0,
'', $conf->entity);
82 $result =
dolibarr_set_const($db,
"STRIPE_LIVE_WEBHOOK_ID",
GETPOST(
'STRIPE_LIVE_WEBHOOK_ID',
'alpha'),
'chaine', 0,
'', $conf->entity);
86 $result =
dolibarr_set_const($db,
"STRIPE_LIVE_WEBHOOK_KEY",
GETPOST(
'STRIPE_LIVE_WEBHOOK_KEY',
'alpha'),
'chaine', 0,
'', $conf->entity);
91 $result =
dolibarr_set_const($db,
"ONLINE_PAYMENT_CREDITOR",
GETPOST(
'ONLINE_PAYMENT_CREDITOR',
'alpha'),
'chaine', 0,
'', $conf->entity);
95 $result =
dolibarr_set_const($db,
"STRIPE_BANK_ACCOUNT_FOR_PAYMENTS",
GETPOST(
'STRIPE_BANK_ACCOUNT_FOR_PAYMENTS',
'int'),
'chaine', 0,
'', $conf->entity);
99 $result =
dolibarr_set_const($db,
"STRIPE_USER_ACCOUNT_FOR_ACTIONS",
GETPOST(
'STRIPE_USER_ACCOUNT_FOR_ACTIONS',
'int'),
'chaine', 0,
'', $conf->entity);
100 if (!($result > 0)) {
103 $result =
dolibarr_set_const($db,
"STRIPE_BANK_ACCOUNT_FOR_BANKTRANSFERS",
GETPOST(
'STRIPE_BANK_ACCOUNT_FOR_BANKTRANSFERS',
'int'),
'chaine', 0,
'', $conf->entity);
104 if (!($result > 0)) {
107 $result =
dolibarr_set_const($db,
"ONLINE_PAYMENT_CSS_URL",
GETPOST(
'ONLINE_PAYMENT_CSS_URL',
'alpha'),
'chaine', 0,
'', $conf->entity);
108 if (!($result > 0)) {
111 $result =
dolibarr_set_const($db,
"ONLINE_PAYMENT_MESSAGE_FORM",
GETPOST(
'ONLINE_PAYMENT_MESSAGE_FORM',
'restricthtml'),
'chaine', 0,
'', $conf->entity);
112 if (!($result > 0)) {
115 $result =
dolibarr_set_const($db,
"ONLINE_PAYMENT_MESSAGE_OK",
GETPOST(
'ONLINE_PAYMENT_MESSAGE_OK',
'restricthtml'),
'chaine', 0,
'', $conf->entity);
116 if (!($result > 0)) {
119 $result =
dolibarr_set_const($db,
"ONLINE_PAYMENT_MESSAGE_KO",
GETPOST(
'ONLINE_PAYMENT_MESSAGE_KO',
'restricthtml'),
'chaine', 0,
'', $conf->entity);
120 if (!($result > 0)) {
123 $result =
dolibarr_set_const($db,
"ONLINE_PAYMENT_SENDEMAIL",
GETPOST(
'ONLINE_PAYMENT_SENDEMAIL'),
'chaine', 0,
'', $conf->entity);
124 if (!($result > 0)) {
133 $result =
dolibarr_set_const($db,
"PAYMENT_SECURITY_TOKEN",
GETPOST(
'PAYMENT_SECURITY_TOKEN',
'alpha'),
'chaine', 0,
'', $conf->entity);
134 if (!($result > 0)) {
137 if (empty($conf->use_javascript_ajax)) {
138 $result =
dolibarr_set_const($db,
"PAYMENT_SECURITY_TOKEN_UNIQUE",
GETPOST(
'PAYMENT_SECURITY_TOKEN_UNIQUE',
'alpha'),
'chaine', 0,
'', $conf->entity);
139 if (!($result > 0)) {
153 if ($action ==
"setlive") {
154 $liveenable =
GETPOST(
'value',
'int');
155 $res =
dolibarr_set_const($db,
"STRIPE_LIVE", $liveenable,
'yesno', 0,
'', $conf->entity);
172 llxHeader(
'', $langs->trans(
"StripeSetup"));
174 $linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
179 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
180 print
'<input type="hidden" name="token" value="'.newToken().
'">';
181 print
'<input type="hidden" name="action" value="setvalue">';
185 $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');
187 print
'<span class="opacitymedium">'.$langs->trans(
"StripeDesc").
"</span><br>\n";
191 print
'<div class="div-table-responsive-no-min">';
192 print
'<table class="noborder centpercent">';
193 print
'<tr class="liste_titre">';
194 print
'<td>'.$langs->trans(
"AccountParameter").
'</td>';
195 print
'<td>'.$langs->trans(
"Value").
'</td>';
199 print
'<tr class="oddeven">';
201 print $langs->trans(
"StripeLiveEnabled").
'</td><td>';
202 if ($conf->use_javascript_ajax) {
205 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
206 print
$form->selectarray(
"STRIPE_LIVE", $arrval, $conf->global->STRIPE_LIVE);
208 print
'</td><td></td></tr>';
210 if (empty($conf->stripeconnect->enabled)) {
211 print
'<tr class="oddeven"><td>';
212 print
'<span class="fieldrequired">'.$langs->trans(
"STRIPE_TEST_PUBLISHABLE_KEY").
'</span></td><td>';
213 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">';
214 print
'</td><td></td></tr>';
216 print
'<tr class="oddeven"><td>';
217 print
'<span class="titlefield fieldrequired">'.$langs->trans(
"STRIPE_TEST_SECRET_KEY").
'</span></td><td>';
218 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">';
219 print
'</td><td></td></tr>';
221 print
'<tr class="oddeven"><td>';
222 print
'<span class="titlefield">'.$langs->trans(
"STRIPE_TEST_WEBHOOK_KEY").
'</span></td><td>';
223 if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
224 print
'<input class="minwidth300" type="text" name="STRIPE_TEST_WEBHOOK_ID" value="'.getDolGlobalString(
'STRIPE_TEST_WEBHOOK_ID').
'" placeholder="'.$langs->trans(
"Example").
': we_xxxxxxxxxxxxxxxxxxxxxxxx">';
227 print
'<input class="minwidth300" type="text" name="STRIPE_TEST_WEBHOOK_KEY" value="'.getDolGlobalString(
'STRIPE_TEST_WEBHOOK_KEY').
'" placeholder="'.$langs->trans(
"Example").
': whsec_xxxxxxxxxxxxxxxxxxxxxxxx">';
228 $out =
img_picto(
'',
'globe').
' <span class="opacitymedium">'.$langs->trans(
"ToOfferALinkForTestWebhook").
'</span> ';
230 $out .=
'<input type="text" id="onlinetestwebhookurl" class="minwidth500" value="'.$url.
'" disabled>';
234 if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
235 if (!empty($conf->global->STRIPE_TEST_WEBHOOK_KEY) && !empty($conf->global->STRIPE_TEST_SECRET_KEY) && !empty($conf->global->STRIPE_TEST_WEBHOOK_ID)) {
236 \Stripe\Stripe::setApiKey($conf->global->STRIPE_TEST_SECRET_KEY);
237 $endpoint = \Stripe\WebhookEndpoint::retrieve($conf->global->STRIPE_TEST_WEBHOOK_ID);
238 $endpoint->enabled_events = $stripearrayofwebhookevents;
239 if (
GETPOST(
'webhook',
'alpha') == $conf->global->STRIPE_TEST_WEBHOOK_ID) {
240 if (!
GETPOST(
'status',
'alpha')) {
241 $endpoint->disabled =
true;
243 $endpoint->disabled =
false;
246 $endpoint->url =
dol_buildpath(
'/public/stripe/ipn.php?test', 3);
248 if ($endpoint->status ==
'enabled') {
249 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=ipn&webhook='.$endpoint->id.
'&status=0">';
250 print
img_picto($langs->trans(
"Activated"),
'switch_on');
252 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=ipn&webhook='.$endpoint->id.
'&status=1">';
253 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
257 print
img_picto($langs->trans(
"Inactive"),
'statut5');
262 print
'<tr class="oddeven"><td>'.$langs->trans(
"StripeConnect").
'</td>';
263 print
'<td><b>'.$langs->trans(
"StripeConnect_Mode").
'</b><br>';
264 print $langs->trans(
"STRIPE_APPLICATION_FEE_PLATFORM").
' ';
265 print
price($conf->global->STRIPE_APPLICATION_FEE_PERCENT);
267 print
price($conf->global->STRIPE_APPLICATION_FEE);
268 print
' '.$langs->getCurrencySymbol($conf->currency).
' '.$langs->trans(
"minimum").
' '.
price($conf->global->STRIPE_APPLICATION_FEE_MINIMAL).
' '.$langs->getCurrencySymbol($conf->currency);
269 print
'</td><td></td></tr>';
272 if (empty($conf->stripeconnect->enabled)) {
273 print
'<tr class="oddeven"><td>';
274 print
'<span class="fieldrequired">'.$langs->trans(
"STRIPE_LIVE_PUBLISHABLE_KEY").
'</span></td><td>';
275 print
'<input class="minwidth300" type="text" name="STRIPE_LIVE_PUBLISHABLE_KEY" value="'.getDolGlobalString(
'STRIPE_LIVE_PUBLISHABLE_KEY').
'" placeholder="'.$langs->trans(
"Example").
': pk_live_xxxxxxxxxxxxxxxxxxxxxxxx">';
276 print
'</td><td></td></tr>';
278 print
'<tr class="oddeven"><td>';
279 print
'<span class="fieldrequired">'.$langs->trans(
"STRIPE_LIVE_SECRET_KEY").
'</span></td><td>';
280 print
'<input class="minwidth300" type="text" name="STRIPE_LIVE_SECRET_KEY" value="'.getDolGlobalString(
'STRIPE_LIVE_SECRET_KEY').
'" placeholder="'.$langs->trans(
"Example").
': sk_live_xxxxxxxxxxxxxxxxxxxxxxxx">';
281 print
'</td><td></td></tr>';
283 print
'<tr class="oddeven"><td>';
284 print
'<span class="titlefield">'.$langs->trans(
"STRIPE_LIVE_WEBHOOK_KEY").
'</span></td><td>';
285 if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
286 print
'<input class="minwidth300" type="text" name="STRIPE_LIVE_WEBHOOK_ID" value="'.getDolGlobalString(
'STRIPE_LIVE_WEBHOOK_ID').
'" placeholder="'.$langs->trans(
"Example").
': we_xxxxxxxxxxxxxxxxxxxxxxxx">';
289 print
'<input class="minwidth300" type="text" name="STRIPE_LIVE_WEBHOOK_KEY" value="'.$conf->global->STRIPE_LIVE_WEBHOOK_KEY.
'" placeholder="'.$langs->trans(
"Example").
': whsec_xxxxxxxxxxxxxxxxxxxxxxxx">';
290 $out =
img_picto(
'',
'globe',
'class="pictofixedwidth"').
' <span class="opacitymedium">'.$langs->trans(
"ToOfferALinkForLiveWebhook").
'</span> ';
292 $out .=
'<input type="text" id="onlinelivewebhookurl" class="minwidth500" value="'.$url.
'" disabled>';
296 if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
297 if (!empty($conf->global->STRIPE_LIVE_WEBHOOK_KEY) && !empty($conf->global->STRIPE_LIVE_SECRET_KEY) && !empty($conf->global->STRIPE_LIVE_WEBHOOK_ID)) {
298 \Stripe\Stripe::setApiKey($conf->global->STRIPE_LIVE_SECRET_KEY);
299 $endpoint = \Stripe\WebhookEndpoint::retrieve($conf->global->STRIPE_LIVE_WEBHOOK_ID);
300 $endpoint->enabled_events = $stripearrayofwebhookevents;
301 if (
GETPOST(
'webhook',
'alpha') == $conf->global->STRIPE_LIVE_WEBHOOK_ID) {
302 if (empty(
GETPOST(
'status',
'alpha'))) {
303 $endpoint->disabled =
true;
305 $endpoint->disabled =
false;
310 if ($endpoint->status ==
'enabled') {
311 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=ipn&webhook='.$endpoint->id.
'&status=0">';
312 print
img_picto($langs->trans(
"Activated"),
'switch_on');
314 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=ipn&webhook='.$endpoint->id.
'&status=1">';
315 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
319 print
img_picto($langs->trans(
"Inactive"),
'statut5');
324 print
'<tr class="oddeven"><td>'.$langs->trans(
"StripeConnect").
'</td>';
325 print
'<td>'.$langs->trans(
"StripeConnect_Mode").
'</td><td></td></tr>';
335 print
'<div class="div-table-responsive-no-min">';
336 print
'<table class="noborder centpercent">';
337 print
'<tr class="liste_titre">';
338 print
'<td>'.$langs->trans(
"UsageParameter").
'</td>';
339 print
'<td>'.$langs->trans(
"Value").
'</td>';
342 print
'<tr class="oddeven"><td>';
343 print $langs->trans(
"PublicVendorName").
'</td><td>';
344 print
'<input class="minwidth300" type="text" name="ONLINE_PAYMENT_CREDITOR" value="'.getDolGlobalString(
'ONLINE_PAYMENT_CREDITOR').
'">';
345 print
' <span class="opacitymedium">'.$langs->trans(
"Example").
': '.$mysoc->name.
'</span>';
348 print
'<tr class="oddeven"><td>';
349 print $langs->trans(
"StripeUserAccountForActions").
'</td><td>';
350 print
img_picto(
'',
'user',
'class="pictofixedwidth"').$form->select_dolusers(
getDolGlobalString(
'STRIPE_USER_ACCOUNT_FOR_ACTIONS'),
'STRIPE_USER_ACCOUNT_FOR_ACTIONS', 0);
353 print
'<tr class="oddeven"><td>';
354 print $langs->trans(
"BankAccount").
'</td><td>';
355 print
img_picto(
'',
'bank_account',
'class="pictofixedwidth"');
356 $form->select_comptes(
getDolGlobalString(
'STRIPE_BANK_ACCOUNT_FOR_PAYMENTS'),
'STRIPE_BANK_ACCOUNT_FOR_PAYMENTS', 0,
'', 1);
360 print
'<tr class="oddeven"><td>';
361 print $langs->trans(
"BankAccountForBankTransfer").
'</td><td>';
362 print
img_picto(
'',
'bank_account',
'class="pictofixedwidth"');
363 $form->select_comptes(
getDolGlobalString(
'STRIPE_BANK_ACCOUNT_FOR_BANKTRANSFERS'),
'STRIPE_BANK_ACCOUNT_FOR_BANKTRANSFERS', 0,
'', 1);
368 if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
369 print
'<tr class="oddeven"><td>';
370 print $langs->trans(
"STRIPE_PAYMENT_REQUEST_API").
' ?? Not used, what is it for ??</td><td>';
371 if ($conf->use_javascript_ajax) {
374 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
375 print
$form->selectarray(
"STRIPE_PAYMENT_REQUEST_API", $arrval,
getDolGlobalString(
'STRIPE_PAYMENT_REQUEST_API'));
381 if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
382 print
'<tr class="oddeven"><td>';
383 print $langs->trans(
"STRIPE_SEPA_DIRECT_DEBIT").
'</td><td>';
384 if ($conf->use_javascript_ajax) {
387 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
394 if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
395 print
'<tr class="oddeven"><td>';
396 print $langs->trans(
"STRIPE_KLARNA").
'</td><td>';
397 if ($conf->use_javascript_ajax) {
400 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
401 print
$form->selectarray(
"STRIPE_KLARNA", $arrval, $conf->global->STRIPE_KLARNA);
403 print
' <span class="opacitymedium">'.$langs->trans(
"ExampleOnlyForKlarnaCustomers").
'</span>';
408 if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
409 print
'<tr class="oddeven"><td>';
410 print $langs->trans(
"STRIPE_BANCONTACT").
'</td><td>';
411 if ($conf->use_javascript_ajax) {
414 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
415 print
$form->selectarray(
"STRIPE_BANCONTACT", $arrval, $conf->global->STRIPE_BANCONTACT);
417 print
' <span class="opacitymedium">'.$langs->trans(
"ExampleOnlyForBECustomers").
'</span>';
422 if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
423 print
'<tr class="oddeven"><td>';
424 print $langs->trans(
"STRIPE_IDEAL").
'</td><td>';
425 if ($conf->use_javascript_ajax) {
428 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
429 print
$form->selectarray(
"STRIPE_IDEAL", $arrval, $conf->global->STRIPE_SEPA_DIRECT_DEBIT);
431 print
' <span class="opacitymedium">'.$langs->trans(
"ExampleOnlyForNLCustomers").
'</span>';
436 if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
437 print
'<tr class="oddeven"><td>';
438 print $langs->trans(
"STRIPE_GIROPAY").
'</td><td>';
439 if ($conf->use_javascript_ajax) {
442 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
443 print
$form->selectarray(
"STRIPE_GIROPAY", $arrval, $conf->global->STRIPE_GIROPAY);
445 print
' <span class="opacitymedium">'.$langs->trans(
"ExampleOnlyForDECustomers").
'</span>';
450 if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
451 print
'<tr class="oddeven"><td>';
452 print $langs->trans(
"STRIPE_SOFORT").
'</td><td>';
453 if ($conf->use_javascript_ajax) {
456 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
457 print
$form->selectarray(
"STRIPE_SOFORT", $arrval, $conf->global->STRIPE_SOFORT);
459 print
' <span class="opacitymedium">'.$langs->trans(
"ExampleOnlyForATBEDEITNLESCustomers").
'</span>';
463 print
'<tr class="oddeven"><td>';
464 print $langs->trans(
"CSSUrlForPaymentForm").
'</td><td>';
465 print
'<input size="64" type="text" name="ONLINE_PAYMENT_CSS_URL" value="'.$conf->global->ONLINE_PAYMENT_CSS_URL.
'">';
466 print
' <span class="opacitymedium">'.$langs->trans(
"Example").
': http://mysite/mycss.css</span>';
469 print
'<tr class="oddeven"><td>';
470 print $langs->trans(
"MessageForm").
'</td><td>';
471 $doleditor =
new DolEditor(
'ONLINE_PAYMENT_MESSAGE_FORM', $conf->global->ONLINE_PAYMENT_MESSAGE_FORM,
'', 100,
'dolibarr_details',
'In',
false,
true,
true, ROWS_2,
'90%');
472 $doleditor->Create();
475 print
'<tr class="oddeven"><td>';
476 print $langs->trans(
"MessageOK").
'</td><td>';
477 $doleditor =
new DolEditor(
'ONLINE_PAYMENT_MESSAGE_OK', $conf->global->ONLINE_PAYMENT_MESSAGE_OK,
'', 100,
'dolibarr_details',
'In',
false,
true,
true, ROWS_2,
'90%');
478 $doleditor->Create();
481 print
'<tr class="oddeven"><td>';
482 print $langs->trans(
"MessageKO").
'</td><td>';
483 $doleditor =
new DolEditor(
'ONLINE_PAYMENT_MESSAGE_KO', $conf->global->ONLINE_PAYMENT_MESSAGE_KO,
'', 100,
'dolibarr_details',
'In',
false,
true,
true, ROWS_2,
'90%');
484 $doleditor->Create();
487 print
'<tr class="oddeven"><td>';
488 print $langs->trans(
"ONLINE_PAYMENT_SENDEMAIL").
'</td><td>';
489 print
img_picto(
'',
'email',
'class="pictofixedwidth"');
490 print
'<input class="minwidth200" type="text" name="ONLINE_PAYMENT_SENDEMAIL" value="'.$conf->global->ONLINE_PAYMENT_SENDEMAIL.
'">';
491 print
' <span class="opacitymedium">'.$langs->trans(
"Example").
': myemail@myserver.com, Payment service <myemail2@myserver2.com></span>';
499 print
'<div class="div-table-responsive-no-min">';
500 print
'<table class="noborder centpercent">';
502 print
'<tr class="liste_titre">';
503 print
'<td>'.$langs->trans(
"UrlGenerationParameters").
'</td>';
504 print
'<td>'.$langs->trans(
"Value").
'</td>';
508 print
'<tr class="oddeven"><td>';
509 print $langs->trans(
"SecurityToken").
'</td><td>';
510 print
'<input class="minwidth300" type="text" id="PAYMENT_SECURITY_TOKEN" name="PAYMENT_SECURITY_TOKEN" value="'.$conf->global->PAYMENT_SECURITY_TOKEN.
'">';
511 if (!empty($conf->use_javascript_ajax)) {
512 print
' '.img_picto($langs->trans(
'Generate'),
'refresh',
'id="generate_token" class="linkobject"');
514 if (!empty($conf->global->PAYMENT_SECURITY_ACCEPT_ANY_TOKEN)) {
515 $langs->load(
"errors");
516 print
img_warning($langs->trans(
"WarningTheHiddenOptionIsOn",
'PAYMENT_SECURITY_ACCEPT_ANY_TOKEN'),
'',
'pictowarning marginleftonly');
520 print
'<tr class="oddeven"><td>';
521 print $langs->trans(
"SecurityTokenIsUnique").
'</td><td>';
522 if ($conf->use_javascript_ajax) {
525 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
526 print
$form->selectarray(
"PAYMENT_SECURITY_TOKEN_UNIQUE", $arrval, $conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE);
535 print
$form->buttonsSaveCancel(
"Save",
'');
544 include DOL_DOCUMENT_ROOT.
'/core/tpl/onlinepaymentlinks.tpl.php';
546 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'));
548 if (!empty($conf->use_javascript_ajax)) {
549 print
"\n".
'<script type="text/javascript">';
550 print
'$(document).ready(function () {
552 $("#apidoca").click(function() {
553 console.log("We click on apidoca show/hide");
555 $("#apidoca").hide();