This commit is contained in:
Laurent Destailleur 2019-11-11 00:34:05 +01:00
parent 0bcd4c630d
commit 0a607d697f

View File

@ -174,12 +174,12 @@ class Stripe extends CommonObject
$obj = $this->db->fetch_object($resql);
$tiers = $obj->key_account;
dol_syslog(get_class($this)."::customerStripe found stripe customer key_account = ".$tiers);
// Force to use the correct API key
global $stripearrayofkeysbyenv;
\Stripe\Stripe::setApiKey($stripearrayofkeysbyenv[$status]['secret_key']);
dol_syslog(get_class($this)."::customerStripe found stripe customer key_account = ".$tiers." with publishable_key = ".$stripearrayofkeysbyenv[$status]['publishable_key']);
try {
if (empty($key)) { // If the Stripe connect account not set, we use common API usage
$customer = \Stripe\Customer::retrieve("$tiers");