Skip to content
Snippets Groups Projects
Commit 6c0616b7 authored by Christel Loftus's avatar Christel Loftus
Browse files

Remove company.php

parent 87f929ed
No related branches found
No related tags found
1 merge request!6Rates at checkout
...@@ -112,7 +112,7 @@ class BobGo extends AbstractCarrierOnline implements \Magento\Shipping\Model\Car ...@@ -112,7 +112,7 @@ class BobGo extends AbstractCarrierOnline implements \Magento\Shipping\Model\Car
*/ */
protected JsonFactory $jsonFactory; protected JsonFactory $jsonFactory;
private $cartRepository; private $cartRepository;
public Company $company; public AdditionalInfo $additionalInfo;
/** /**
...@@ -187,7 +187,7 @@ class BobGo extends AbstractCarrierOnline implements \Magento\Shipping\Model\Car ...@@ -187,7 +187,7 @@ class BobGo extends AbstractCarrierOnline implements \Magento\Shipping\Model\Car
); );
$this->jsonFactory = $jsonFactory; $this->jsonFactory = $jsonFactory;
$this->curl = $curlFactory->create(); $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 ...@@ -1004,14 +1004,14 @@ class BobGo extends AbstractCarrierOnline implements \Magento\Shipping\Model\Car
*/ */
public function getDestComp(): mixed public function getDestComp(): mixed
{ {
return $this->company->getDestComp(); return $this->additionalInfo->getDestComp();
} }
/** /**
* @return mixed|string * @return mixed|string
*/ */
public function getDestSuburb(): mixed public function getDestSuburb(): mixed
{ {
return $this->company->getSuburb(); return $this->additionalInfo->getSuburb();
} }
/** /**
......
<?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;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment