Skip to content

Commit

Permalink
Fix to avoid stripe live mode beeing disabled when stripeconnect off
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Mar 13, 2018
1 parent 9f07ff0 commit b25f3ba
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion htdocs/stripe/charge.php
Expand Up @@ -61,7 +61,7 @@
$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');
Expand Down
14 changes: 7 additions & 7 deletions htdocs/stripe/class/actions_stripe.class.php
Expand Up @@ -55,11 +55,11 @@ function __construct($db)
{
$this->db = $db;
}


/**
* formObjectOptions
*
*
* @param array $parameters Parameters
* @param Object $object Object
* @param string $action Action
Expand All @@ -68,7 +68,7 @@ function formObjectOptions($parameters, &$object, &$action)
{
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');
Expand All @@ -85,7 +85,7 @@ function formObjectOptions($parameters, &$object, &$action)
$key=$value;
}
}


if (is_object($object) && $object->element == 'societe')
{
Expand All @@ -106,7 +106,7 @@ function formObjectOptions($parameters, &$object, &$action)
$this->resprints.= $langs->trans("NoStripe");
}
$this->resprints.= '</td></tr>';

}
elseif (is_object($object) && $object->element == 'member'){
$this->resprints.= '<tr><td>';
Expand All @@ -125,7 +125,7 @@ function formObjectOptions($parameters, &$object, &$action)
$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');
Expand Down Expand Up @@ -167,7 +167,7 @@ function formObjectOptions($parameters, &$object, &$action)

/**
* addMoreActionsButtons
*
*
* @param arra $parameters Parameters
* @param Object $object Object
* @param string $action action
Expand Down
2 changes: 1 addition & 1 deletion htdocs/stripe/class/stripe.class.php
Expand Up @@ -295,7 +295,7 @@ public function createPaymentStripe($amount, $currency, $origin, $item, $source,
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';
Expand Down
2 changes: 1 addition & 1 deletion htdocs/stripe/transaction.php
Expand Up @@ -55,7 +55,7 @@
$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');
Expand Down

0 comments on commit b25f3ba

Please sign in to comment.