30require
'../../main.inc.php';
31require_once DOL_DOCUMENT_ROOT.
'/stripe/lib/stripe.lib.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
34require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
35require_once DOL_DOCUMENT_ROOT.
'/stripe/class/stripe.class.php';
37$servicename =
'Stripe';
38$listofsupportedhooks = array();
40$listofsupportedhooks[] = array(
'code' =>
'payment_intent.payment_failed',
'status' => 1);
41$listofsupportedhooks[] = array(
'code' =>
'payment_intent.succeeded',
'status' => 1);
43$listofsupportedhooks[] = array(
'code' =>
'charge.dispute.closed',
'status' => 1);
44$listofsupportedhooks[] = array(
'code' =>
'charge.dispute.created',
'status' => 1);
45$listofsupportedhooks[] = array(
'code' =>
'charge.dispute.funds_withdrawn',
'status' => 1);
47$listofsupportedhooks[] = array(
'code' =>
'payout.create',
'status' =>
getDolGlobalString(
'STRIPE_AUTO_RECORD_PAYOUT') ? 1 : 0);
48$listofsupportedhooks[] = array(
'code' =>
'payout.paid',
'status' =>
getDolGlobalString(
'STRIPE_AUTO_RECORD_PAYOUT') ? 1 : 0);
61$langs->loadLangs(array(
'admin',
'other',
'paypal',
'stripe'));
63if (empty($user->admin)) {
66if (empty(
$conf->stripe->enabled)) {
70$action =
GETPOST(
'action',
'aZ09');
78if ($action ==
'setvalue' && $user->admin) {
81 if (empty(
$conf->stripeconnect->enabled)) {
103 if (!($result > 0)) {
107 if (!($result > 0)) {
111 if (!($result > 0)) {
116 if (!($result > 0)) {
120 if (!($result > 0)) {
124 if (!($result > 0)) {
128 if (!($result > 0)) {
138 if (!($result > 0)) {
142 if (!($result > 0)) {
146 if (!($result > 0)) {
150 if (!($result > 0)) {
154 if (!($result > 0)) {
164 if (!($result > 0)) {
177if ($action ==
"setlive") {
196llxHeader(
'', $langs->trans(
"StripeSetup"));
198$linkback =
'<a href="'.dolBuildUrl(DOL_URL_ROOT.
'/admin/modules.php', [
'restore_lastsearch_values' => 1]).
'">'.
img_picto($langs->trans(
"BackToModuleList"),
'back',
'class="pictofixedwidth"').
'<span class="hideonsmartphone">'.$langs->trans(
"BackToModuleList").
'</span></a>';
204print
'<form method="POST" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
205print
'<input type="hidden" name="token" value="'.newToken().
'">';
206print
'<input type="hidden" name="action" value="setvalue">';
207print
'<input type="hidden" name="page_y" value="">';
211$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');
213print
'<div class="info">'.$langs->trans(
"StripeDesc").
"</div><br>\n";
215print
'<div class="div-table-responsive-no-min">';
216print
'<table class="noborder centpercent">';
217print
'<tr class="liste_titre">';
218print
'<td>'.$langs->trans(
"AccountParameter").
'</td>';
223print
'<tr class="oddeven">';
225print $langs->trans(
"StripeLiveEnabled").
'</td><td>';
226if (
$conf->use_javascript_ajax) {
227 print ajax_constantonoff(
'STRIPE_LIVE');
229 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
230 print $form->selectarray(
"STRIPE_LIVE", $arrval,
$conf->global->STRIPE_LIVE);
232print
'</td><td></td></tr>';
234if (empty(
$conf->stripeconnect->enabled)) {
235 print
'<tr class="oddeven"><td>';
236 print
'<span class="fieldrequired">'.$langs->trans(
"STRIPE_TEST_PUBLISHABLE_KEY").
'</span></td><td>';
237 print
'<input class="minwidth300" type="text" name="STRIPE_TEST_PUBLISHABLE_KEY" value="' .
getDolGlobalString(
'STRIPE_TEST_PUBLISHABLE_KEY').
'" placeholder="'.$langs->trans(
"Example").
': pk_test_xxxxxxxxxxxxxxxxxxxxxxxx">';
238 print
'</td><td></td></tr>';
240 print
'<tr class="oddeven"><td>';
241 print
'<span class="titlefield fieldrequired">'.$langs->trans(
"STRIPE_TEST_SECRET_KEY").
'</span></td><td>';
242 print
'<input class="minwidth300 input-icon-password" type="password" id="STRIPE_TEST_SECRET_KEY" name="STRIPE_TEST_SECRET_KEY" value="' .
getDolGlobalString(
'STRIPE_TEST_SECRET_KEY').
'" placeholder="'.$langs->trans(
"Example").
': sk_test_xxxxxxxxxxxxxxxxxxxxxxxx">';
244 print
showEyeForField(
'eyeSTRIPE_TEST_SECRET_KEY',
'STRIPE_TEST_SECRET_KEY');
246 print
'</td><td></td></tr>';
248 print
'<tr class="oddeven"><td>';
249 print
'<span class="titlefield">'.$langs->trans(
"STRIPE_TEST_WEBHOOK_KEY").
'</span></td><td>';
251 print
'<input class="minwidth300" type="text" name="STRIPE_TEST_WEBHOOK_ID" value="'.getDolGlobalString(
'STRIPE_TEST_WEBHOOK_ID').
'" placeholder="'.$langs->trans(
"Example").
': we_xxxxxxxxxxxxxxxxxxxxxxxx">';
254 print
'<input class="minwidth300 input-icon-password" type="password" id="STRIPE_TEST_WEBHOOK_KEY" name="STRIPE_TEST_WEBHOOK_KEY" value="'.getDolGlobalString(
'STRIPE_TEST_WEBHOOK_KEY').
'" placeholder="'.$langs->trans(
"Example").
': whsec_xxxxxxxxxxxxxxxxxxxxxxxx">';
256 print
showEyeForField(
'eyeSTRIPE_TEST_WEBHOOK_KEY',
'STRIPE_TEST_WEBHOOK_KEY');
258 $out =
img_picto(
'',
'globe').
' <span class="opacitymedium">'.$langs->trans(
"ToOfferALinkForTestWebhook").
'</span> ';
263 $out .=
'<input type="text" id="onlinetestwebhookurl" class="minwidth500" value="'.$url.
'" disabled>';
267 $messagepopup = $langs->trans(
'ListOfSupportedHooksToActivate').
':<br><br>';
268 foreach ($listofsupportedhooks as $val) {
269 $messagepopup .=
'<br>'.(empty($val[
'status']) ?
'<span class="opacitymedium">' :
'');
270 $messagepopup .= $val[
'code'];
271 $messagepopup .= (empty($val[
'status']) ?
' - '.$langs->trans(
"FeatureNotUsedAccordingtoSetup",
'Stripe').
'</span>' :
'');
274 print $form->textwithpicto(
'', $messagepopup, 1,
'help',
'valignmiddle', 0, 3,
'webhookscodetest');
281 $endpoint = \Stripe\WebhookEndpoint::retrieve(
getDolGlobalString(
'STRIPE_TEST_WEBHOOK_ID'));
282 $endpoint->enabled_events = $stripearrayofwebhookevents;
284 if (!
GETPOST(
'status',
'alpha')) {
285 $endpoint->disabled =
true;
287 $endpoint->disabled =
false;
290 $endpoint->url = $url;
294 if ($endpoint->status ==
'enabled') {
295 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=ipn&token='.
newToken().
'&webhook='.$endpoint->id.
'&status=0">';
296 print
img_picto($langs->trans(
"Activated"),
'switch_on');
298 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=ipn&token='.
newToken().
'&webhook='.$endpoint->id.
'&status=1">';
299 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
302 print $e->getMessage();
305 print
'Bad value for the secret key. Reenter and save it again to fix this.';
308 print
img_picto($langs->trans(
"Inactive"),
'statut5');
313 print
'<tr class="oddeven"><td>'.$langs->trans(
"StripeConnect").
'</td>';
314 print
'<td><b>'.$langs->trans(
"StripeConnect_Mode").
'</b><br>';
315 print $langs->trans(
"STRIPE_APPLICATION_FEE_PLATFORM").
' ';
320 print
'</td><td></td></tr>';
323if (empty(
$conf->stripeconnect->enabled)) {
324 print
'<tr class="oddeven"><td>';
325 print
'<span class="fieldrequired">'.$langs->trans(
"STRIPE_LIVE_PUBLISHABLE_KEY").
'</span></td><td>';
326 print
'<input class="minwidth300" type="text" name="STRIPE_LIVE_PUBLISHABLE_KEY" value="'.getDolGlobalString(
'STRIPE_LIVE_PUBLISHABLE_KEY').
'" placeholder="'.$langs->trans(
"Example").
': pk_live_xxxxxxxxxxxxxxxxxxxxxxxx" spellcheck="false">';
327 print
'</td><td></td></tr>';
329 print
'<tr class="oddeven"><td>';
330 print
'<span class="fieldrequired">'.$langs->trans(
"STRIPE_LIVE_SECRET_KEY").
'</span></td><td>';
331 print
'<input class="minwidth300 input-icon-password" type="password" id="STRIPE_LIVE_SECRET_KEY" name="STRIPE_LIVE_SECRET_KEY" value="'.getDolGlobalString(
'STRIPE_LIVE_SECRET_KEY').
'" placeholder="'.$langs->trans(
"Example").
': sk_live_xxxxxxxxxxxxxxxxxxxxxxxx" spellcheck="false">';
333 print
showEyeForField(
'eyeSTRIPE_LIVE_SECRET_KEY',
'STRIPE_LIVE_SECRET_KEY');
335 print
'</td><td></td></tr>';
337 print
'<tr class="oddeven"><td>';
338 print
'<span class="titlefield">'.$langs->trans(
"STRIPE_LIVE_WEBHOOK_KEY").
'</span></td><td>';
340 print
'<input class="minwidth300" type="text" name="STRIPE_LIVE_WEBHOOK_ID" value="'.getDolGlobalString(
'STRIPE_LIVE_WEBHOOK_ID').
'" placeholder="'.$langs->trans(
"Example").
': we_xxxxxxxxxxxxxxxxxxxxxxxx" spellcheck="false">';
343 print
'<input class="minwidth300 input-icon-password" type="password" id="STRIPE_LIVE_WEBHOOK_KEY" name="STRIPE_LIVE_WEBHOOK_KEY" value="'.getDolGlobalString(
'STRIPE_LIVE_WEBHOOK_KEY').
'" placeholder="'.$langs->trans(
"Example").
': whsec_xxxxxxxxxxxxxxxxxxxxxxxx" spellcheck="false">';
345 print
showEyeForField(
'eyeSTRIPE_LIVE_WEBHOOK_KEY',
'STRIPE_LIVE_WEBHOOK_KEY');
347 $out =
img_picto(
'',
'globe',
'class="pictofixedwidth"').
' <span class="opacitymedium">'.$langs->trans(
"ToOfferALinkForLiveWebhook").
'</span> ';
351 $out .=
'<input type="text" id="onlinelivewebhookurl" class="minwidth500" value="'.$url.
'" disabled>';
356 $messagepopup = $langs->trans(
'ListOfSupportedHooksToActivate').
':<br><br>';
357 foreach ($listofsupportedhooks as $val) {
358 $messagepopup .=
'<br>'.(empty($val[
'status']) ?
'<span class="opacitymedium">' :
'');
359 $messagepopup .= $val[
'code'];
360 $messagepopup .= (empty($val[
'status']) ?
' - '.$langs->trans(
"FeatureNotUsedAccordingtoSetup",
'Stripe').
'</span>' :
'');
363 print $form->textwithpicto(
'', $messagepopup, 1,
'help',
'valignmiddle', 0, 3,
'webhookscodeprod');
370 $endpoint = \Stripe\WebhookEndpoint::retrieve(
getDolGlobalString(
'STRIPE_LIVE_WEBHOOK_ID'));
371 $endpoint->enabled_events = $stripearrayofwebhookevents;
373 if (empty(
GETPOST(
'status',
'alpha'))) {
374 $endpoint->disabled =
true;
376 $endpoint->disabled =
false;
379 $endpoint->url = $url;
382 if ($endpoint->status ==
'enabled') {
383 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=ipn&token='.
newToken().
'&webhook='.$endpoint->id.
'&status=0">';
384 print
img_picto($langs->trans(
"Activated"),
'switch_on');
386 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=ipn&token='.
newToken().
'&webhook='.$endpoint->id.
'&status=1">';
387 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
390 print $e->getMessage();
394 print
img_picto($langs->trans(
"Inactive"),
'statut5');
406print
'<div class="div-table-responsive-no-min">';
407print
'<table class="noborder centpercent">';
408print
'<tr class="liste_titre">';
409print
'<td>'.$langs->trans(
"UsageParameter").
'</td>';
413print
'<tr class="oddeven"><td>';
414print $langs->trans(
"PublicVendorName").
'</td><td>';
415print
'<input class="minwidth300" type="text" name="ONLINE_PAYMENT_CREDITOR" value="'.getDolGlobalString(
'ONLINE_PAYMENT_CREDITOR').
'" placeholder="'.
dolPrintHTMLForAttribute(
$mysoc->name).
'">';
418print
'<tr class="oddeven"><td>';
419print $langs->trans(
"BankAccount").
'</td><td>';
420print
img_picto(
'',
'bank_account',
'class="pictofixedwidth"');
421$form->select_comptes(
getDolGlobalString(
'STRIPE_BANK_ACCOUNT_FOR_PAYMENTS'),
'STRIPE_BANK_ACCOUNT_FOR_PAYMENTS', 0,
'', 1);
426 print
'<tr class="oddeven"><td>';
427 print $langs->trans(
"STRIPE_CARD_PRESENT").
'</td><td>';
428 if (
$conf->use_javascript_ajax) {
429 print ajax_constantonoff(
'STRIPE_CARD_PRESENT');
431 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
432 print $form->selectarray(
"STRIPE_CARD_PRESENT", $arrval,
$conf->global->STRIPE_CARD_PRESENT);
439 print
'<tr class="oddeven"><td>';
440 print $langs->trans(
"TERMINAL_LOCATION").
'</td><td>';
441 $service =
'StripeTest';
444 $service =
'StripeLive';
449 global $stripearrayofkeysbyenv;
450 $site_account = $stripearrayofkeysbyenv[$servicestatus][
'secret_key'];
451 if (!empty($site_account)) {
452 \Stripe\Stripe::setApiKey($site_account);
455 $service =
'StripeTest';
456 $servicestatus =
'0';
457 dol_htmloutput_mesg($langs->trans(
'YouAreCurrentlyInSandboxMode',
'Stripe'), [],
'warning');
459 $service =
'StripeLive';
460 $servicestatus =
'1';
463 if (!empty($site_account)) {
465 $stripeacc = $stripe->getStripeAccount($service);
467 $locations = \Stripe\Terminal\Location::all(
null, array(
"stripe_account" => $stripeacc));
469 $locations = \Stripe\Terminal\Location::all();
473 print $e->getMessage().
'<br>';
478 $location[
""] = $langs->trans(
"NotDefined");
479 if (!empty($locations)) {
480 foreach ($locations as $tmplocation) {
481 $location[$tmplocation->id] = $tmplocation->display_name;
485 print $form->selectarray(
"STRIPE_LOCATION", $location,
getDolGlobalString(
'STRIPE_LOCATION'));
489print
'<tr class="oddeven"><td>';
490print $langs->trans(
"STRIPE_SEPA_DIRECT_DEBIT").
'</td><td>';
491if (
$conf->use_javascript_ajax) {
492 print ajax_constantonoff(
'STRIPE_SEPA_DIRECT_DEBIT');
494 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
495 print $form->selectarray(
"STRIPE_SEPA_DIRECT_DEBIT", $arrval,
getDolGlobalString(
'STRIPE_SEPA_DIRECT_DEBIT'));
499print
'<tr class="oddeven"><td>';
500print $langs->trans(
"STRIPE_SEPA_CREDIT_TRANSFER").
'</td><td>';
501if (
$conf->use_javascript_ajax) {
502 print ajax_constantonoff(
'STRIPE_SEPA_CREDIT_TRANSFER');
504 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
505 print $form->selectarray(
"STRIPE_SEPA_CREDIT_TRANSFER", $arrval,
getDolGlobalString(
'STRIPE_SEPA_CREDIT_TRANSFER'));
512 print
'<tr class="oddeven"><td>';
513 print $langs->trans(
"STRIPE_KLARNA").
'</td><td>';
514 if (
$conf->use_javascript_ajax) {
515 print ajax_constantonoff(
'STRIPE_KLARNA');
517 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
518 print $form->selectarray(
"STRIPE_KLARNA", $arrval,
$conf->global->STRIPE_KLARNA);
525 print
'<tr class="oddeven"><td>';
526 print $langs->trans(
"STRIPE_BANCONTACT").
'</td><td>';
527 if (
$conf->use_javascript_ajax) {
528 print ajax_constantonoff(
'STRIPE_BANCONTACT');
530 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
531 print $form->selectarray(
"STRIPE_BANCONTACT", $arrval,
$conf->global->STRIPE_BANCONTACT);
533 print
' <span class="opacitymedium">'.$langs->trans(
"ExampleOnlyForBECustomers").
'</span>';
539 print
'<tr class="oddeven"><td>';
540 print $langs->trans(
"STRIPE_IDEAL").
'</td><td>';
541 if (
$conf->use_javascript_ajax) {
542 print ajax_constantonoff(
'STRIPE_IDEAL');
544 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
545 print $form->selectarray(
"STRIPE_IDEAL", $arrval,
$conf->global->STRIPE_SEPA_DIRECT_DEBIT);
547 print
' <span class="opacitymedium">'.$langs->trans(
"ExampleOnlyForNLCustomers").
'</span>';
553 print
'<tr class="oddeven"><td>';
554 print $langs->trans(
"STRIPE_GIROPAY").
'</td><td>';
555 if (
$conf->use_javascript_ajax) {
556 print ajax_constantonoff(
'STRIPE_GIROPAY');
558 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
559 print $form->selectarray(
"STRIPE_GIROPAY", $arrval,
$conf->global->STRIPE_GIROPAY);
561 print
' <span class="opacitymedium">'.$langs->trans(
"ExampleOnlyForDECustomers").
'</span>';
567 print
'<tr class="oddeven"><td>';
568 print $langs->trans(
"STRIPE_SOFORT").
'</td><td>';
569 if (
$conf->use_javascript_ajax) {
570 print ajax_constantonoff(
'STRIPE_SOFORT');
572 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
573 print $form->selectarray(
"STRIPE_SOFORT", $arrval,
$conf->global->STRIPE_SOFORT);
575 print
' <span class="opacitymedium">'.$langs->trans(
"ExampleOnlyForATBEDEITNLESCustomers").
'</span>';
579print
'<tr class="oddeven"><td>';
580print $langs->trans(
"CSSUrlForPaymentForm").
'</td><td>';
581print
'<input class="width500" type="text" name="ONLINE_PAYMENT_CSS_URL" value="' .
getDolGlobalString(
'ONLINE_PAYMENT_CSS_URL').
'" spellcheck="false">';
582print
' <span class="opacitymedium">'.$langs->trans(
"Example").
': http://mysite/mycss.css</span>';
585print
'<tr class="oddeven"><td>';
586print $langs->trans(
"MessageForm").
'</td><td>';
587$doleditor =
new DolEditor(
'ONLINE_PAYMENT_MESSAGE_FORM',
getDolGlobalString(
"ONLINE_PAYMENT_MESSAGE_FORM"),
'', 100,
'dolibarr_details',
'In',
false,
true,
true, ROWS_2,
'90%');
591print
'<tr class="oddeven"><td>';
592print $langs->trans(
"MessageOK").
'</td><td>';
593$doleditor =
new DolEditor(
'ONLINE_PAYMENT_MESSAGE_OK',
getDolGlobalString(
"ONLINE_PAYMENT_MESSAGE_OK"),
'', 100,
'dolibarr_details',
'In',
false,
true,
true, ROWS_2,
'90%');
597print
'<tr class="oddeven"><td>';
598print $langs->trans(
"MessageKO").
'</td><td>';
599$doleditor =
new DolEditor(
'ONLINE_PAYMENT_MESSAGE_KO',
getDolGlobalString(
"ONLINE_PAYMENT_MESSAGE_KO"),
'', 100,
'dolibarr_details',
'In',
false,
true,
true, ROWS_2,
'90%');
603print
'<tr class="oddeven"><td>';
604print $langs->trans(
"ONLINE_PAYMENT_SENDEMAIL").
'</td><td>';
605print
img_picto(
'',
'email',
'class="pictofixedwidth"');
606print
'<input class="minwidth200" type="text" name="ONLINE_PAYMENT_SENDEMAIL" value="' .
getDolGlobalString(
'ONLINE_PAYMENT_SENDEMAIL').
'">';
607print
' <span class="opacitymedium small">'.$langs->trans(
"Example").
': myemail@myserver.com, Payment service <myemail2@myserver2.com></span>';
616print
'<div class="div-table-responsive-no-min">';
617print
'<table class="noborder centpercent">';
618print
'<tr class="liste_titre">';
619print
'<td>Payout</td>';
620print
'<td class="width300"></td>';
626print
'<tr class="oddeven"><td>';
627print $form->textwithpicto($langs->trans(
"StripeAutoRecordPayout"),
'<span class="opacitymedium">'.$langs->trans(
"StripeAutoRecordPayout2",
"payout.created | payout.failed | payout.paid").
'</span>');
630if (
$conf->use_javascript_ajax) {
631 print ajax_constantonoff(
'STRIPE_AUTO_RECORD_PAYOUT', array(),
null, 0, 0, 1);
633 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
634 print $form->selectarray(
"STRIPE_AUTO_RECORD_PAYOUT", $arrval,
getDolGlobalInt(
'STRIPE_AUTO_RECORD_PAYOUT'));
638print
'<tr class="oddeven"><td>';
639print $langs->trans(
"StripeUserAccountForActions").
'</td><td>';
640print
img_picto(
'',
'user',
'class="pictofixedwidth"').$form->select_dolusers(
getDolGlobalString(
'STRIPE_USER_ACCOUNT_FOR_ACTIONS'),
'STRIPE_USER_ACCOUNT_FOR_ACTIONS', 0);
644 print
'<tr class="oddeven"><td>';
645 print $langs->trans(
"BankAccountForBankTransfer").
'</td><td>';
646 print
img_picto(
'',
'bank_account',
'class="pictofixedwidth"');
647 $form->select_comptes(
getDolGlobalString(
'STRIPE_BANK_ACCOUNT_FOR_BANKTRANSFERS'),
'STRIPE_BANK_ACCOUNT_FOR_BANKTRANSFERS', 0,
'', 1);
656print
'<div class="div-table-responsive-no-min">';
657print
'<table class="noborder centpercent">';
659print
'<tr class="liste_titre">';
660print
'<td>'.$langs->trans(
"UrlGenerationParameters").
'</td>';
665print
'<tr class="oddeven"><td>';
666print $langs->trans(
"SecurityToken").
'</td><td>';
667print
'<input class="minwidth300" type="text" id="PAYMENT_SECURITY_TOKEN" name="PAYMENT_SECURITY_TOKEN" value="' .
getDolGlobalString(
'PAYMENT_SECURITY_TOKEN').
'" spellcheck="false">';
668if (!empty(
$conf->use_javascript_ajax)) {
669 print
' '.img_picto($langs->trans(
'Generate'),
'refresh',
'id="generate_token" class="linkobject"');
672 $langs->load(
"errors");
673 print
img_warning($langs->trans(
"WarningTheHiddenOptionIsOn",
'PAYMENT_SECURITY_ACCEPT_ANY_TOKEN'),
'',
'pictowarning marginleftonly');
682print $form->buttonsSaveCancel(
"Save",
'', array(),
false,
'reposition');
690include DOL_DOCUMENT_ROOT.
'/core/tpl/onlinepaymentlinks.tpl.php';
693print
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').
'. '.$langs->trans(
'SeeAlso',
'https://docs.stripe.com/testing?testing-method=card-numbers'));
696 print
info_admin($langs->trans(
"ExampleOfTestBankAcountForSEPA",
'AT611904300234573201 (pending->succeed) or AT861904300235473202 (pending->failed)').
'. '.$langs->trans(
'SeeAlso',
'https://docs.stripe.com/testing?payment-method=sepa-direct-debit'));
701if (!empty(
$conf->use_javascript_ajax)) {
702 print
"\n".
'<script type="text/javascript">';
703 print
'$(document).ready(function () {
705 $("#apidoca").click(function() {
706 console.log("We click on apidoca show/hide");
708 $("#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).
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage a WYSIWYG editor.
Stripe class @TODO No reason to extend CommonObject.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
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, $morecssdiv='')
Show tabs of a record.
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 a Dolibarr global constant int value.
ajax_autoselect($htmlname, $addlink='', $textonlink='Link')
Make content of an input box selected when we click into input field.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
dolPrintHTMLForAttribute($s, $escapeonlyhtmltags=0, $allowothertags=array())
Return a string ready to be output into an HTML attribute (alt, title, data-html, ....
getDolCurrency()
Return the main currency ('EUR', 'USD', ...)
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_htmloutput_mesg($mesgstring='', $mesgarray=array(), $style='ok', $keepembedded=0)
Print formatted messages to output (Used to show messages on html output).
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
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 a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
utf8_check($str)
Check if a string is in UTF8.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='', $textonpictotooltip='', $cssfordropdown='info_admin')
Show information in HTML for admin users or standard users.
showEyeForField($htmlname, $htmlnameofinput)
Output the eye picto to show/hide a password HTML field.
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.