From a2efdee8656066355a436a575c8f2ad6ec3341ad Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 1 Oct 2020 16:49:27 +0200 Subject: [PATCH] Fix after regression of #14886 --- htdocs/stripe/class/stripe.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index e50f48aad69..392607ad89e 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -83,16 +83,17 @@ class Stripe extends CommonObject * * @param string $mode 'StripeTest' or 'StripeLive' * @param int $fk_soc Id of thirdparty + * @param int $entity Id of entity * @return string Stripe account 'acc_....' or '' if no OAuth token found */ - public function getStripeAccount($mode = 'StripeTest', $fk_soc = 0) + public function getStripeAccount($mode = 'StripeTest', $fk_soc = 0, $entity = 1) { global $conf; $sql = "SELECT tokenstring"; $sql .= " FROM ".MAIN_DB_PREFIX."oauth_token"; $sql .= " WHERE service = '".$this->db->escape($mode)."'"; - if (empty($fk_soc)) $sql .= " entity = ".$conf->entity. " AND"; + $sql .= " AND entity = ".((int) $entity); if ($fk_soc > 0) { $sql .= " AND fk_soc = ".$fk_soc; } else {