From 808e0ffbb73b2e2ceb75a42b6f2b5f820363e09a Mon Sep 17 00:00:00 2001 From: karneaud Date: Mon, 29 Jul 2024 22:10:41 -0400 Subject: [PATCH] fix missing custom identifier property --- .../Components/Rotessa/ContactComponent.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/Http/ViewComposers/Components/Rotessa/ContactComponent.php b/app/Http/ViewComposers/Components/Rotessa/ContactComponent.php index b8c001b750e0..3557cd05351f 100644 --- a/app/Http/ViewComposers/Components/Rotessa/ContactComponent.php +++ b/app/Http/ViewComposers/Components/Rotessa/ContactComponent.php @@ -15,11 +15,12 @@ class ContactComponent extends Component { public function __construct(ClientContact $contact) { + $contact = collect($contact->client->contacts->firstWhere('is_primary', 1)->toArray())->merge([ 'home_phone' =>$contact->client->phone, 'custom_identifier' => $contact->client->number, 'name' =>$contact->client->name, - 'id' => null + 'id' => $contact->client->contact_key, ] )->all(); $this->attributes = $this->newAttributeBag(Arr::only($contact, $this->fields) ); @@ -37,12 +38,13 @@ class ContactComponent extends Component private $defaults = [ 'customer_type' => "Business", - 'customer_identifier' => null, - 'id' => null + 'custom_identifier' => null, + 'customer_id' => null ]; public function render() { - return render('gateways.rotessa.components.contact', array_merge($this->defaults, $this->attributes->getAttributes() ) ); + \Debugbar::debug($this->attributes->getAttributes() + $this->defaults); + return render('gateways.rotessa.components.contact', $this->attributes->getAttributes() + $this->defaults ); } }