Enforce character lengths for authorize fields

This commit is contained in:
David Bomba 2022-04-13 16:48:02 +10:00
parent e452c04214
commit 87f5c73787
3 changed files with 9 additions and 9 deletions

View File

@ -140,7 +140,7 @@ class CompanyImport implements ShouldQueue
'expenses',
'tasks',
'payments',
'activities',
// 'activities',
// 'backups',
'company_ledger',
'designs',

View File

@ -190,7 +190,7 @@ class BaseModel extends Model
public function numberFormatter()
{
$number = strlen($this->number) >= 1 ? $this->number : class_basename($this) . "_" . Str::random(5); ;
$number = strlen($this->number) >= 1 ? $this->number : class_basename($this) . "_" . Str::random(5);
$formatted_number = mb_ereg_replace("([^\w\s\d\-_~,;\[\]\(\).])", '', $number);
// Remove any runs of periods (thanks falstro!)

View File

@ -164,13 +164,13 @@ class AuthorizePaymentMethod
if ($contact) {
// Create the Bill To info for new payment type
$billto = new CustomerAddressType();
$billto->setFirstName($contact->present()->first_name());
$billto->setLastName($contact->present()->last_name());
$billto->setCompany($this->authorize->client->present()->name());
$billto->setAddress($this->authorize->client->address1);
$billto->setCity($this->authorize->client->city);
$billto->setState($this->authorize->client->state);
$billto->setZip($this->authorize->client->postal_code);
$billto->setFirstName(substr(0,50,$contact->present()->first_name()));
$billto->setLastName(substr(0,50,$contact->present()->last_name()));
$billto->setCompany(substr(0,50,$this->authorize->client->present()->name()));
$billto->setAddress(substr(0,60,$this->authorize->client->address1));
$billto->setCity(substr(0,40,$this->authorize->client->city));
$billto->setState(substr(0,40,$this->authorize->client->state));
$billto->setZip(substr(0,20,$this->authorize->client->postal_code));
if ($this->authorize->client->country_id) {
$billto->setCountry($this->authorize->client->country->name);