Fix to avoid stripe live mode beeing disabled when stripeconnect off
This commit is contained in:
parent
9f07ff0f9b
commit
b25f3ba322
@ -61,7 +61,7 @@ $societestatic = new Societe($db);
|
|||||||
$memberstatic = new Adherent($db);
|
$memberstatic = new Adherent($db);
|
||||||
$acc = new Account($db);
|
$acc = new Account($db);
|
||||||
$stripe=new Stripe($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';
|
$service = 'StripeTest';
|
||||||
dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode','Stripe'),'','warning');
|
dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode','Stripe'),'','warning');
|
||||||
|
|||||||
@ -55,11 +55,11 @@ class ActionsStripeconnect
|
|||||||
{
|
{
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* formObjectOptions
|
* formObjectOptions
|
||||||
*
|
*
|
||||||
* @param array $parameters Parameters
|
* @param array $parameters Parameters
|
||||||
* @param Object $object Object
|
* @param Object $object Object
|
||||||
* @param string $action Action
|
* @param string $action Action
|
||||||
@ -68,7 +68,7 @@ class ActionsStripeconnect
|
|||||||
{
|
{
|
||||||
global $db,$conf,$user,$langs,$form;
|
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';
|
$service = 'StripeTest';
|
||||||
dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode','Stripe'),'','warning');
|
dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode','Stripe'),'','warning');
|
||||||
@ -85,7 +85,7 @@ class ActionsStripeconnect
|
|||||||
$key=$value;
|
$key=$value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (is_object($object) && $object->element == 'societe')
|
if (is_object($object) && $object->element == 'societe')
|
||||||
{
|
{
|
||||||
@ -106,7 +106,7 @@ class ActionsStripeconnect
|
|||||||
$this->resprints.= $langs->trans("NoStripe");
|
$this->resprints.= $langs->trans("NoStripe");
|
||||||
}
|
}
|
||||||
$this->resprints.= '</td></tr>';
|
$this->resprints.= '</td></tr>';
|
||||||
|
|
||||||
}
|
}
|
||||||
elseif (is_object($object) && $object->element == 'member'){
|
elseif (is_object($object) && $object->element == 'member'){
|
||||||
$this->resprints.= '<tr><td>';
|
$this->resprints.= '<tr><td>';
|
||||||
@ -125,7 +125,7 @@ class ActionsStripeconnect
|
|||||||
$this->resprints.= $langs->trans("NoStripe");
|
$this->resprints.= $langs->trans("NoStripe");
|
||||||
}
|
}
|
||||||
$this->resprints.= '</td></tr>';
|
$this->resprints.= '</td></tr>';
|
||||||
|
|
||||||
$this->resprints.= '<tr><td>';
|
$this->resprints.= '<tr><td>';
|
||||||
$this->resprints.= '<table width="100%" class="nobordernopadding"><tr><td>';
|
$this->resprints.= '<table width="100%" class="nobordernopadding"><tr><td>';
|
||||||
$this->resprints.= $langs->trans('SubscriptionStripe');
|
$this->resprints.= $langs->trans('SubscriptionStripe');
|
||||||
@ -167,7 +167,7 @@ class ActionsStripeconnect
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* addMoreActionsButtons
|
* addMoreActionsButtons
|
||||||
*
|
*
|
||||||
* @param arra $parameters Parameters
|
* @param arra $parameters Parameters
|
||||||
* @param Object $object Object
|
* @param Object $object Object
|
||||||
* @param string $action action
|
* @param string $action action
|
||||||
|
|||||||
@ -295,7 +295,7 @@ class Stripe extends CommonObject
|
|||||||
if (isset($charge->id)) {}
|
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';
|
else $service = 'StripeLive';
|
||||||
|
|
||||||
$return->statut = 'success';
|
$return->statut = 'success';
|
||||||
|
|||||||
@ -55,7 +55,7 @@ $societestatic = new societe($db);
|
|||||||
$acc = new Account($db);
|
$acc = new Account($db);
|
||||||
$stripe = new Stripe($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';
|
$service = 'StripeTest';
|
||||||
dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning');
|
dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user