From 3416d2bdd1a04b488ddba549609c9419e5cb6675 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 22 Feb 2019 14:29:38 +0100 Subject: [PATCH] Update transaction.php --- htdocs/stripe/transaction.php | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/htdocs/stripe/transaction.php b/htdocs/stripe/transaction.php index 9620e3399c9..b0575a53ee4 100644 --- a/htdocs/stripe/transaction.php +++ b/htdocs/stripe/transaction.php @@ -60,20 +60,18 @@ $stripe = new Stripe($db); llxHeader('', $langs->trans("StripeTransactionList")); -if (! empty($conf->stripe->enabled)) +if (! empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox', 'alpha'))) { $service = 'StripeTest'; - $servicestatus = 0; - if (! empty($conf->global->STRIPE_LIVE) && ! GETPOST('forcesandbox', 'alpha')) - { - $service = 'StripeLive'; - $servicestatus = 1; - } - - $stripe=new Stripe($db); - $stripeacc = $stripe->getStripeAccount($service); // Stripe OAuth connect account of dolibarr user (no network access here) + $servicestatus = '0'; + dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning'); } - +else +{ + $service = 'StripeLive'; + $servicestatus = '1'; +} +$stripeacc = $stripe->getStripeAccount($service); /*if (empty($stripeaccount)) { print $langs->trans('ErrorStripeAccountNotDefined');