mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Fix paymentmethod detach
This commit is contained in:
parent
d9560dbb61
commit
126479b5a9
|
|
@ -637,6 +637,16 @@ if (empty($reshook))
|
|||
elseif ($action == 'deletecard' && $source)
|
||||
{
|
||||
try {
|
||||
if (preg_match('/pm_/', $source))
|
||||
{
|
||||
$payment_method = \Stripe\PaymentMethod::retrieve($source);
|
||||
if ($payment_method)
|
||||
{
|
||||
$payment_method->detach();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$cu=$stripe->customerStripe($object, $stripeacc, $servicestatus);
|
||||
$card=$cu->sources->retrieve("$source");
|
||||
if ($card)
|
||||
|
|
@ -645,6 +655,7 @@ if (empty($reshook))
|
|||
if (method_exists($card, 'detach')) $card->detach();
|
||||
else $card->delete();
|
||||
}
|
||||
}
|
||||
|
||||
$url=DOL_URL_ROOT.'/societe/paymentmodes.php?socid='.$object->id;
|
||||
header('Location: '.$url);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user