Fix to avoid stripe live mode beeing disabled when stripeconnect off

This commit is contained in:
Laurent Destailleur 2018-03-13 14:13:32 +01:00
parent 9f07ff0f9b
commit b25f3ba322
4 changed files with 10 additions and 10 deletions

View File

@ -61,7 +61,7 @@ $societestatic = new Societe($db);
$memberstatic = new Adherent($db);
$acc = new Account($db);
$stripe=new Stripe($db);
if (! empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || empty($conf->global->STRIPECONNECT_LIVE) || GETPOST('forcesandbox','alpha')))
if (! empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox','alpha')))
{
$service = 'StripeTest';
dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode','Stripe'),'','warning');

View File

@ -55,11 +55,11 @@ class ActionsStripeconnect
{
$this->db = $db;
}
/**
* formObjectOptions
*
*
* @param array $parameters Parameters
* @param Object $object Object
* @param string $action Action
@ -68,7 +68,7 @@ class ActionsStripeconnect
{
global $db,$conf,$user,$langs,$form;
if (! empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || empty($conf->global->STRIPECONNECT_LIVE) || GETPOST('forcesandbox','alpha')))
if (! empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox','alpha')))
{
$service = 'StripeTest';
dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode','Stripe'),'','warning');
@ -85,7 +85,7 @@ class ActionsStripeconnect
$key=$value;
}
}
if (is_object($object) && $object->element == 'societe')
{
@ -106,7 +106,7 @@ class ActionsStripeconnect
$this->resprints.= $langs->trans("NoStripe");
}
$this->resprints.= '</td></tr>';
}
elseif (is_object($object) && $object->element == 'member'){
$this->resprints.= '<tr><td>';
@ -125,7 +125,7 @@ class ActionsStripeconnect
$this->resprints.= $langs->trans("NoStripe");
}
$this->resprints.= '</td></tr>';
$this->resprints.= '<tr><td>';
$this->resprints.= '<table width="100%" class="nobordernopadding"><tr><td>';
$this->resprints.= $langs->trans('SubscriptionStripe');
@ -167,7 +167,7 @@ class ActionsStripeconnect
/**
* addMoreActionsButtons
*
*
* @param arra $parameters Parameters
* @param Object $object Object
* @param string $action action

View File

@ -295,7 +295,7 @@ class Stripe extends CommonObject
if (isset($charge->id)) {}
}
if (empty($conf->global->STRIPE_LIVE) || empty($conf->global->STRIPECONNECT_LIVE) || GETPOST('forcesandbox','alpha')) $service = 'StripeTest';
if (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox','alpha')) $service = 'StripeTest';
else $service = 'StripeLive';
$return->statut = 'success';

View File

@ -55,7 +55,7 @@ $societestatic = new societe($db);
$acc = new Account($db);
$stripe = new Stripe($db);
if (! empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || empty($conf->global->STRIPECONNECT_LIVE) || GETPOST('forcesandbox', 'alpha')))
if (! empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox', 'alpha')))
{
$service = 'StripeTest';
dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning');