diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index ae446a047d3..8088cec0ebb 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -1,7 +1,7 @@ * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2016 Laurent Destailleur + * Copyright (C) 2004-2018 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2013 Peter Fontaine * Copyright (C) 2015-2016 Marcos GarcĂ­a @@ -76,7 +76,7 @@ if (! empty($conf->stripe->enabled)) if (! empty($conf->global->STRIPE_LIVE) && ! GETPOST('forcesandbox','alpha')) { $service = 'StripeLive'; - $servicestatus = 0; + $servicestatus = 1; } $stripe = new Stripe($db); @@ -397,7 +397,7 @@ if (empty($reshook)) if ($action == 'setassourcedefault') { try { - $cu = \Stripe\Customer::retrieve($stripecu); + $cu=$stripe->customerStripe($object->id, $stripeacc, $servicestatus); $cu->default_source = (string) $source; $result = $cu->save(); @@ -413,7 +413,7 @@ if (empty($reshook)) elseif ($action == 'deletecard') { try { - $cu = \Stripe\Customer::retrieve($stripecu); + $cu=$stripe->customerStripe($object->id, $stripeacc, $servicestatus); $cu->sources->retrieve("$source")->detach();