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(
'payment_intent.payment_failed',
'payment_intent.succeeded');
40$listofsupportedhooks[] =
'charge.dispute.closed';
41$listofsupportedhooks[] =
'charge.dispute.created';
42$listofsupportedhooks[] =
'charge.dispute.funds_withdrawn';
45 $listofsupportedhooks[] =
'payout.create';
46 $listofsupportedhooks[] =
'payout.paid';
59$langs->loadLangs(array(
'admin',
'other',
'paypal',
'stripe'));
61if (empty($user->admin)) {
64if (empty($conf->stripe->enabled)) {
68$action =
GETPOST(
'action',
'aZ09');
76if ($action ==
'setvalue' && $user->admin) {
79 if (empty($conf->stripeconnect->enabled)) {
80 $result =
dolibarr_set_const($db,
"STRIPE_TEST_PUBLISHABLE_KEY",
GETPOST(
'STRIPE_TEST_PUBLISHABLE_KEY',
'alpha'),
'chaine', 0,
'', $conf->entity);
84 $result =
dolibarr_set_const($db,
"STRIPE_TEST_SECRET_KEY",
GETPOST(
'STRIPE_TEST_SECRET_KEY',
'alpha'),
'chaine', 0,
'', $conf->entity);
88 $result =
dolibarr_set_const($db,
"STRIPE_TEST_WEBHOOK_ID",
GETPOST(
'STRIPE_TEST_WEBHOOK_ID',
'alpha'),
'chaine', 0,
'', $conf->entity);
92 $result =
dolibarr_set_const($db,
"STRIPE_TEST_WEBHOOK_KEY",
GETPOST(
'STRIPE_TEST_WEBHOOK_KEY',
'alpha'),
'chaine', 0,
'', $conf->entity);
96 $result =
dolibarr_set_const($db,
"STRIPE_LIVE_PUBLISHABLE_KEY",
GETPOST(
'STRIPE_LIVE_PUBLISHABLE_KEY',
'alpha'),
'chaine', 0,
'', $conf->entity);
100 $result =
dolibarr_set_const($db,
"STRIPE_LIVE_SECRET_KEY",
GETPOST(
'STRIPE_LIVE_SECRET_KEY',
'alpha'),
'chaine', 0,
'', $conf->entity);
101 if (!($result > 0)) {
104 $result =
dolibarr_set_const($db,
"STRIPE_LIVE_WEBHOOK_ID",
GETPOST(
'STRIPE_LIVE_WEBHOOK_ID',
'alpha'),
'chaine', 0,
'', $conf->entity);
105 if (!($result > 0)) {
108 $result =
dolibarr_set_const($db,
"STRIPE_LIVE_WEBHOOK_KEY",
GETPOST(
'STRIPE_LIVE_WEBHOOK_KEY',
'alpha'),
'chaine', 0,
'', $conf->entity);
109 if (!($result > 0)) {
113 $result =
dolibarr_set_const($db,
"ONLINE_PAYMENT_CREDITOR",
GETPOST(
'ONLINE_PAYMENT_CREDITOR',
'alpha'),
'chaine', 0,
'', $conf->entity);
114 if (!($result > 0)) {
117 $result =
dolibarr_set_const($db,
"STRIPE_BANK_ACCOUNT_FOR_PAYMENTS",
GETPOSTINT(
'STRIPE_BANK_ACCOUNT_FOR_PAYMENTS'),
'chaine', 0,
'', $conf->entity);
118 if (!($result > 0)) {
121 $result =
dolibarr_set_const($db,
"STRIPE_USER_ACCOUNT_FOR_ACTIONS",
GETPOSTINT(
'STRIPE_USER_ACCOUNT_FOR_ACTIONS'),
'chaine', 0,
'', $conf->entity);
122 if (!($result > 0)) {
125 $result =
dolibarr_set_const($db,
"STRIPE_BANK_ACCOUNT_FOR_BANKTRANSFERS",
GETPOSTINT(
'STRIPE_BANK_ACCOUNT_FOR_BANKTRANSFERS'),
'chaine', 0,
'', $conf->entity);
126 if (!($result > 0)) {
129 if (GETPOSTISSET(
'STRIPE_LOCATION')) {
130 $result =
dolibarr_set_const($db,
"STRIPE_LOCATION",
GETPOST(
'STRIPE_LOCATION',
'alpha'),
'chaine', 0,
'', $conf->entity);
135 $result =
dolibarr_set_const($db,
"ONLINE_PAYMENT_CSS_URL",
GETPOST(
'ONLINE_PAYMENT_CSS_URL',
'alpha'),
'chaine', 0,
'', $conf->entity);
136 if (!($result > 0)) {
139 $result =
dolibarr_set_const($db,
"ONLINE_PAYMENT_MESSAGE_FORM",
GETPOST(
'ONLINE_PAYMENT_MESSAGE_FORM',
'restricthtml'),
'chaine', 0,
'', $conf->entity);
140 if (!($result > 0)) {
143 $result =
dolibarr_set_const($db,
"ONLINE_PAYMENT_MESSAGE_OK",
GETPOST(
'ONLINE_PAYMENT_MESSAGE_OK',
'restricthtml'),
'chaine', 0,
'', $conf->entity);
144 if (!($result > 0)) {
147 $result =
dolibarr_set_const($db,
"ONLINE_PAYMENT_MESSAGE_KO",
GETPOST(
'ONLINE_PAYMENT_MESSAGE_KO',
'restricthtml'),
'chaine', 0,
'', $conf->entity);
148 if (!($result > 0)) {
151 $result =
dolibarr_set_const($db,
"ONLINE_PAYMENT_SENDEMAIL",
GETPOST(
'ONLINE_PAYMENT_SENDEMAIL'),
'chaine', 0,
'', $conf->entity);
152 if (!($result > 0)) {
161 $result =
dolibarr_set_const($db,
"PAYMENT_SECURITY_TOKEN",
GETPOST(
'PAYMENT_SECURITY_TOKEN',
'alpha'),
'chaine', 0,
'', $conf->entity);
162 if (!($result > 0)) {
165 if (empty($conf->use_javascript_ajax)) {
166 $result =
dolibarr_set_const($db,
"PAYMENT_SECURITY_TOKEN_UNIQUE",
GETPOST(
'PAYMENT_SECURITY_TOKEN_UNIQUE',
'alpha'),
'chaine', 0,
'', $conf->entity);
167 if (!($result > 0)) {
181if ($action ==
"setlive") {
183 $res =
dolibarr_set_const($db,
"STRIPE_LIVE", $liveenable,
'yesno', 0,
'', $conf->entity);
197$form =
new Form($db);
200llxHeader(
'', $langs->trans(
"StripeSetup"));
202$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>';
208print
'<form method="POST" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
209print
'<input type="hidden" name="token" value="'.newToken().
'">';
210print
'<input type="hidden" name="action" value="setvalue">';
211print
'<input type="hidden" name="page_y" value="">';
215$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');
217print
'<span class="opacitymedium">'.$langs->trans(
"StripeDesc").
"</span><br>\n";
221print
'<div class="div-table-responsive-no-min">';
222print
'<table class="noborder centpercent">';
223print
'<tr class="liste_titre">';
224print
'<td>'.$langs->trans(
"AccountParameter").
'</td>';
229print
'<tr class="oddeven">';
231print $langs->trans(
"StripeLiveEnabled").
'</td><td>';
232if ($conf->use_javascript_ajax) {
233 print ajax_constantonoff(
'STRIPE_LIVE');
235 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
236 print $form->selectarray(
"STRIPE_LIVE", $arrval, $conf->global->STRIPE_LIVE);
238print
'</td><td></td></tr>';
240if (empty($conf->stripeconnect->enabled)) {
241 print
'<tr class="oddeven"><td>';
242 print
'<span class="fieldrequired">'.$langs->trans(
"STRIPE_TEST_PUBLISHABLE_KEY").
'</span></td><td>';
243 print
'<input class="minwidth300" type="text" name="STRIPE_TEST_PUBLISHABLE_KEY" value="' .
getDolGlobalString(
'STRIPE_TEST_PUBLISHABLE_KEY').
'" placeholder="'.$langs->trans(
"Example").
': pk_test_xxxxxxxxxxxxxxxxxxxxxxxx">';
244 print
'</td><td></td></tr>';
246 print
'<tr class="oddeven"><td>';
247 print
'<span class="titlefield fieldrequired">'.$langs->trans(
"STRIPE_TEST_SECRET_KEY").
'</span></td><td>';
248 print
'<input class="minwidth300" type="text" name="STRIPE_TEST_SECRET_KEY" value="' .
getDolGlobalString(
'STRIPE_TEST_SECRET_KEY').
'" placeholder="'.$langs->trans(
"Example").
': sk_test_xxxxxxxxxxxxxxxxxxxxxxxx">';
249 print
'</td><td></td></tr>';
251 print
'<tr class="oddeven"><td>';
252 print
'<span class="titlefield">'.$langs->trans(
"STRIPE_TEST_WEBHOOK_KEY").
'</span></td><td>';
254 print
'<input class="minwidth300" type="text" name="STRIPE_TEST_WEBHOOK_ID" value="'.getDolGlobalString(
'STRIPE_TEST_WEBHOOK_ID').
'" placeholder="'.$langs->trans(
"Example").
': we_xxxxxxxxxxxxxxxxxxxxxxxx">';
257 print
'<input class="minwidth300" type="text" name="STRIPE_TEST_WEBHOOK_KEY" value="'.getDolGlobalString(
'STRIPE_TEST_WEBHOOK_KEY').
'" placeholder="'.$langs->trans(
"Example").
': whsec_xxxxxxxxxxxxxxxxxxxxxxxx">';
258 $out =
img_picto(
'',
'globe').
' <span class="opacitymedium">'.$langs->trans(
"ToOfferALinkForTestWebhook").
'</span> ';
263 $out .=
'<input type="text" id="onlinetestwebhookurl" class="minwidth500" value="'.$url.
'" disabled>';
266 print $form->textwithpicto(
'', $langs->trans(
'ListOfSupportedHooksToActivate').
':<br><br>'.implode(
'<br>', $listofsupportedhooks), 1,
'help',
'valignmiddle', 0, 3,
'webhookscodetest');
273 $endpoint = \Stripe\WebhookEndpoint::retrieve(
getDolGlobalString(
'STRIPE_TEST_WEBHOOK_ID'));
274 $endpoint->enabled_events = $stripearrayofwebhookevents;
276 if (!
GETPOST(
'status',
'alpha')) {
277 $endpoint->disabled =
true;
279 $endpoint->disabled =
false;
282 $endpoint->url = $url;
286 if ($endpoint->status ==
'enabled') {
287 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=ipn&webhook='.$endpoint->id.
'&status=0">';
288 print
img_picto($langs->trans(
"Activated"),
'switch_on');
290 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=ipn&webhook='.$endpoint->id.
'&status=1">';
291 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
294 print $e->getMessage();
297 print
'Bad value for the secret key. Reenter and save it again to fix this.';
300 print
img_picto($langs->trans(
"Inactive"),
'statut5');
305 print
'<tr class="oddeven"><td>'.$langs->trans(
"StripeConnect").
'</td>';
306 print
'<td><b>'.$langs->trans(
"StripeConnect_Mode").
'</b><br>';
307 print $langs->trans(
"STRIPE_APPLICATION_FEE_PLATFORM").
' ';
312 print
'</td><td></td></tr>';
315if (empty($conf->stripeconnect->enabled)) {
316 print
'<tr class="oddeven"><td>';
317 print
'<span class="fieldrequired">'.$langs->trans(
"STRIPE_LIVE_PUBLISHABLE_KEY").
'</span></td><td>';
318 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">';
319 print
'</td><td></td></tr>';
321 print
'<tr class="oddeven"><td>';
322 print
'<span class="fieldrequired">'.$langs->trans(
"STRIPE_LIVE_SECRET_KEY").
'</span></td><td>';
323 print
'<input class="minwidth300" type="text" name="STRIPE_LIVE_SECRET_KEY" value="'.getDolGlobalString(
'STRIPE_LIVE_SECRET_KEY').
'" placeholder="'.$langs->trans(
"Example").
': sk_live_xxxxxxxxxxxxxxxxxxxxxxxx" spellcheck="false">';
324 print
'</td><td></td></tr>';
326 print
'<tr class="oddeven"><td>';
327 print
'<span class="titlefield">'.$langs->trans(
"STRIPE_LIVE_WEBHOOK_KEY").
'</span></td><td>';
329 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">';
332 print
'<input class="minwidth300" type="text" name="STRIPE_LIVE_WEBHOOK_KEY" value="'.getDolGlobalString(
'STRIPE_LIVE_WEBHOOK_KEY').
'" placeholder="'.$langs->trans(
"Example").
': whsec_xxxxxxxxxxxxxxxxxxxxxxxx" spellcheck="false">';
333 $out =
img_picto(
'',
'globe',
'class="pictofixedwidth"').
' <span class="opacitymedium">'.$langs->trans(
"ToOfferALinkForLiveWebhook").
'</span> ';
337 $out .=
'<input type="text" id="onlinelivewebhookurl" class="minwidth500" value="'.$url.
'" disabled>';
340 print $form->textwithpicto(
'', $langs->trans(
'ListOfSupportedHooksToActivate').
':<br><br>'.implode(
'<br>', $listofsupportedhooks), 1,
'help',
'valignmiddle', 0, 3,
'webhookscodeprod');
347 $endpoint = \Stripe\WebhookEndpoint::retrieve(
getDolGlobalString(
'STRIPE_LIVE_WEBHOOK_ID'));
348 $endpoint->enabled_events = $stripearrayofwebhookevents;
350 if (empty(
GETPOST(
'status',
'alpha'))) {
351 $endpoint->disabled =
true;
353 $endpoint->disabled =
false;
356 $endpoint->url = $url;
359 if ($endpoint->status ==
'enabled') {
360 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=ipn&webhook='.$endpoint->id.
'&status=0">';
361 print
img_picto($langs->trans(
"Activated"),
'switch_on');
363 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=ipn&webhook='.$endpoint->id.
'&status=1">';
364 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
367 print $e->getMessage();
371 print
img_picto($langs->trans(
"Inactive"),
'statut5');
383print
'<div class="div-table-responsive-no-min">';
384print
'<table class="noborder centpercent">';
385print
'<tr class="liste_titre">';
386print
'<td>'.$langs->trans(
"UsageParameter").
'</td>';
390print
'<tr class="oddeven"><td>';
391print $langs->trans(
"PublicVendorName").
'</td><td>';
392print
'<input class="minwidth300" type="text" name="ONLINE_PAYMENT_CREDITOR" value="'.getDolGlobalString(
'ONLINE_PAYMENT_CREDITOR').
'">';
393print
' <span class="opacitymedium">'.$langs->trans(
"Example").
': '.
$mysoc->name.
'</span>';
396print
'<tr class="oddeven"><td>';
397print $langs->trans(
"BankAccount").
'</td><td>';
398print
img_picto(
'',
'bank_account',
'class="pictofixedwidth"');
399$form->select_comptes(
getDolGlobalString(
'STRIPE_BANK_ACCOUNT_FOR_PAYMENTS'),
'STRIPE_BANK_ACCOUNT_FOR_PAYMENTS', 0,
'', 1);
404 print
'<tr class="oddeven"><td>';
405 print $langs->trans(
"STRIPE_CARD_PRESENT").
'</td><td>';
406 if ($conf->use_javascript_ajax) {
407 print ajax_constantonoff(
'STRIPE_CARD_PRESENT');
409 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
410 print $form->selectarray(
"STRIPE_CARD_PRESENT", $arrval, $conf->global->STRIPE_CARD_PRESENT);
417 print
'<tr class="oddeven"><td>';
418 print $langs->trans(
"TERMINAL_LOCATION").
'</td><td>';
419 $service =
'StripeTest';
422 $service =
'StripeLive';
427 global $stripearrayofkeysbyenv;
428 $site_account = $stripearrayofkeysbyenv[$servicestatus][
'secret_key'];
429 if (!empty($site_account)) {
430 \Stripe\Stripe::setApiKey($site_account);
433 $service =
'StripeTest';
434 $servicestatus =
'0';
435 dol_htmloutput_mesg($langs->trans(
'YouAreCurrentlyInSandboxMode',
'Stripe'), [],
'warning');
437 $service =
'StripeLive';
438 $servicestatus =
'1';
440 $stripe =
new Stripe($db);
441 if (!empty($site_account)) {
443 $stripeacc = $stripe->getStripeAccount($service);
445 $locations = \Stripe\Terminal\Location::all(
null, array(
"stripe_account" => $stripeacc));
447 $locations = \Stripe\Terminal\Location::all();
451 print $e->getMessage().
'<br>';
456 $location[
""] = $langs->trans(
"NotDefined");
457 if (!empty($locations)) {
458 foreach ($locations as $tmplocation) {
459 $location[$tmplocation->id] = $tmplocation->display_name;
463 print $form->selectarray(
"STRIPE_LOCATION", $location,
getDolGlobalString(
'STRIPE_LOCATION'));
467print
'<tr class="oddeven"><td>';
468print $langs->trans(
"STRIPE_SEPA_DIRECT_DEBIT").
'</td><td>';
469if ($conf->use_javascript_ajax) {
470 print ajax_constantonoff(
'STRIPE_SEPA_DIRECT_DEBIT');
472 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
473 print $form->selectarray(
"STRIPE_SEPA_DIRECT_DEBIT", $arrval,
getDolGlobalString(
'STRIPE_SEPA_DIRECT_DEBIT'));
477print
'<tr class="oddeven"><td>';
478print $langs->trans(
"STRIPE_SEPA_CREDIT_TRANSFER").
'</td><td>';
479if ($conf->use_javascript_ajax) {
480 print ajax_constantonoff(
'STRIPE_SEPA_CREDIT_TRANSFER');
482 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
483 print $form->selectarray(
"STRIPE_SEPA_CREDIT_TRANSFER", $arrval,
getDolGlobalString(
'STRIPE_SEPA_CREDIT_TRANSFER'));
490 print
'<tr class="oddeven"><td>';
491 print $langs->trans(
"STRIPE_KLARNA").
'</td><td>';
492 if ($conf->use_javascript_ajax) {
493 print ajax_constantonoff(
'STRIPE_KLARNA');
495 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
496 print $form->selectarray(
"STRIPE_KLARNA", $arrval, $conf->global->STRIPE_KLARNA);
503 print
'<tr class="oddeven"><td>';
504 print $langs->trans(
"STRIPE_BANCONTACT").
'</td><td>';
505 if ($conf->use_javascript_ajax) {
506 print ajax_constantonoff(
'STRIPE_BANCONTACT');
508 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
509 print $form->selectarray(
"STRIPE_BANCONTACT", $arrval, $conf->global->STRIPE_BANCONTACT);
511 print
' <span class="opacitymedium">'.$langs->trans(
"ExampleOnlyForBECustomers").
'</span>';
517 print
'<tr class="oddeven"><td>';
518 print $langs->trans(
"STRIPE_IDEAL").
'</td><td>';
519 if ($conf->use_javascript_ajax) {
520 print ajax_constantonoff(
'STRIPE_IDEAL');
522 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
523 print $form->selectarray(
"STRIPE_IDEAL", $arrval, $conf->global->STRIPE_SEPA_DIRECT_DEBIT);
525 print
' <span class="opacitymedium">'.$langs->trans(
"ExampleOnlyForNLCustomers").
'</span>';
531 print
'<tr class="oddeven"><td>';
532 print $langs->trans(
"STRIPE_GIROPAY").
'</td><td>';
533 if ($conf->use_javascript_ajax) {
534 print ajax_constantonoff(
'STRIPE_GIROPAY');
536 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
537 print $form->selectarray(
"STRIPE_GIROPAY", $arrval, $conf->global->STRIPE_GIROPAY);
539 print
' <span class="opacitymedium">'.$langs->trans(
"ExampleOnlyForDECustomers").
'</span>';
545 print
'<tr class="oddeven"><td>';
546 print $langs->trans(
"STRIPE_SOFORT").
'</td><td>';
547 if ($conf->use_javascript_ajax) {
548 print ajax_constantonoff(
'STRIPE_SOFORT');
550 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
551 print $form->selectarray(
"STRIPE_SOFORT", $arrval, $conf->global->STRIPE_SOFORT);
553 print
' <span class="opacitymedium">'.$langs->trans(
"ExampleOnlyForATBEDEITNLESCustomers").
'</span>';
557print
'<tr class="oddeven"><td>';
558print $langs->trans(
"CSSUrlForPaymentForm").
'</td><td>';
559print
'<input class="width500" type="text" name="ONLINE_PAYMENT_CSS_URL" value="' .
getDolGlobalString(
'ONLINE_PAYMENT_CSS_URL').
'" spellcheck="false">';
560print
' <span class="opacitymedium">'.$langs->trans(
"Example").
': http://mysite/mycss.css</span>';
563print
'<tr class="oddeven"><td>';
564print $langs->trans(
"MessageForm").
'</td><td>';
565$doleditor =
new DolEditor(
'ONLINE_PAYMENT_MESSAGE_FORM',
getDolGlobalString(
"ONLINE_PAYMENT_MESSAGE_FORM"),
'', 100,
'dolibarr_details',
'In',
false,
true,
true, ROWS_2,
'90%');
569print
'<tr class="oddeven"><td>';
570print $langs->trans(
"MessageOK").
'</td><td>';
571$doleditor =
new DolEditor(
'ONLINE_PAYMENT_MESSAGE_OK',
getDolGlobalString(
"ONLINE_PAYMENT_MESSAGE_OK"),
'', 100,
'dolibarr_details',
'In',
false,
true,
true, ROWS_2,
'90%');
575print
'<tr class="oddeven"><td>';
576print $langs->trans(
"MessageKO").
'</td><td>';
577$doleditor =
new DolEditor(
'ONLINE_PAYMENT_MESSAGE_KO',
getDolGlobalString(
"ONLINE_PAYMENT_MESSAGE_KO"),
'', 100,
'dolibarr_details',
'In',
false,
true,
true, ROWS_2,
'90%');
581print
'<tr class="oddeven"><td>';
582print $langs->trans(
"ONLINE_PAYMENT_SENDEMAIL").
'</td><td>';
583print
img_picto(
'',
'email',
'class="pictofixedwidth"');
584print
'<input class="minwidth200" type="text" name="ONLINE_PAYMENT_SENDEMAIL" value="' .
getDolGlobalString(
'ONLINE_PAYMENT_SENDEMAIL').
'">';
585print
' <span class="opacitymedium">'.$langs->trans(
"Example").
': myemail@myserver.com, Payment service <myemail2@myserver2.com></span>';
594print
'<div class="div-table-responsive-no-min">';
595print
'<table class="noborder centpercent">';
596print
'<tr class="liste_titre">';
597print
'<td>Payout</td>';
598print
'<td class="width300"></td>';
604print
'<tr class="oddeven"><td>';
605print $form->textwithpicto($langs->trans(
"StripeAutoRecordPayout"),
'<span class="opacitymedium">'.$langs->trans(
"StripeAutoRecordPayout2",
"payout.created | payout.failed | payout.paid").
'</span>');
608if ($conf->use_javascript_ajax) {
609 print ajax_constantonoff(
'STRIPE_AUTO_RECORD_PAYOUT', array(),
null, 0, 0, 1);
611 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
612 print $form->selectarray(
"STRIPE_AUTO_RECORD_PAYOUT", $arrval,
getDolGlobalInt(
'STRIPE_AUTO_RECORD_PAYOUT'));
616print
'<tr class="oddeven"><td>';
617print $langs->trans(
"StripeUserAccountForActions").
'</td><td>';
618print
img_picto(
'',
'user',
'class="pictofixedwidth"').$form->select_dolusers(
getDolGlobalString(
'STRIPE_USER_ACCOUNT_FOR_ACTIONS'),
'STRIPE_USER_ACCOUNT_FOR_ACTIONS', 0);
622 print
'<tr class="oddeven"><td>';
623 print $langs->trans(
"BankAccountForBankTransfer").
'</td><td>';
624 print
img_picto(
'',
'bank_account',
'class="pictofixedwidth"');
625 $form->select_comptes(
getDolGlobalString(
'STRIPE_BANK_ACCOUNT_FOR_BANKTRANSFERS'),
'STRIPE_BANK_ACCOUNT_FOR_BANKTRANSFERS', 0,
'', 1);
634print
'<div class="div-table-responsive-no-min">';
635print
'<table class="noborder centpercent">';
637print
'<tr class="liste_titre">';
638print
'<td>'.$langs->trans(
"UrlGenerationParameters").
'</td>';
639print
'<td>'.$langs->trans(
"Value").
'</td>';
643print
'<tr class="oddeven"><td>';
644print $langs->trans(
"SecurityToken").
'</td><td>';
645print
'<input class="minwidth300" type="text" id="PAYMENT_SECURITY_TOKEN" name="PAYMENT_SECURITY_TOKEN" value="' .
getDolGlobalString(
'PAYMENT_SECURITY_TOKEN').
'">';
646if (!empty($conf->use_javascript_ajax)) {
647 print
' '.img_picto($langs->trans(
'Generate'),
'refresh',
'id="generate_token" class="linkobject"');
650 $langs->load(
"errors");
651 print
img_warning($langs->trans(
"WarningTheHiddenOptionIsOn",
'PAYMENT_SECURITY_ACCEPT_ANY_TOKEN'),
'',
'pictowarning marginleftonly');
655print
'<tr class="oddeven"><td>';
656print $langs->trans(
"SecurityTokenIsUnique").
'</td><td>';
657if ($conf->use_javascript_ajax) {
658 print ajax_constantonoff(
'PAYMENT_SECURITY_TOKEN_UNIQUE', array(),
null, 0, 0, 1);
660 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
661 print $form->selectarray(
"PAYMENT_SECURITY_TOKEN_UNIQUE", $arrval, $conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE);
670print $form->buttonsSaveCancel(
"Save",
'', array(),
false,
'reposition');
678include DOL_DOCUMENT_ROOT.
'/core/tpl/onlinepaymentlinks.tpl.php';
682print
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'));
685 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'));
690if (!empty($conf->use_javascript_ajax)) {
691 print
"\n".
'<script type="text/javascript">';
692 print
'$(document).ready(function () {
694 $("#apidoca").click(function() {
695 console.log("We click on apidoca show/hide");
697 $("#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.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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.
getDolCurrency()
Return the main currency ('EUR', 'USD', ...)
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='')
Show information in HTML for admin users or standard users.
utf8_check($str)
Check if a string is in UTF8.
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.