Shipment/Gateway/AbstractProvider.php
protected function createAndRegisterGateway($platformName, $name, array $config)
    {
        $platform = $this->registry->getPlatform($platformName);

        $gateway = $platform->createGateway($name, $config);

        if ($gateway instanceof Shipment\AddressResolverAwareInterface) {
            $gateway->setAddressResolver($this->registry->getAddressResolver());
        }
        if ($gateway instanceof Shipment\WeightCalculatorAwareInterface) {
            $gateway->setWeightCalculator($this->registry->getWeightCalculator());
        }
        if ($gateway instanceof PersisterAwareInterface) {
            $gateway->setPersister($this->registry->getPersister());
        }

        $this->gateways[$name] = $gateway;
    }
protected function createAndRegisterGateway($platformName, $name, array $config)
    {
        $platform = $this->registry->getPlatform($platformName);

        $gateway = $platform->createGateway($name, $config);

        if ($gateway instanceof Shipment\AddressResolverAwareInterface) {
            $gateway->setAddressResolver($this->registry->getAddressResolver());
        }
        if ($gateway instanceof Shipment\WeightCalculatorAwareInterface) {
            $gateway->setWeightCalculator($this->registry->getWeightCalculator());
        }
        if ($gateway instanceof PersisterAwareInterface) {
            $gateway->setPersister($this->registry->getPersister());
        }

        $this->gateways[$name] = $gateway;
    }
Creates and registers a gateway.

@param string $platformName
@param string $name
@param array  $config