Skip to content
Snippets Groups Projects
Select Git revision
  • 78809cab633e781eaf1111c587952eb13588e9ea
  • main default protected
  • trading_hours
  • refactor_trading_hours
  • audit_cleaning_cater_for_non_struct_fields
  • remove-info-logs
  • sl-refactor
  • 18-use-scan-for-param-values
  • 17-order-search-results
  • 4-simplify-framework-2
  • 1-http-error
  • v1.297.0
  • v1.296.0
  • v1.295.0
  • v1.294.0
  • v1.293.0
  • v1.292.0
  • v1.291.0
  • v1.290.0
  • v1.289.0
  • v1.288.0
  • v1.287.0
  • v1.286.0
  • v1.285.0
  • v1.284.0
  • v1.283.0
  • v1.282.0
  • v1.281.0
  • v1.280.0
  • v1.279.0
  • v1.278.0
31 results

time_series.go

Blame
  • Customshipping.php 19.10 KiB
    <?php
    
    namespace uafrica\Customshipping\Model\Carrier;
    
    use Magento\Framework\App\Config\ScopeConfigInterface;
    use Magento\Framework\DataObject;
    use Magento\Shipping\Model\Carrier\AbstractCarrier;
    use Magento\Shipping\Model\Carrier\CarrierInterface;
    use Magento\Shipping\Model\Rate\ResultFactory;
    use Magento\Quote\Model\Quote\Address\RateResult\ErrorFactory;
    use Magento\Quote\Model\Quote\Address\RateResult\Method;
    use Magento\Quote\Model\Quote\Address\RateResult\MethodFactory;
    use Magento\Quote\Model\Quote\Address\RateRequest;
    use Psr\Log\LoggerInterface;
    use Magento\Framework\Controller\Result\JsonFactory;
    use Magento\Framework\HTTP\Client\CurlFactory;
    
    /**
     * @category   uafrica
     * @package    uafrica_Customshipping
     * @author     info@bob.co.za
     * @website    https://www.bob.co.za
     */
    class Customshipping extends AbstractCarrier implements CarrierInterface
    {
        /** Tracking Endpoint */
        const TRACKING = 'https://api.dev.ship.uafrica.com/tracking?channel=localhost&tracking_reference=';
        /*** RATES API Endpoint*/
        const RATES_ENDPOINT = 'https://8390956f-c00b-497d-8742-87b1d6305bd2.mock.pstmn.io/putrates';
    
        /**
         * Carrier's code
         *
         * @var string
         */
        protected $_code = 'uafrica';
    
        /**
         * Whether this carrier has fixed rates calculation
         *
         * @var bool
         */
        protected $_isFixed = false;
    
        /**
         * @var ResultFactory
         */
        protected $_rateResultFactory;
    
        /**
         * @var MethodFactory
         */
        protected $_rateMethodFactory;
    
        /**
         * @var \Magento\Framework\Controller\Result\JsonFactory
         */
        protected $jsonFactory;
    
        /**
         * @var \Magento\Framework\HTTP\Client\Curl
         */
        protected $curl;
    
    
        /**
         * @param \Magento\Framework\Controller\Result\JsonFactory $jsonFactory
         */
    
        /**