Fixes de telefono y apellido de persona

This commit is contained in:
Juan Pablo Vial
2025-05-16 16:35:17 -04:00
parent 16cd29635d
commit 105179b4ed
6 changed files with 29 additions and 12 deletions

View File

@ -72,6 +72,17 @@ class Customer extends AbstractEndPoint
if ($ref === null) {
continue;
}
if ($ref === 'telefono') {
$value = $data[$ref];
if ($value === '' or $value === null or $value === '0') {
continue;
}
if (!str_starts_with($value, '+')) {
$value = "+56{$value}";
}
$params[$key] = $value;
continue;
}
if (array_key_exists($ref, $data) and $data[$ref] !== '' and $data[$ref] !== null) {
$params[$key] = $data[$ref];
}