diff --git a/htdocs/paypal/admin/paypal.php b/htdocs/paypal/admin/paypal.php index 71f4b25829b..e8ba5b87ec6 100644 --- a/htdocs/paypal/admin/paypal.php +++ b/htdocs/paypal/admin/paypal.php @@ -72,11 +72,14 @@ if ($action == 'setvalue' && $user->admin) // Payment token for URL $result = dolibarr_set_const($db, "PAYMENT_SECURITY_TOKEN", GETPOST('PAYMENT_SECURITY_TOKEN', 'alpha'), 'chaine', 0, '', $conf->entity); if (!$result > 0) $error++; - $result = dolibarr_set_const($db, "PAYMENT_SECURITY_TOKEN_UNIQUE", GETPOST('PAYMENT_SECURITY_TOKEN_UNIQUE', 'alpha'), 'chaine', 0, '', $conf->entity); - if (!$result > 0) $error++; + if (empty($conf->use_javascript_ajax)) { + $result = dolibarr_set_const($db, "PAYMENT_SECURITY_TOKEN_UNIQUE", GETPOST('PAYMENT_SECURITY_TOKEN_UNIQUE', 'alpha'), 'chaine', 0, '', $conf->entity); + if (!$result > 0) { + $error++; + } + } - if (!$error) - { + if (!$error) { $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { @@ -120,7 +123,7 @@ print ''; dol_fiche_head($head, 'paypalaccount', '', -1); -print $langs->trans("PaypalDesc")."
\n"; +print ''.$langs->trans("PaypalDesc")."
\n"; // Test if php curl exist if (!function_exists('curl_version')) @@ -156,7 +159,7 @@ print ''; print ''; print $langs->trans("PAYPAL_API_USER").''; print ''; -print '   '.$langs->trans("Example").': admin-facilitator_api1.example.com, paypal_api1.mywebsite.com'; +print '   '.$langs->trans("Example").': admin-facilitator_api1.example.com, paypal_api1.mywebsite.com'; print ''; @@ -169,7 +172,7 @@ print ''; print ''; print $langs->trans("PAYPAL_API_SIGNATURE").''; print ''; -print '
'.$langs->trans("Example").': ASsqXEmw4KzmX-CPChWSVDNCNfd.A3YNR7uz-VncXXAERFDFDFDF'; +print '
'.$langs->trans("Example").': ASsqXEmw4KzmX-CPChWSVDNCNfd.A3YNR7uz-VncXXAERFDFDFDF'; print ''; @@ -201,7 +204,7 @@ print ''; print ''; print $langs->trans("VendorName").''; print ''; -print '   '.$langs->trans("Example").': '.$mysoc->name; +print '   '.$langs->trans("Example").': '.$mysoc->name.''; print ''; if (!empty($conf->banque->enabled)) @@ -215,7 +218,7 @@ if (!empty($conf->banque->enabled)) print ''; print $langs->trans("CSSUrlForPaymentForm").''; print ''; -print '   '.$langs->trans("Example").': http://mysite/mycss.css'; +print '   '.$langs->trans("Example").': http://mysite/mycss.css'; print ''; @@ -248,8 +251,8 @@ print ''; print ''; print $langs->trans("ONLINE_PAYMENT_SENDEMAIL").''; -print ''; -print '   '.$langs->trans("Example").': myemail@myserver.com, Payment service <myemail2@myserver2.com>'; +print ''; +print '   '.$langs->trans("Example").': myemail@myserver.com, Payment service <myemail2@myserver2.com>'; print ''; print ''; @@ -260,15 +263,25 @@ print "\n"; // Payment token for URL print ''; print $langs->trans("SecurityToken").''; -print ''; -if (!empty($conf->use_javascript_ajax)) +print ''; +if (!empty($conf->use_javascript_ajax)) { print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token" class="linkobject"'); - print ''; +} +if (! empty($conf->global->PAYMENT_SECURITY_ACCEPT_ANY_TOKEN)) { + $langs->load("errors"); + print img_warning($langs->trans("WarningTheHiddenOptionIsOn", PAYMENT_SECURITY_ACCEPT_ANY_TOKEN), '', 'pictowarning marginleftonly'); +} +print ''; - print ''; - print $langs->trans("SecurityTokenIsUnique").''; - print $form->selectyesno("PAYMENT_SECURITY_TOKEN_UNIQUE", (empty($conf->global->PAYMENT_SECURITY_TOKEN) ? 0 : $conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE), 1); - print ''; +print ''; +print $langs->trans("SecurityTokenIsUnique").''; +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('PAYMENT_SECURITY_TOKEN_UNIQUE'); +} else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("PAYMENT_SECURITY_TOKEN_UNIQUE", $arrval, $conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE); +} +print ''; print ''; diff --git a/htdocs/stripe/admin/stripe.php b/htdocs/stripe/admin/stripe.php index e00047be775..bcb9527e089 100644 --- a/htdocs/stripe/admin/stripe.php +++ b/htdocs/stripe/admin/stripe.php @@ -433,14 +433,14 @@ print ''; print ''; print $langs->trans("ONLINE_PAYMENT_SENDEMAIL").''; -print ''; +print ''; print '   '.$langs->trans("Example").': myemail@myserver.com, Payment service <myemail2@myserver2.com>'; print ''; // Payment token for URL print ''; print $langs->trans("SecurityToken").''; -print ''; +print ''; if (!empty($conf->use_javascript_ajax)) { print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token" class="linkobject"'); }