diff --git a/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php b/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php index ab0cd62eb82..f9985461df8 100644 --- a/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php +++ b/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php @@ -136,7 +136,6 @@ class InterfaceStripe $service = 'StripeLive'; $servicestatus = 1; } - // If customer is linked to Strip, we update/delete Stripe too if ($action == 'COMPANY_MODIFY') { dol_syslog("Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id); @@ -148,19 +147,22 @@ class InterfaceStripe if ($customer) { $namecleaned = $object->name ? $object->name : null; - $vatcleaned = $object->tva_intra ? $object->tva_intra : null; // We force data to "null" if empty as expected by Stripe + $vatcleaned = array( + "tax_id" => $object->tva_intra ? $object->tva_intra : null, // We force data to "null" if empty as expected by Stripe + "type" => 'vat', + ); // Detect if we change a Stripe info (email, description, vat id) $changerequested = 0; if (! empty($object->email) && $object->email != $customer->email) $changerequested++; if ($namecleaned != $customer->description) $changerequested++; - if ($vatcleaned != $customer->business_vat_id) $changerequested++; + if ($vatcleaned != $customer->tax_info) $changerequested++; if ($changerequested) { if (! empty($object->email)) $customer->email = $object->email; $customer->description = $namecleaned; - $customer->business_vat_id = $vatcleaned; + $customer->tax_info = $vatcleaned; $customer->save(); }