Skip to content

Commit

Permalink
ident
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Aug 29, 2018
1 parent eaa49e7 commit f146572
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions htdocs/core/triggers/interface_80_modStripe_Stripe.class.php
Expand Up @@ -134,7 +134,7 @@ public function runTrigger($action, $object, User $user, Translate $langs, Conf
$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);

Expand Down Expand Up @@ -170,17 +170,17 @@ public function runTrigger($action, $object, User $user, Translate $langs, Conf
$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
Expand Down

0 comments on commit f146572

Please sign in to comment.