Fix compatibility with payment modes
This commit is contained in:
parent
48b2cb83af
commit
efb9a30ec1
@ -614,8 +614,14 @@ if (empty($reshook))
|
||||
{
|
||||
try {
|
||||
$cu=$stripe->customerStripe($object, $stripeacc, $servicestatus);
|
||||
$cu->default_source = (string) $source; // Old
|
||||
$cu->invoice_settings->default_payment_method = (string) $source; // New
|
||||
if (preg_match('/pm_/', $source))
|
||||
{
|
||||
$cu->invoice_settings->default_payment_method = (string) $source; // New
|
||||
}
|
||||
else
|
||||
{
|
||||
$cu->default_source = (string) $source; // Old
|
||||
}
|
||||
$result = $cu->save();
|
||||
|
||||
$url=DOL_URL_ROOT.'/societe/paymentmodes.php?socid='.$object->id;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user