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