diff --git a/Model/Carrier/BobGo.php b/Model/Carrier/BobGo.php index 0af2cd8cb4d86545695bc37d23c4c7b4efc87f7a..97b69031d8a7526be5b087a01179add4aadb1ce6 100644 --- a/Model/Carrier/BobGo.php +++ b/Model/Carrier/BobGo.php @@ -112,7 +112,7 @@ class BobGo extends AbstractCarrierOnline implements \Magento\Shipping\Model\Car */ protected JsonFactory $jsonFactory; private $cartRepository; - public Company $company; + public AdditionalInfo $additionalInfo; /** @@ -187,7 +187,7 @@ class BobGo extends AbstractCarrierOnline implements \Magento\Shipping\Model\Car ); $this->jsonFactory = $jsonFactory; $this->curl = $curlFactory->create(); - $this->company = new Company(); + $this->additionalInfo = new AdditionalInfo($countryFactory); } /* @@ -1004,14 +1004,14 @@ class BobGo extends AbstractCarrierOnline implements \Magento\Shipping\Model\Car */ public function getDestComp(): mixed { - return $this->company->getDestComp(); + return $this->additionalInfo->getDestComp(); } /** * @return mixed|string */ public function getDestSuburb(): mixed { - return $this->company->getSuburb(); + return $this->additionalInfo->getSuburb(); } /** diff --git a/Model/Carrier/Company.php b/Model/Carrier/Company.php deleted file mode 100644 index b5547595722df67b2535db561a06aad3c28b1918..0000000000000000000000000000000000000000 --- a/Model/Carrier/Company.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php - -namespace BobGroup\BobGo\Model\Carrier; - -/** - * Get the Company information from the request body and return it - */ -class Company -{ - - /** - * @return mixed|string - */ - public function getDestComp(): mixed - { - $data = json_decode(file_get_contents('php://input'), true); - - if (isset($data['address']['company'])) { - $destComp = $data['address']['company']; - } else { - $destComp = ''; - } - return $destComp; - } - - public function getSuburb(): mixed - { - - $data = json_decode(file_get_contents('php://input'), true); - - if (isset($data['address']['custom_attributes'][0]['value'])) { - $destSub = $data['address']['custom_attributes'][0]['value']; - //print_r($destSub); - } else { - $destSub = ''; - } - return $destSub; - } -}