Merge pull request #10651 from ptibogxiv/patch-123

Fix servicestatus list of  payment stripe
This commit is contained in:
Laurent Destailleur 2019-02-23 14:12:19 +01:00 committed by GitHub
commit b73d8394dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,7 +8,7 @@
* Copyright (C) 2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com>
* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2018 Thibault FOUCART <support@ptibogxiv.net>
* Copyright (C) 2018-2019 Thibault FOUCART <support@ptibogxiv.net>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -80,22 +80,29 @@ if ($facid > 0)
if (! empty($conf->stripe->enabled))
{
$service = 'StripeTest';
$servicestatus = 0;
if (! empty($conf->global->STRIPE_LIVE) && ! GETPOST('forcesandbox', 'alpha'))
{
$service = 'StripeLive';
$servicestatus = 0;
}
$stripe=new Stripe($db);
$stripeacc = $stripe->getStripeAccount($service); // Stripe OAuth connect account of dolibarr user (no network access here)
access_forbidden();
}
if (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox', 'alpha'))
{
$service = 'StripeTest';
$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');
}*/
// Initialize technical object to manage hooks of paiements. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('paiementcard','globalcard'));
/*
* Actions
*/