Pop\Shipping\Adapter\Usps::buildRequest PHP Метод

buildRequest() защищенный Метод

Build rate request
protected buildRequest ( ) : void
Результат void
    protected function buildRequest()
    {
        $package = new Child('Package');
        $package->setAttributes('ID', '1ST');
        $package->addChild(new Child('Service', 'ALL'))->addChild(new Child('ZipOrigination', $this->shipFrom['ZipOrigination']))->addChild(new Child('ZipDestination', $this->shipTo['ZipDestination']))->addChild(new Child('Pounds', $this->weight['Pounds']))->addChild(new Child('Ounces', $this->weight['Ounces']))->addChild(new Child('Container', $this->container))->addChild(new Child('Size', $this->containerSize));
        if (null !== $this->dimensions['Length'] && null !== $this->dimensions['Width'] && null !== $this->dimensions['Height']) {
            $package->addChild(new Child('Width', $this->dimensions['Width']))->addChild(new Child('Length', $this->dimensions['Length']))->addChild(new Child('Height', $this->dimensions['Height']));
            if (null == $this->dimensions['Girth']) {
                $this->dimensions['Girth'] = 2 * $this->dimensions['Width'] + 2 * $this->dimensions['Height'];
            }
            $package->addChild(new Child('Girth', $this->dimensions['Girth']));
        }
        $package->addChild(new Child('Machinable', $this->machinable))->addChild(new Child('DropOffTime', '12:00'))->addChild(new Child('ShipDate', date('Y-m-d')));
        $this->request->addChild($package);
    }