Skip to content
Snippets Groups Projects
Select Git revision
  • c7a51e97ca7af46d2a1900ea57d0096b4cee272f
  • dev default protected
  • prod protected
  • 1.0.58
  • 1.0.57
  • 1.0.52
  • 1.0.56
  • 1.0.51
  • 1.0.50
  • 1.0.33
  • 1.0.32
  • 1.0.31
  • 1.0.30
  • 1.0.29
  • 1.0.28
  • 1.0.27
  • 1.0.26
  • 1.0.25
  • 1.0.24
  • 1.0.23
  • 1.0.22
  • 1.0.21
  • 1.0.20
23 results

AdditionalInfo.php

Blame
  • AdditionalInfo.php 1.79 KiB
    <?php
    
    namespace BobGroup\BobGo\Model\Carrier;
    
    /**
     * Get the AdditionalInfo information from the request body and return it
     */
    class AdditionalInfo
    {
    
        /**
         * @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;
        }
    
        /**
         * @return mixed|string
         */
        public function getDestTelephone(): mixed
        {
            $data = json_decode(file_get_contents('php://input'), true);
    
            if (isset($data['address']['telephone'])) {
                $destTelephone = $data['address']['telephone'];
            } else {
                $destTelephone = '';
            }
            return $destTelephone;
        }
    
    
        /**
         * @var \BobGroup\BobGo\Model\Carrier\AdditionalInfo
         */
        public $countryFactory;
    
        public function __construct($countryFactory)
        {
            $this->countryFactory = $countryFactory;
        }
    
        /**
         * country full name
         *
         * @return string
         */