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)) {
131 if (GETPOSTISSET(
'STRIPE_LOCATION')) {
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
'<span class="opacitymedium">'.$langs->trans(
"StripeDesc").
"</span><br>\n";
217print
'<div class="div-table-responsive-no-min">';
218print
'<table class="noborder centpercent">';
219print
'<tr class="liste_titre">';
220print
'<td>'.$langs->trans(
"AccountParameter").
'</td>';
225print
'<tr class="oddeven">';
227print $langs->trans(
"StripeLiveEnabled").
'</td><td>';
228if (
$conf->use_javascript_ajax) {
229 print ajax_constantonoff(
'STRIPE_LIVE');
231 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
232 print $form->selectarray(
"STRIPE_LIVE", $arrval,
$conf->global->STRIPE_LIVE);
234print
'</td><td></td></tr>';
236if (empty(
$conf->stripeconnect->enabled)) {
237 print
'<tr class="oddeven"><td>';
238 print
'<span class="fieldrequired">'.$langs->trans(
"STRIPE_TEST_PUBLISHABLE_KEY").
'</span></td><td>';
239 print
'<input class="minwidth300" type="text" name="STRIPE_TEST_PUBLISHABLE_KEY" value="' .
getDolGlobalString(
'STRIPE_TEST_PUBLISHABLE_KEY').
'" placeholder="'.$langs->trans(
"Example").
': pk_test_xxxxxxxxxxxxxxxxxxxxxxxx">';
240 print
'</td><td></td></tr>';
242 print
'<tr class="oddeven"><td>';
243 print
'<span class="titlefield fieldrequired">'.$langs->trans(
"STRIPE_TEST_SECRET_KEY").
'</span></td><td>';
244 print
'<input class="minwidth300" type="text" name="STRIPE_TEST_SECRET_KEY" value="' .
getDolGlobalString(
'STRIPE_TEST_SECRET_KEY').
'" placeholder="'.$langs->trans(
"Example").
': sk_test_xxxxxxxxxxxxxxxxxxxxxxxx">';
245 print
'</td><td></td></tr>';
247 print
'<tr class="oddeven"><td>';
248 print
'<span class="titlefield">'.$langs->trans(
"STRIPE_TEST_WEBHOOK_KEY").
'</span></td><td>';
250 print
'<input class="minwidth300" type="text" name="STRIPE_TEST_WEBHOOK_ID" value="'.getDolGlobalString(
'STRIPE_TEST_WEBHOOK_ID').
'" placeholder="'.$langs->trans(
"Example").
': we_xxxxxxxxxxxxxxxxxxxxxxxx">';
253 print
'<input class="minwidth300" type="text" name="STRIPE_TEST_WEBHOOK_KEY" value="'.getDolGlobalString(
'STRIPE_TEST_WEBHOOK_KEY').
'" placeholder="'.$langs->trans(
"Example").
': whsec_xxxxxxxxxxxxxxxxxxxxxxxx">';
254 $out =
img_picto(
'',
'globe').
' <span class="opacitymedium">'.$langs->trans(
"ToOfferALinkForTestWebhook").
'</span> ';
259 $out .=
'<input type="text" id="onlinetestwebhookurl" class="minwidth500" value="'.$url.
'" disabled>';
260 $out .= ajax_autoselect(
"onlinetestwebhookurl");
263 $messagepopup = $langs->trans(
'ListOfSupportedHooksToActivate').
':<br><br>';
264 foreach ($listofsupportedhooks as $val) {
265 $messagepopup .=
'<br>'.(empty($val[
'status']) ?
'<span class="opacitymedium">' :
'');
266 $messagepopup .= $val[
'code'];
267 $messagepopup .= (empty($val[
'status']) ?
' - '.$langs->trans(
"FeatureNotUsedAccordingtoSetup",
'Stripe').
'</span>' :
'');
270 print $form->textwithpicto(
'', $messagepopup, 1,
'help',
'valignmiddle', 0, 3,
'webhookscodetest');
277 $endpoint = \Stripe\WebhookEndpoint::retrieve(
getDolGlobalString(
'STRIPE_TEST_WEBHOOK_ID'));
278 $endpoint->enabled_events = $stripearrayofwebhookevents;
280 if (!
GETPOST(
'status',
'alpha')) {
281 $endpoint->disabled =
true;
283 $endpoint->disabled =
false;
286 $endpoint->url = $url;
290 if ($endpoint->status ==
'enabled') {
291 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=ipn&webhook='.$endpoint->id.
'&status=0">';
292 print
img_picto($langs->trans(
"Activated"),
'switch_on');
294 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=ipn&webhook='.$endpoint->id.
'&status=1">';
295 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
298 print $e->getMessage();
301 print
'Bad value for the secret key. Reenter and save it again to fix this.';
304 print
img_picto($langs->trans(
"Inactive"),
'statut5');
309 print
'<tr class="oddeven"><td>'.$langs->trans(
"StripeConnect").
'</td>';
310 print
'<td><b>'.$langs->trans(
"StripeConnect_Mode").
'</b><br>';
311 print $langs->trans(
"STRIPE_APPLICATION_FEE_PLATFORM").
' ';
316 print
'</td><td></td></tr>';
319if (empty(
$conf->stripeconnect->enabled)) {
320 print
'<tr class="oddeven"><td>';
321 print
'<span class="fieldrequired">'.$langs->trans(
"STRIPE_LIVE_PUBLISHABLE_KEY").
'</span></td><td>';
322 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">';
323 print
'</td><td></td></tr>';
325 print
'<tr class="oddeven"><td>';
326 print
'<span class="fieldrequired">'.$langs->trans(
"STRIPE_LIVE_SECRET_KEY").
'</span></td><td>';
327 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">';
328 print
'</td><td></td></tr>';
330 print
'<tr class="oddeven"><td>';
331 print
'<span class="titlefield">'.$langs->trans(
"STRIPE_LIVE_WEBHOOK_KEY").
'</span></td><td>';
333 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">';
336 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">';
337 $out =
img_picto(
'',
'globe',
'class="pictofixedwidth"').
' <span class="opacitymedium">'.$langs->trans(
"ToOfferALinkForLiveWebhook").
'</span> ';
341 $out .=
'<input type="text" id="onlinelivewebhookurl" class="minwidth500" value="'.$url.
'" disabled>';
342 $out .= ajax_autoselect(
"onlinelivewebhookurl",
'0');
345 $messagepopup = $langs->trans(
'ListOfSupportedHooksToActivate').
':<br><br>';
346 foreach ($listofsupportedhooks as $val) {
347 $messagepopup .=
'<br>'.(empty($val[
'status']) ?
'<span class="opacitymedium">' :
'');
348 $messagepopup .= $val[
'code'];
349 $messagepopup .= (empty($val[
'status']) ?
' - '.$langs->trans(
"FeatureNotUsedAccordingtoSetup",
'Stripe').
'</span>' :
'');
352 print $form->textwithpicto(
'', $messagepopup, 1,
'help',
'valignmiddle', 0, 3,
'webhookscodeprod');
359 $endpoint = \Stripe\WebhookEndpoint::retrieve(
getDolGlobalString(
'STRIPE_LIVE_WEBHOOK_ID'));
360 $endpoint->enabled_events = $stripearrayofwebhookevents;
362 if (empty(
GETPOST(
'status',
'alpha'))) {
363 $endpoint->disabled =
true;
365 $endpoint->disabled =
false;
368 $endpoint->url = $url;
371 if ($endpoint->status ==
'enabled') {
372 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=ipn&webhook='.$endpoint->id.
'&status=0">';
373 print
img_picto($langs->trans(
"Activated"),
'switch_on');
375 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=ipn&webhook='.$endpoint->id.
'&status=1">';
376 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
379 print $e->getMessage();
383 print
img_picto($langs->trans(
"Inactive"),
'statut5');
395print
'<div class="div-table-responsive-no-min">';
396print
'<table class="noborder centpercent">';
397print
'<tr class="liste_titre">';
398print
'<td>'.$langs->trans(
"UsageParameter").
'</td>';
402print
'<tr class="oddeven"><td>';
403print $langs->trans(
"PublicVendorName").
'</td><td>';
404print
'<input class="minwidth300" type="text" name="ONLINE_PAYMENT_CREDITOR" value="'.getDolGlobalString(
'ONLINE_PAYMENT_CREDITOR').
'">';
405print
' <span class="opacitymedium">'.$langs->trans(
"Example").
': '.
$mysoc->name.
'</span>';
408print
'<tr class="oddeven"><td>';
409print $langs->trans(
"BankAccount").
'</td><td>';
410print
img_picto(
'',
'bank_account',
'class="pictofixedwidth"');
411$form->select_comptes(
getDolGlobalString(
'STRIPE_BANK_ACCOUNT_FOR_PAYMENTS'),
'STRIPE_BANK_ACCOUNT_FOR_PAYMENTS', 0,
'', 1);
416 print
'<tr class="oddeven"><td>';
417 print $langs->trans(
"STRIPE_CARD_PRESENT").
'</td><td>';
418 if (
$conf->use_javascript_ajax) {
419 print ajax_constantonoff(
'STRIPE_CARD_PRESENT');
421 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
422 print $form->selectarray(
"STRIPE_CARD_PRESENT", $arrval,
$conf->global->STRIPE_CARD_PRESENT);
429 print
'<tr class="oddeven"><td>';
430 print $langs->trans(
"TERMINAL_LOCATION").
'</td><td>';
431 $service =
'StripeTest';
434 $service =
'StripeLive';
439 global $stripearrayofkeysbyenv;
440 $site_account = $stripearrayofkeysbyenv[$servicestatus][
'secret_key'];
441 if (!empty($site_account)) {
442 \Stripe\Stripe::setApiKey($site_account);
445 $service =
'StripeTest';
446 $servicestatus =
'0';
447 dol_htmloutput_mesg($langs->trans(
'YouAreCurrentlyInSandboxMode',
'Stripe'), [],
'warning');
449 $service =
'StripeLive';
450 $servicestatus =
'1';
453 if (!empty($site_account)) {
455 $stripeacc = $stripe->getStripeAccount($service);
457 $locations = \Stripe\Terminal\Location::all(
null, array(
"stripe_account" => $stripeacc));
459 $locations = \Stripe\Terminal\Location::all();
463 print $e->getMessage().
'<br>';
468 $location[
""] = $langs->trans(
"NotDefined");
469 if (!empty($locations)) {
470 foreach ($locations as $tmplocation) {
471 $location[$tmplocation->id] = $tmplocation->display_name;
475 print $form->selectarray(
"STRIPE_LOCATION", $location,
getDolGlobalString(
'STRIPE_LOCATION'));
479print
'<tr class="oddeven"><td>';
480print $langs->trans(
"STRIPE_SEPA_DIRECT_DEBIT").
'</td><td>';
481if (
$conf->use_javascript_ajax) {
482 print ajax_constantonoff(
'STRIPE_SEPA_DIRECT_DEBIT');
484 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
485 print $form->selectarray(
"STRIPE_SEPA_DIRECT_DEBIT", $arrval,
getDolGlobalString(
'STRIPE_SEPA_DIRECT_DEBIT'));
489print
'<tr class="oddeven"><td>';
490print $langs->trans(
"STRIPE_SEPA_CREDIT_TRANSFER").
'</td><td>';
491if (
$conf->use_javascript_ajax) {
492 print ajax_constantonoff(
'STRIPE_SEPA_CREDIT_TRANSFER');
494 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
495 print $form->selectarray(
"STRIPE_SEPA_CREDIT_TRANSFER", $arrval,
getDolGlobalString(
'STRIPE_SEPA_CREDIT_TRANSFER'));
502 print
'<tr class="oddeven"><td>';
503 print $langs->trans(
"STRIPE_KLARNA").
'</td><td>';
504 if (
$conf->use_javascript_ajax) {
505 print ajax_constantonoff(
'STRIPE_KLARNA');
507 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
508 print $form->selectarray(
"STRIPE_KLARNA", $arrval,
$conf->global->STRIPE_KLARNA);
515 print
'<tr class="oddeven"><td>';
516 print $langs->trans(
"STRIPE_BANCONTACT").
'</td><td>';
517 if (
$conf->use_javascript_ajax) {
518 print ajax_constantonoff(
'STRIPE_BANCONTACT');
520 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
521 print $form->selectarray(
"STRIPE_BANCONTACT", $arrval,
$conf->global->STRIPE_BANCONTACT);
523 print
' <span class="opacitymedium">'.$langs->trans(
"ExampleOnlyForBECustomers").
'</span>';
529 print
'<tr class="oddeven"><td>';
530 print $langs->trans(
"STRIPE_IDEAL").
'</td><td>';
531 if (
$conf->use_javascript_ajax) {
532 print ajax_constantonoff(
'STRIPE_IDEAL');
534 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
535 print $form->selectarray(
"STRIPE_IDEAL", $arrval,
$conf->global->STRIPE_SEPA_DIRECT_DEBIT);
537 print
' <span class="opacitymedium">'.$langs->trans(
"ExampleOnlyForNLCustomers").
'</span>';
543 print
'<tr class="oddeven"><td>';
544 print $langs->trans(
"STRIPE_GIROPAY").
'</td><td>';
545 if (
$conf->use_javascript_ajax) {
546 print ajax_constantonoff(
'STRIPE_GIROPAY');
548 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
549 print $form->selectarray(
"STRIPE_GIROPAY", $arrval,
$conf->global->STRIPE_GIROPAY);
551 print
' <span class="opacitymedium">'.$langs->trans(
"ExampleOnlyForDECustomers").
'</span>';
557 print
'<tr class="oddeven"><td>';
558 print $langs->trans(
"STRIPE_SOFORT").
'</td><td>';
559 if (
$conf->use_javascript_ajax) {
560 print ajax_constantonoff(
'STRIPE_SOFORT');
562 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
563 print $form->selectarray(
"STRIPE_SOFORT", $arrval,
$conf->global->STRIPE_SOFORT);
565 print
' <span class="opacitymedium">'.$langs->trans(
"ExampleOnlyForATBEDEITNLESCustomers").
'</span>';
569print
'<tr class="oddeven"><td>';
570print $langs->trans(
"CSSUrlForPaymentForm").
'</td><td>';
571print
'<input class="width500" type="text" name="ONLINE_PAYMENT_CSS_URL" value="' .
getDolGlobalString(
'ONLINE_PAYMENT_CSS_URL').
'" spellcheck="false">';
572print
' <span class="opacitymedium">'.$langs->trans(
"Example").
': http://mysite/mycss.css</span>';
575print
'<tr class="oddeven"><td>';
576print $langs->trans(
"MessageForm").
'</td><td>';
577$doleditor =
new DolEditor(
'ONLINE_PAYMENT_MESSAGE_FORM',
getDolGlobalString(
"ONLINE_PAYMENT_MESSAGE_FORM"),
'', 100,
'dolibarr_details',
'In',
false,
true,
true, ROWS_2,
'90%');
581print
'<tr class="oddeven"><td>';
582print $langs->trans(
"MessageOK").
'</td><td>';
583$doleditor =
new DolEditor(
'ONLINE_PAYMENT_MESSAGE_OK',
getDolGlobalString(
"ONLINE_PAYMENT_MESSAGE_OK"),
'', 100,
'dolibarr_details',
'In',
false,
true,
true, ROWS_2,
'90%');
587print
'<tr class="oddeven"><td>';
588print $langs->trans(
"MessageKO").
'</td><td>';
589$doleditor =
new DolEditor(
'ONLINE_PAYMENT_MESSAGE_KO',
getDolGlobalString(
"ONLINE_PAYMENT_MESSAGE_KO"),
'', 100,
'dolibarr_details',
'In',
false,
true,
true, ROWS_2,
'90%');
593print
'<tr class="oddeven"><td>';
594print $langs->trans(
"ONLINE_PAYMENT_SENDEMAIL").
'</td><td>';
595print
img_picto(
'',
'email',
'class="pictofixedwidth"');
596print
'<input class="minwidth200" type="text" name="ONLINE_PAYMENT_SENDEMAIL" value="' .
getDolGlobalString(
'ONLINE_PAYMENT_SENDEMAIL').
'">';
597print
' <span class="opacitymedium">'.$langs->trans(
"Example").
': myemail@myserver.com, Payment service <myemail2@myserver2.com></span>';
606print
'<div class="div-table-responsive-no-min">';
607print
'<table class="noborder centpercent">';
608print
'<tr class="liste_titre">';
609print
'<td>Payout</td>';
610print
'<td class="width300"></td>';
616print
'<tr class="oddeven"><td>';
617print $form->textwithpicto($langs->trans(
"StripeAutoRecordPayout"),
'<span class="opacitymedium">'.$langs->trans(
"StripeAutoRecordPayout2",
"payout.created | payout.failed | payout.paid").
'</span>');
620if (
$conf->use_javascript_ajax) {
621 print ajax_constantonoff(
'STRIPE_AUTO_RECORD_PAYOUT', array(),
null, 0, 0, 1);
623 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
624 print $form->selectarray(
"STRIPE_AUTO_RECORD_PAYOUT", $arrval,
getDolGlobalInt(
'STRIPE_AUTO_RECORD_PAYOUT'));
628print
'<tr class="oddeven"><td>';
629print $langs->trans(
"StripeUserAccountForActions").
'</td><td>';
630print
img_picto(
'',
'user',
'class="pictofixedwidth"').$form->select_dolusers(
getDolGlobalString(
'STRIPE_USER_ACCOUNT_FOR_ACTIONS'),
'STRIPE_USER_ACCOUNT_FOR_ACTIONS', 0);
634 print
'<tr class="oddeven"><td>';
635 print $langs->trans(
"BankAccountForBankTransfer").
'</td><td>';
636 print
img_picto(
'',
'bank_account',
'class="pictofixedwidth"');
637 $form->select_comptes(
getDolGlobalString(
'STRIPE_BANK_ACCOUNT_FOR_BANKTRANSFERS'),
'STRIPE_BANK_ACCOUNT_FOR_BANKTRANSFERS', 0,
'', 1);
646print
'<div class="div-table-responsive-no-min">';
647print
'<table class="noborder centpercent">';
649print
'<tr class="liste_titre">';
650print
'<td>'.$langs->trans(
"UrlGenerationParameters").
'</td>';
651print
'<td>'.$langs->trans(
"Value").
'</td>';
655print
'<tr class="oddeven"><td>';
656print $langs->trans(
"SecurityToken").
'</td><td>';
657print
'<input class="minwidth300" type="text" id="PAYMENT_SECURITY_TOKEN" name="PAYMENT_SECURITY_TOKEN" value="' .
getDolGlobalString(
'PAYMENT_SECURITY_TOKEN').
'" spellcheck="false">';
658if (!empty(
$conf->use_javascript_ajax)) {
659 print
' '.img_picto($langs->trans(
'Generate'),
'refresh',
'id="generate_token" class="linkobject"');
662 $langs->load(
"errors");
663 print
img_warning($langs->trans(
"WarningTheHiddenOptionIsOn",
'PAYMENT_SECURITY_ACCEPT_ANY_TOKEN'),
'',
'pictowarning marginleftonly');
672print $form->buttonsSaveCancel(
"Save",
'', array(),
false,
'reposition');
680include DOL_DOCUMENT_ROOT.
'/core/tpl/onlinepaymentlinks.tpl.php';
684print
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'));
687 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'));
692if (!empty(
$conf->use_javascript_ajax)) {
693 print
"\n".
'<script type="text/javascript">';
694 print
'$(document).ready(function () {
696 $("#apidoca").click(function() {
697 console.log("We click on apidoca show/hide");
699 $("#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.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='', $textonpictotooltip='')
Show information in HTML for admin users or standard users.
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.
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.
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.