![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/extmag/dhlshipping2/Plugin/Model/Source/ |
<?php /** * Copyright © Extmag. All rights reserved. */ namespace Extmag\DhlShipping\Plugin\Model\Source; use Extmag\DhlShipping\Helper\DataPrepare; use Extmag\DhlShipping\Helper\Response\PickupCancel; use Extmag\DhlShipping\Helper\Response\PickupCreation; use Extmag\DhlShipping\Helper\Response\Rate; use Extmag\DhlShipping\Helper\Response\Ship; use Extmag\DhlShipping\Helper\Response\Track; use Extmag\DhlShipping\Model\Source\ServiceCodes; use Magento\Framework\App\Config\ScopeConfigInterface; class CarrierCodes { /** * @var ScopeConfigInterface */ protected $scopeConfig; /** * @param ScopeConfigInterface $scopeConfig */ public function __construct( ScopeConfigInterface $scopeConfig ) { $this->scopeConfig = $scopeConfig; } /** * Before Plugin Get Carriers * * @param \Extmag\Shiplab\Model\Source\CarrierCodes $subject * @param $code * @return array|null[] */ public function beforeGetCarriers(\Extmag\Shiplab\Model\Source\CarrierCodes $subject, $code = null) { if ($this->scopeConfig->getValue('shiplab_carriers/dhl/enabled') == 1) { $subject->setCarriers('dhl', [ 'name' => 'DHL Express', 'long_name' => 'DHL Express', 'max_weight' => [ 'weight' => 300, 'unit' => 'KG', ], 'customer_printing_type' => 'PDF', 'data_prepare_class' => DataPrepare::class, 'request_classes' => [ 'ship' => \Extmag\DhlShipping\Helper\Request\Ship::class, 'rate' => \Extmag\DhlShipping\Helper\Request\Rate::class, 'pickupcreation' => \Extmag\DhlShipping\Helper\Request\PickupCreation::class, 'pickupcancel' => \Extmag\DhlShipping\Helper\Request\PickupCancel::class, 'track' => \Extmag\DhlShipping\Helper\Request\Track::class, ], 'response_classes' => [ 'ship' => Ship::class, 'rate' => Rate::class, 'pickupcreation' => PickupCreation::class, 'pickupcancel' => PickupCancel::class, 'track' => Track::class, ], 'api_urls' => [ [ 'ship' => 'https://xmlpitest-ea.dhl.com/XMLShippingServlet', 'rate' => 'https://xmlpi-ea.dhl.com/XMLShippingServlet', 'pickupcreation' => 'https://xmlpitest-ea.dhl.com/XMLShippingServlet', 'pickupcancel' => 'https://xmlpitest-ea.dhl.com/XMLShippingServlet', 'track' => 'https://xmlpitest-ea.dhl.com/XMLShippingServlet', ], [ 'ship' => 'https://xmlpi-ea.dhl.com/XMLShippingServlet', 'rate' => 'https://xmlpi-ea.dhl.com/XMLShippingServlet', 'pickupcreation' => 'https://xmlpi-ea.dhl.com/XMLShippingServlet', 'pickupcancel' => 'https://xmlpi-ea.dhl.com/XMLShippingServlet', 'track' => 'https://xmlpi-ea.dhl.com/XMLShippingServlet', ], ], 'service_codes_class' => ServiceCodes::class, ]); } return [$code]; } }