';
-if (!empty($conf->paypal->enabled)) {
+if (isModEnabled('paypal')) {
if ($paymentmethod == 'paypal') { // We call this page only if payment is ok on payment system
if ($PAYPALTOKEN) {
// Get on url call
@@ -316,14 +316,14 @@ if (!empty($conf->paypal->enabled)) {
}
}
-if (!empty($conf->paybox->enabled)) {
+if (isModEnabled('paybox')) {
if ($paymentmethod == 'paybox') {
// TODO Add a check to validate that payment is ok.
$ispaymentok = true; // We call this page only if payment is ok on payment system
}
}
-if (!empty($conf->stripe->enabled)) {
+if (isModEnabled('stripe')) {
if ($paymentmethod == 'stripe') {
// TODO Add a check to validate that payment is ok. We can request Stripe with payment_intent and payment_intent_client_secret
$ispaymentok = true; // We call this page only if payment is ok on payment system
diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php
index 6110fc7a5e5..2ba271cd936 100644
--- a/htdocs/societe/paymentmodes.php
+++ b/htdocs/societe/paymentmodes.php
@@ -84,7 +84,7 @@ $permissiontoadd = $user->rights->societe->creer; // Used by the include of acti
$permissiontoaddupdatepaymentinformation = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $permissiontoadd) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->societe->thirdparty_paymentinformation_advance->write)));
-if (!empty($conf->stripe->enabled)) {
+if (isModEnabled('stripe')) {
$service = 'StripeTest';
$servicestatus = 0;
if (!empty($conf->global->STRIPE_LIVE) && !GETPOST('forcesandbox', 'alpha')) {
@@ -493,7 +493,7 @@ if (empty($reshook)) {
$id = $savid;
// Action for stripe
- if (!empty($conf->stripe->enabled) && class_exists('Stripe')) {
+ if (isModEnabled('stripe') && class_exists('Stripe')) {
if ($action == 'synccustomertostripe') {
if ($object->client == 0) {
$error++;
@@ -782,11 +782,11 @@ llxHeader('', $title, $help_url);
$head = societe_prepare_head($object);
// Show sandbox warning
-/*if (!empty($conf->paypal->enabled) && (!empty($conf->global->PAYPAL_API_SANDBOX) || GETPOST('forcesandbox','alpha'))) // We can force sand box with param 'forcesandbox'
+/*if (isModEnabled('paypal') && (!empty($conf->global->PAYPAL_API_SANDBOX) || GETPOST('forcesandbox','alpha'))) // We can force sand box with param 'forcesandbox'
{
dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode','Paypal'),'','warning');
}*/
-if (!empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox', 'alpha'))) {
+if (isModEnabled('stripe') && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox', 'alpha'))) {
dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning');
}
@@ -885,13 +885,13 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
$elementTypeArray['contract'] = $langs->transnoentitiesnoconv('Contracts');
}
- if (!empty($conf->stripe->enabled)) {
+ if (isModEnabled('stripe')) {
// Stripe customer key 'cu_....' stored into llx_societe_account
print '