Fix SQL and ADD support LIVE/TEST mode
This commit is contained in:
parent
01f25b00b0
commit
9408a98c52
@ -98,12 +98,20 @@ class Stripe extends CommonObject
|
|||||||
public function getStripeCustomerAccount($id)
|
public function getStripeCustomerAccount($id)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
if (empty($conf->global->STRIPECONNECT_LIVE)) {
|
||||||
|
$mode = 0;
|
||||||
|
} else {
|
||||||
|
if (empty($conf->global->STRIPE_LIVE)) {
|
||||||
|
$mode = 0;
|
||||||
|
} else {
|
||||||
|
$mode = $conf->global->STRIPE_LIVE;
|
||||||
|
}
|
||||||
|
}
|
||||||
$sql = "SELECT sa.key_account as key_account, sa.entity";
|
$sql = "SELECT sa.key_account as key_account, sa.entity";
|
||||||
$sql.= " FROM " . MAIN_DB_PREFIX . "llx_societe_accounts as sa";
|
$sql.= " FROM " . MAIN_DB_PREFIX . "llx_societe_account as sa";
|
||||||
$sql.= " WHERE sa.fk_soc = " . $id;
|
$sql.= " WHERE sa.fk_soc = " . $id;
|
||||||
$sql.= " AND sa.entity IN (".getEntity('societe').")";
|
$sql.= " AND sa.entity IN (".getEntity('societe').")";
|
||||||
$sql.= " AND site = 'stripe'";
|
$sql.= " AND sa.site = 'stripe' AND sa.status = ".$mode;
|
||||||
|
|
||||||
dol_syslog(get_class($this) . "::fetch", LOG_DEBUG);
|
dol_syslog(get_class($this) . "::fetch", LOG_DEBUG);
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user