This commit is contained in:
Laurent Destailleur 2018-08-29 21:17:18 +02:00
parent eaa49e773d
commit f146572b81

View File

@ -134,7 +134,7 @@ class InterfaceStripe
$servicestatus = 1;
}
// If customer is linked to Strip, we update/delete Stripe too
// If customer is linked to Stripe, we update/delete Stripe too
if ($action == 'COMPANY_MODIFY') {
dol_syslog("Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id);
@ -170,17 +170,17 @@ class InterfaceStripe
$stripeacc = $stripe->getStripeAccount($service); // No need of network access for this
$customer = $stripe->customerStripe($object, $stripeacc, $servicestatus);
if ($customer) {
if ($customer)
{
$customer->delete();
}
$sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_account";
$sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_account";
$sql.= " WHERE site='stripe' AND fk_soc = " . $object->id;
$this->db->query($sql);
$this->db->query($sql);
}
// If payment mode is linked to Strip, we update/delete Stripe too
// If payment mode is linked to Stripee, we update/delete Stripe too
if ($action == 'COMPANYPAYMENTMODE_MODIFY' && $object->type == 'card') {
// For creation of credit card, we do not create in Stripe automatically