init
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
namespace Magento\Dhl\Block\Adminhtml;
|
||||
|
||||
/**
|
||||
* @magentoAppArea adminhtml
|
||||
*/
|
||||
class UnitofmeasureTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/**
|
||||
* @magentoAppIsolation enabled
|
||||
*/
|
||||
public function testToHtml()
|
||||
{
|
||||
/** @var $layout \Magento\Framework\View\Layout */
|
||||
$layout = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
|
||||
\Magento\Framework\View\LayoutInterface::class
|
||||
);
|
||||
/** @var $block \Magento\Dhl\Block\Adminhtml\Unitofmeasure */
|
||||
$block = $layout->createBlock(\Magento\Dhl\Block\Adminhtml\Unitofmeasure::class);
|
||||
$this->assertNotEmpty($block->toHtml());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,740 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Magento\Dhl\Model;
|
||||
|
||||
use Magento\Framework\App\Config\ReinitableConfigInterface;
|
||||
use Magento\Framework\App\ProductMetadataInterface;
|
||||
use Magento\Framework\DataObject;
|
||||
use Magento\Framework\HTTP\AsyncClient\HttpException;
|
||||
use Magento\Framework\HTTP\AsyncClient\HttpResponseDeferredInterface;
|
||||
use Magento\Framework\HTTP\AsyncClient\Response;
|
||||
use Magento\Framework\HTTP\AsyncClientInterface;
|
||||
use Magento\Framework\Simplexml\Element;
|
||||
use Magento\Quote\Model\Quote\Address\RateRequest;
|
||||
use Magento\Quote\Model\Quote\Address\RateResult\Error;
|
||||
use Magento\Shipping\Model\Shipment\Request;
|
||||
use Magento\Shipping\Model\Simplexml\Element as ShippingElement;
|
||||
use Magento\Shipping\Model\Tracking\Result\Status;
|
||||
use Magento\Store\Model\ScopeInterface;
|
||||
use Magento\TestFramework\Helper\Bootstrap;
|
||||
use Magento\TestFramework\HTTP\AsyncClientInterfaceMock;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* Test for DHL integration.
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
*/
|
||||
class CarrierTest extends TestCase
|
||||
{
|
||||
private const PRODUCT_NAME_SPECIAL_CHARS = 'Φυστίκι Ψημένο με Αλάτι Συσκευασία';
|
||||
|
||||
/**
|
||||
* @var Carrier
|
||||
*/
|
||||
private $dhlCarrier;
|
||||
|
||||
/**
|
||||
* @var AsyncClientInterfaceMock
|
||||
*/
|
||||
private $httpClient;
|
||||
|
||||
/**
|
||||
* @var ReinitableConfigInterface
|
||||
*/
|
||||
private $config;
|
||||
|
||||
/**
|
||||
* @var ProductMetadataInterface
|
||||
*/
|
||||
private $productMetadata;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $restoreCountry;
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
protected function setUp(): void
|
||||
{
|
||||
$objectManager = Bootstrap::getObjectManager();
|
||||
$this->dhlCarrier = $objectManager->get(Carrier::class);
|
||||
$this->httpClient = $objectManager->get(AsyncClientInterface::class);
|
||||
$this->config = $objectManager->get(ReinitableConfigInterface::class);
|
||||
$this->productMetadata = $objectManager->get(ProductMetadataInterface::class);
|
||||
$this->restoreCountry = $this->config->getValue('shipping/origin/country_id', 'store', 'default_store');
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
protected function tearDown(): void
|
||||
{
|
||||
$this->config->setValue(
|
||||
'shipping/origin/country_id',
|
||||
$this->restoreCountry,
|
||||
'store',
|
||||
'default_store'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test sending tracking requests.
|
||||
*
|
||||
* @magentoConfigFixture default_store carriers/dhl/id CustomerSiteID
|
||||
* @magentoConfigFixture default_store carriers/dhl/password CustomerPassword
|
||||
* @param string[] $trackingNumbers
|
||||
* @param string $responseXml
|
||||
* @param array $expectedTrackingData
|
||||
* @param string $expectedRequestXml
|
||||
* @dataProvider trackingDataProvider
|
||||
*/
|
||||
public function testGetTracking(
|
||||
$trackingNumbers,
|
||||
string $responseXml,
|
||||
$expectedTrackingData,
|
||||
string $expectedRequestXml = ''
|
||||
) {
|
||||
$this->httpClient->nextResponses([new Response(200, [], $responseXml)]);
|
||||
$trackingResult = $this->dhlCarrier->getTracking($trackingNumbers);
|
||||
$this->assertTrackingResult($expectedTrackingData, $trackingResult->getAllTrackings());
|
||||
if ($expectedRequestXml !== '') {
|
||||
$this->assertRequest($expectedRequestXml, $this->httpClient->getLastRequest()->getBody());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get tracking data provider
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function trackingDataProvider() : array
|
||||
{
|
||||
// phpcs:disable Magento2.Functions.DiscouragedFunction
|
||||
$expectedMultiAWBRequestXml = file_get_contents(__DIR__ . '/../_files/TrackingRequest_MultipleAWB.xml');
|
||||
$multiAWBResponseXml = file_get_contents(__DIR__ . '/../_files/TrackingResponse_MultipleAWB.xml');
|
||||
$expectedSingleAWBRequestXml = file_get_contents(__DIR__ . '/../_files/TrackingRequest_SingleAWB.xml');
|
||||
$singleAWBResponseXml = file_get_contents(__DIR__ . '/../_files/TrackingResponse_SingleAWB.xml');
|
||||
$singleNoDataResponseXml = file_get_contents(__DIR__ . '/../_files/SingleknownTrackResponse-no-data-found.xml');
|
||||
$failedResponseXml = file_get_contents(__DIR__ . '/../_files/Track-res-XML-Parse-Err.xml');
|
||||
//phpcs:enable Magento2.Functions.DiscouragedFunction
|
||||
$expectedTrackingDataA = [
|
||||
'carrier' => 'dhl',
|
||||
'carrier_title' => 'DHL',
|
||||
'tracking' => 4781584780,
|
||||
'service' => 'DOCUMENT',
|
||||
'progressdetail' => [
|
||||
[
|
||||
'activity' => 'SD Shipment information received',
|
||||
'deliverydate' => '2017-12-25',
|
||||
'deliverytime' => '14:38:00',
|
||||
'deliverylocation' => 'BEIJING-CHN [PEK]'
|
||||
]
|
||||
],
|
||||
'weight' => '0.5 K',
|
||||
];
|
||||
$expectedTrackingDataB = [
|
||||
'carrier' => 'dhl',
|
||||
'carrier_title' => 'DHL',
|
||||
'tracking' => 4781585060,
|
||||
'service' => 'NOT RESTRICTED FOR TRANSPORT,',
|
||||
'progressdetail' => [
|
||||
[
|
||||
'activity' => 'SD Shipment information received',
|
||||
'deliverydate' => '2017-12-24',
|
||||
'deliverytime' => '13:35:00',
|
||||
'deliverylocation' => 'HONG KONG-HKG [HKG]'
|
||||
]
|
||||
],
|
||||
'weight' => '2.0 K',
|
||||
];
|
||||
$expectedTrackingDataC = [
|
||||
'carrier' => 'dhl',
|
||||
'carrier_title' => 'DHL',
|
||||
'tracking' => 5702254250,
|
||||
'service' => 'CD',
|
||||
'progressdetail' => [
|
||||
[
|
||||
'activity' => 'SD Shipment information received',
|
||||
'deliverydate' => '2017-12-24',
|
||||
'deliverytime' => '04:12:00',
|
||||
'deliverylocation' => 'BIRMINGHAM-GBR [BHX]'
|
||||
]
|
||||
],
|
||||
'weight' => '0.12 K',
|
||||
];
|
||||
$expectedTrackingDataD = [
|
||||
'carrier' => 'dhl',
|
||||
'carrier_title' => 'DHL',
|
||||
'tracking' => 4781585060,
|
||||
'error_message' => __('Unable to retrieve tracking')
|
||||
];
|
||||
$expectedTrackingDataE = [
|
||||
'carrier' => 'dhl',
|
||||
'carrier_title' => 'DHL',
|
||||
'tracking' => 111,
|
||||
'error_message' => __(
|
||||
'Error #%1 : %2',
|
||||
'111',
|
||||
' Error Parsing incoming request XML
|
||||
Error: The content of element type
|
||||
"ShipperReference" must match
|
||||
"(ReferenceID,ReferenceType?)". at line
|
||||
16, column 22'
|
||||
)
|
||||
];
|
||||
return [
|
||||
'multi-AWB' => [
|
||||
['4781584780', '4781585060', '5702254250'],
|
||||
$multiAWBResponseXml,
|
||||
[$expectedTrackingDataA, $expectedTrackingDataB, $expectedTrackingDataC],
|
||||
$expectedMultiAWBRequestXml
|
||||
],
|
||||
'single-AWB' => [
|
||||
['4781585060'],
|
||||
$singleAWBResponseXml,
|
||||
[$expectedTrackingDataB],
|
||||
$expectedSingleAWBRequestXml
|
||||
],
|
||||
'single-AWB-no-data' => [['4781585061'], $singleNoDataResponseXml, [$expectedTrackingDataD]],
|
||||
'failed-response' => [['4781585060-failed'], $failedResponseXml, [$expectedTrackingDataE]]
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Assert request
|
||||
*
|
||||
* @param string $expectedRequestXml
|
||||
* @param string $requestXml
|
||||
*/
|
||||
private function assertRequest(string $expectedRequestXml, string $requestXml): void
|
||||
{
|
||||
$expectedRequestElement = new Element($expectedRequestXml);
|
||||
$requestElement = new Element($requestXml);
|
||||
$requestMessageTime = $requestElement->Request->ServiceHeader->MessageTime->__toString();
|
||||
$this->assertEquals(
|
||||
1,
|
||||
preg_match("/\d{4}\-\d{2}\-\d{2}T\d{2}\:\d{2}\:\d{2}\+\d{2}\:\d{2}/", $requestMessageTime)
|
||||
);
|
||||
$expectedRequestElement->Request->ServiceHeader->MessageTime = $requestMessageTime;
|
||||
$messageReference = $requestElement->Request->ServiceHeader->MessageReference->__toString();
|
||||
$this->assertStringStartsWith('MAGE_TRCK_', $messageReference);
|
||||
$this->assertGreaterThanOrEqual(28, strlen($messageReference));
|
||||
$this->assertLessThanOrEqual(32, strlen($messageReference));
|
||||
$requestElement->Request->ServiceHeader->MessageReference = 'MAGE_TRCK_28TO32_Char_CHECKED';
|
||||
$this->assertXmlStringEqualsXmlString($expectedRequestElement->asXML(), $requestElement->asXML());
|
||||
}
|
||||
|
||||
/**
|
||||
* Assert tracking
|
||||
*
|
||||
* @param array|null $expectedTrackingData
|
||||
* @param Status[]|null $trackingResults
|
||||
* @return void
|
||||
*/
|
||||
private function assertTrackingResult($expectedTrackingData, $trackingResults): void
|
||||
{
|
||||
if (null === $expectedTrackingData) {
|
||||
$this->assertNull($trackingResults);
|
||||
} else {
|
||||
$ctr = 0;
|
||||
foreach ($trackingResults as $trackingResult) {
|
||||
$this->assertEquals($expectedTrackingData[$ctr++], $trackingResult->getData());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test sending shipping requests.
|
||||
*
|
||||
* @magentoConfigFixture default_store carriers/dhl/id some ID
|
||||
* @magentoConfigFixture default_store carriers/dhl/password some password
|
||||
* @magentoConfigFixture default_store carriers/dhl/account 1234567890
|
||||
* @magentoConfigFixture default_store carriers/dhl/gateway_url https://xmlpi-ea.dhl.com/XMLShippingServlet
|
||||
* @magentoConfigFixture default_store carriers/dhl/content_type N
|
||||
* @magentoConfigFixture default_store carriers/dhl/nondoc_methods 1,3,4,8,P,Q,E,F,H,J,M,V,Y
|
||||
* @magentoConfigFixture default_store carriers/dhl/unit_of_measure C
|
||||
* @param string $origCountryId
|
||||
* @param string $expectedRegionCode
|
||||
* @param string $destCountryId
|
||||
* @param bool|null $isProductNameContainsSpecialChars
|
||||
* @return void
|
||||
* @dataProvider requestToShipmentDataProvider
|
||||
*/
|
||||
public function testRequestToShip(
|
||||
string $origCountryId,
|
||||
string $expectedRegionCode,
|
||||
string $destCountryId,
|
||||
bool $isProductNameContainsSpecialChars = false
|
||||
): void {
|
||||
$this->config->setValue(
|
||||
'shipping/origin/country_id',
|
||||
$origCountryId,
|
||||
'store',
|
||||
null
|
||||
);
|
||||
$convmap = [0x80, 0x10FFFF, 0, 0x1FFFFF];
|
||||
$content = mb_encode_numericentity(
|
||||
file_get_contents(__DIR__ . '/../_files/response_shipping_label.xml'),
|
||||
$convmap,
|
||||
'UTF-8'
|
||||
);
|
||||
//phpcs:disable Magento2.Functions.DiscouragedFunction
|
||||
$this->httpClient->nextResponses(
|
||||
[
|
||||
new Response(
|
||||
200,
|
||||
[],
|
||||
$content
|
||||
)
|
||||
]
|
||||
);
|
||||
$productName = $isProductNameContainsSpecialChars ? self::PRODUCT_NAME_SPECIAL_CHARS : 'item_name';
|
||||
|
||||
//phpcs:enable Magento2.Functions.DiscouragedFunction
|
||||
$request = new Request(
|
||||
[
|
||||
'packages' => [
|
||||
'package' => [
|
||||
'params' => [
|
||||
'width' => '3',
|
||||
'length' => '3',
|
||||
'height' => '3',
|
||||
'dimension_units' => 'CENTIMETER',
|
||||
'weight_units' => 'KILOGRAM',
|
||||
'weight' => '0.454000000001',
|
||||
'customs_value' => '10.00',
|
||||
'container' => Carrier::DHL_CONTENT_TYPE_NON_DOC,
|
||||
],
|
||||
'items' => [
|
||||
'item1' => [
|
||||
'name' => $productName,
|
||||
'qty' => 1,
|
||||
'weight' => '0.454000000001',
|
||||
'price' => '10.00',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
'orig_country_id' => $origCountryId,
|
||||
'dest_country_id' => $destCountryId,
|
||||
'shipper_address_country_code' => $origCountryId,
|
||||
'recipient_address_country_code' => $destCountryId,
|
||||
'package_weight' => '0.454000000001',
|
||||
'free_method_weight' => '0.454000000001',
|
||||
'recipient_address_street_1' => '15099 Some Blvd',
|
||||
'shipper_address_street_1' => '4956 Some Way',
|
||||
'order_shipment' => new DataObject(
|
||||
[
|
||||
'order' => new DataObject(
|
||||
[
|
||||
'subtotal' => '10.00'
|
||||
]
|
||||
)
|
||||
]
|
||||
)
|
||||
]
|
||||
);
|
||||
|
||||
//Generating labels
|
||||
$labels = $this->dhlCarrier->requestToShipment($request);
|
||||
$this->assertNotEmpty($labels);
|
||||
$this->assertNotEmpty($labels->getInfo());
|
||||
$request = $this->httpClient->getLastRequest()->getBody();
|
||||
$requestElement = new Element($request);
|
||||
$messageReference = $requestElement->Request->ServiceHeader->MessageReference->__toString();
|
||||
$this->assertStringStartsWith('MAGE_SHIP_', $messageReference);
|
||||
$this->assertGreaterThanOrEqual(28, strlen($messageReference));
|
||||
$this->assertLessThanOrEqual(32, strlen($messageReference));
|
||||
$requestElement->Request->ServiceHeader->MessageReference = 'MAGE_SHIP_28TO32_Char_CHECKED';
|
||||
$requestElement->Request->ServiceHeader->MessageTime = 'currentTime';
|
||||
$requestElement->ShipmentDetails->Date = 'currentTime';
|
||||
|
||||
$expectedLabelRequest = $this->getExpectedLabelRequestXml(
|
||||
$origCountryId,
|
||||
$destCountryId,
|
||||
$expectedRegionCode,
|
||||
$isProductNameContainsSpecialChars
|
||||
);
|
||||
|
||||
$this->assertXmlStringEqualsXmlString($expectedLabelRequest, $requestElement->asXML());
|
||||
}
|
||||
|
||||
/**
|
||||
* Cases with different countries.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function requestToShipmentDataProvider(): array
|
||||
{
|
||||
return [
|
||||
[
|
||||
'GB', 'EU', 'US'
|
||||
],
|
||||
[
|
||||
'SG', 'AP', 'US'
|
||||
],
|
||||
[
|
||||
'DE', 'EU', 'DE'
|
||||
],
|
||||
[
|
||||
'GB', 'EU', 'US', true
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate expected labels request XML.
|
||||
*
|
||||
* @param string $origCountryId
|
||||
* @param string $destCountryId
|
||||
* @param string $regionCode
|
||||
* @param bool $isProductNameContainsSpecialChars
|
||||
* @return string
|
||||
*/
|
||||
private function getExpectedLabelRequestXml(
|
||||
string $origCountryId,
|
||||
string $destCountryId,
|
||||
string $regionCode,
|
||||
bool $isProductNameContainsSpecialChars
|
||||
): string {
|
||||
$countryNames = [
|
||||
'US' => 'United States Of America',
|
||||
'SG' => 'Singapore',
|
||||
'GB' => 'United Kingdom',
|
||||
'DE' => 'Germany',
|
||||
];
|
||||
$requestXmlPath = $origCountryId == $destCountryId
|
||||
? '/../_files/domestic_shipment_request.xml'
|
||||
: '/../_files/shipment_request.xml';
|
||||
|
||||
// phpcs:ignore Magento2.Functions.DiscouragedFunction
|
||||
$expectedRequestElement = new ShippingElement(file_get_contents(__DIR__ . $requestXmlPath));
|
||||
|
||||
$expectedRequestElement->Request->MetaData->SoftwareVersion = $this->buildSoftwareVersion();
|
||||
$expectedRequestElement->Consignee->CountryCode = $destCountryId;
|
||||
$expectedRequestElement->Consignee->CountryName = $countryNames[$destCountryId];
|
||||
$expectedRequestElement->Shipper->CountryCode = $origCountryId;
|
||||
$expectedRequestElement->Shipper->CountryName = $countryNames[$origCountryId];
|
||||
$expectedRequestElement->RegionCode = $regionCode;
|
||||
|
||||
if ($origCountryId !== $destCountryId) {
|
||||
$expectedRequestElement->ExportDeclaration->ExportLineItem->ManufactureCountryCode = $origCountryId;
|
||||
}
|
||||
|
||||
if ($isProductNameContainsSpecialChars) {
|
||||
$expectedRequestElement->ShipmentDetails->Pieces->Piece->PieceContents = self::PRODUCT_NAME_SPECIAL_CHARS;
|
||||
$expectedRequestElement->ExportDeclaration->ExportLineItem->Description = self::PRODUCT_NAME_SPECIAL_CHARS;
|
||||
}
|
||||
|
||||
return $expectedRequestElement->asXML();
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds a string to be used as the request SoftwareVersion.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function buildSoftwareVersion(): string
|
||||
{
|
||||
return substr($this->productMetadata->getVersion(), 0, 10);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests that valid rates are returned when sending a quotes request.
|
||||
*
|
||||
* @magentoConfigFixture default_store carriers/dhl/active 1
|
||||
* @magentoConfigFixture default_store carriers/dhl/id some ID
|
||||
* @magentoConfigFixture default_store carriers/dhl/shipment_days Mon,Tue,Wed,Thu,Fri,Sat
|
||||
* @magentoConfigFixture default_store carriers/dhl/intl_shipment_days Mon,Tue,Wed,Thu,Fri,Sat
|
||||
* @magentoConfigFixture default_store carriers/dhl/allowed_methods IE
|
||||
* @magentoConfigFixture default_store carriers/dhl/international_service IE
|
||||
* @magentoConfigFixture default_store carriers/dhl/gateway_url https://xmlpi-ea.dhl.com/XMLShippingServlet
|
||||
* @magentoConfigFixture default_store carriers/dhl/id some ID
|
||||
* @magentoConfigFixture default_store carriers/dhl/password some password
|
||||
* @magentoConfigFixture default_store carriers/dhl/content_type N
|
||||
* @magentoConfigFixture default_store carriers/dhl/nondoc_methods 1,3,4,8,P,Q,E,F,H,J,M,V,Y
|
||||
* @magentoConfigFixture default_store carriers/dhl/showmethod' => 1,
|
||||
* @magentoConfigFixture default_store carriers/dhl/title DHL Title
|
||||
* @magentoConfigFixture default_store carriers/dhl/specificerrmsg dhl error message
|
||||
* @magentoConfigFixture default_store carriers/dhl/unit_of_measure K
|
||||
* @magentoConfigFixture default_store carriers/dhl/size 1
|
||||
* @magentoConfigFixture default_store carriers/dhl/height 1.6
|
||||
* @magentoConfigFixture default_store carriers/dhl/width 1.6
|
||||
* @magentoConfigFixture default_store carriers/dhl/depth 1.6
|
||||
* @magentoConfigFixture default_store carriers/dhl/debug 1
|
||||
* @magentoConfigFixture default_store shipping/origin/country_id GB
|
||||
*/
|
||||
public function testCollectRates()
|
||||
{
|
||||
$this->setNextResponse(__DIR__ . '/../_files/dhl_quote_response.xml');
|
||||
$request = $this->createRequest();
|
||||
$expectedRates = [
|
||||
['carrier' => 'dhl', 'carrier_title' => 'DHL Title', 'cost' => 45.85, 'method' => 'E', 'price' => 45.85],
|
||||
['carrier' => 'dhl', 'carrier_title' => 'DHL Title', 'cost' => 35.26, 'method' => 'Q', 'price' => 35.26],
|
||||
['carrier' => 'dhl', 'carrier_title' => 'DHL Title', 'cost' => 37.38, 'method' => 'Y', 'price' => 37.38],
|
||||
['carrier' => 'dhl', 'carrier_title' => 'DHL Title', 'cost' => 35.26, 'method' => 'P', 'price' => 35.26]
|
||||
];
|
||||
|
||||
$actualRates = $this->dhlCarrier->collectRates($request)->getAllRates();
|
||||
|
||||
self::assertEquals(count($expectedRates), count($actualRates));
|
||||
foreach ($actualRates as $i => $actualRate) {
|
||||
$actualRate = $actualRate->getData();
|
||||
unset($actualRate['method_title']);
|
||||
self::assertEquals($expectedRates[$i], $actualRate);
|
||||
}
|
||||
$requestXml = $this->httpClient->getLastRequest()->getBody();
|
||||
self::assertStringContainsString('<Weight>18.223</Weight>', $requestXml);
|
||||
self::assertStringContainsString('<Height>0.63</Height>', $requestXml);
|
||||
self::assertStringContainsString('<Width>0.63</Width>', $requestXml);
|
||||
self::assertStringContainsString('<Depth>0.63</Depth>', $requestXml);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests that quotes request doesn't contain dimensions when it shouldn't.
|
||||
*
|
||||
* @param string|null $size
|
||||
* @param string|null $height
|
||||
* @param string|null $width
|
||||
* @param string|null $depth
|
||||
* @magentoConfigFixture default_store carriers/dhl/active 1
|
||||
* @dataProvider collectRatesWithoutDimensionsDataProvider
|
||||
*/
|
||||
public function testCollectRatesWithoutDimensions(?string $size, ?string $height, ?string $width, ?string $depth)
|
||||
{
|
||||
$this->setDhlConfig(['size' => $size, 'height' => $height, 'width' => $width, 'depth' => $depth]);
|
||||
|
||||
$request = $this->createRequest();
|
||||
$this->dhlCarrier = Bootstrap::getObjectManager()->create(Carrier::class);
|
||||
$this->dhlCarrier->collectRates($request)->getAllRates();
|
||||
|
||||
$requestXml = $this->httpClient->getLastRequest()->getBody();
|
||||
$this->assertStringNotContainsString('<Width>', $requestXml);
|
||||
$this->assertStringNotContainsString('<Height>', $requestXml);
|
||||
$this->assertStringNotContainsString('<Depth>', $requestXml);
|
||||
|
||||
$this->config->reinit();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get carriers rates if has HttpException.
|
||||
*
|
||||
* @magentoConfigFixture default_store carriers/dhl/active 1
|
||||
*/
|
||||
public function testGetRatesWithHttpException(): void
|
||||
{
|
||||
$this->setDhlConfig(['showmethod' => 1]);
|
||||
$deferredResponse = $this->getMockBuilder(HttpResponseDeferredInterface::class)
|
||||
->onlyMethods(['get'])
|
||||
->getMockForAbstractClass();
|
||||
$exception = new HttpException('Exception message');
|
||||
$deferredResponse->method('get')->willThrowException($exception);
|
||||
$this->httpClient->setDeferredResponseMock($deferredResponse);
|
||||
$request = $this->createRequest();
|
||||
$this->dhlCarrier = Bootstrap::getObjectManager()->create(Carrier::class);
|
||||
$resultRate = $this->dhlCarrier->collectRates($request)->getAllRates()[0];
|
||||
$error = Bootstrap::getObjectManager()->get(Error::class);
|
||||
$error->setCarrier('dhl');
|
||||
$error->setCarrierTitle($this->dhlCarrier->getConfigData('title'));
|
||||
$error->setErrorMessage($this->dhlCarrier->getConfigData('specificerrmsg'));
|
||||
|
||||
$this->assertEquals($error, $resultRate);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function collectRatesWithoutDimensionsDataProvider()
|
||||
{
|
||||
return [
|
||||
['size' => '0', 'height' => '1.1', 'width' => '0.6', 'depth' => '0.7'],
|
||||
['size' => '1', 'height' => '', 'width' => '', 'depth' => ''],
|
||||
['size' => null, 'height' => '1.1', 'width' => '0.6', 'depth' => '0.7'],
|
||||
['size' => '1', 'height' => '1', 'width' => '', 'depth' => ''],
|
||||
['size' => null, 'height' => null, 'width' => null, 'depth' => null],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets DHL config value.
|
||||
*
|
||||
* @param array $params
|
||||
* @return void
|
||||
*/
|
||||
private function setDhlConfig(array $params)
|
||||
{
|
||||
foreach ($params as $name => $val) {
|
||||
if ($val !== null) {
|
||||
$this->config->setValue(
|
||||
'carriers/dhl/' . $name,
|
||||
$val,
|
||||
ScopeInterface::SCOPE_STORE
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests that the free rate is returned when sending a quotes request
|
||||
*
|
||||
* @param array $addRequestData
|
||||
* @param bool $freeShippingExpects
|
||||
* @magentoConfigFixture default_store carriers/dhl/active 1
|
||||
* @magentoConfigFixture default_store carriers/dhl/id some ID
|
||||
* @magentoConfigFixture default_store carriers/dhl/shipment_days Mon,Tue,Wed,Thu,Fri,Sat
|
||||
* @magentoConfigFixture default_store carriers/dhl/intl_shipment_days Mon,Tue,Wed,Thu,Fri,Sat
|
||||
* @magentoConfigFixture default_store carriers/dhl/allowed_methods IE
|
||||
* @magentoConfigFixture default_store carriers/dhl/international_service IE
|
||||
* @magentoConfigFixture default_store carriers/dhl/gateway_url https://xmlpi-ea.dhl.com/XMLShippingServlet
|
||||
* @magentoConfigFixture default_store carriers/dhl/id some ID
|
||||
* @magentoConfigFixture default_store carriers/dhl/password some password
|
||||
* @magentoConfigFixture default_store carriers/dhl/content_type N
|
||||
* @magentoConfigFixture default_store carriers/dhl/nondoc_methods 1,3,4,8,P,Q,E,F,H,J,M,V,Y
|
||||
* @magentoConfigFixture default_store carriers/dhl/showmethod' => 1,
|
||||
* @magentoConfigFixture default_store carriers/dhl/title DHL Title
|
||||
* @magentoConfigFixture default_store carriers/dhl/specificerrmsg dhl error message
|
||||
* @magentoConfigFixture default_store carriers/dhl/unit_of_measure K
|
||||
* @magentoConfigFixture default_store carriers/dhl/size 1
|
||||
* @magentoConfigFixture default_store carriers/dhl/height 1.6
|
||||
* @magentoConfigFixture default_store carriers/dhl/width 1.6
|
||||
* @magentoConfigFixture default_store carriers/dhl/depth 1.6
|
||||
* @magentoConfigFixture default_store carriers/dhl/debug 1
|
||||
* @magentoConfigFixture default_store carriers/dhl/free_method_nondoc P
|
||||
* @magentoConfigFixture default_store carriers/dhl/free_shipping_enable 1
|
||||
* @magentoConfigFixture default_store carriers/dhl/free_shipping_subtotal 25
|
||||
* @magentoConfigFixture default_store shipping/origin/country_id GB
|
||||
* @magentoAppIsolation enabled
|
||||
* @dataProvider collectRatesWithFreeShippingDataProvider
|
||||
*/
|
||||
public function testCollectRatesWithFreeShipping(array $addRequestData, bool $freeShippingExpects): void
|
||||
{
|
||||
$this->setNextResponse(__DIR__ . '/../_files/dhl_quote_response.xml');
|
||||
$request = $this->createRequest($addRequestData);
|
||||
|
||||
$actualRates = $this->dhlCarrier->collectRates($request)->getAllRates();
|
||||
$freeRateExists = false;
|
||||
foreach ($actualRates as $actualRate) {
|
||||
$actualRate = $actualRate->getData();
|
||||
if ($actualRate['method'] === 'P' && (float)$actualRate['price'] === 0.0) {
|
||||
$freeRateExists = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
self::assertEquals($freeShippingExpects, $freeRateExists);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function collectRatesWithFreeShippingDataProvider(): array
|
||||
{
|
||||
return [
|
||||
[
|
||||
['package_value' => 25, 'package_value_with_discount' => 22],
|
||||
false
|
||||
],
|
||||
[
|
||||
['package_value' => 25, 'package_value_with_discount' => 25],
|
||||
true
|
||||
],
|
||||
[
|
||||
['package_value' => 28, 'package_value_with_discount' => 25],
|
||||
true
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns request data.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private function getRequestData(): array
|
||||
{
|
||||
return [
|
||||
'dest_country_id' => 'DE',
|
||||
'dest_region_id' => '82',
|
||||
'dest_region_code' => 'BER',
|
||||
'dest_street' => 'Turmstraße 17',
|
||||
'dest_city' => 'Berlin',
|
||||
'dest_postcode' => '10559',
|
||||
'dest_postal' => '10559',
|
||||
'package_value' => '5',
|
||||
'package_value_with_discount' => '5',
|
||||
'package_weight' => '8.2657',
|
||||
'package_qty' => '1',
|
||||
'package_physical_value' => '5',
|
||||
'free_method_weight' => '5',
|
||||
'store_id' => '1',
|
||||
'website_id' => '1',
|
||||
'free_shipping' => '0',
|
||||
'limit_carrier' => null,
|
||||
'base_subtotal_incl_tax' => '5',
|
||||
'orig_country_id' => 'US',
|
||||
'orig_region_id' => '12',
|
||||
'orig_city' => 'Fremont',
|
||||
'orig_postcode' => '94538',
|
||||
'dhl_id' => 'MAGEN_8501',
|
||||
'dhl_password' => 'QR2GO1U74X',
|
||||
'dhl_account' => '799909537',
|
||||
'dhl_shipping_intl_key' => '54233F2B2C4E5C4B4C5E5A59565530554B405641475D5659',
|
||||
'girth' => null,
|
||||
'height' => null,
|
||||
'length' => null,
|
||||
'width' => null,
|
||||
'weight' => 1,
|
||||
'dhl_shipment_type' => 'P',
|
||||
'dhl_duitable' => 0,
|
||||
'dhl_duty_payment_type' => 'R',
|
||||
'dhl_content_desc' => 'Big Box',
|
||||
'limit_method' => 'IE',
|
||||
'ship_date' => '2014-01-09',
|
||||
'action' => 'RateEstimate',
|
||||
'all_items' => [],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Set next response content from file
|
||||
*
|
||||
* @param string $file
|
||||
*/
|
||||
private function setNextResponse(string $file): void
|
||||
{
|
||||
//phpcs:disable Magento2.Functions.DiscouragedFunction
|
||||
$response = new Response(
|
||||
200,
|
||||
[],
|
||||
file_get_contents($file)
|
||||
);
|
||||
//phpcs:enable Magento2.Functions.DiscouragedFunction
|
||||
$this->httpClient->nextResponses(
|
||||
array_fill(0, Carrier::UNAVAILABLE_DATE_LOOK_FORWARD + 1, $response)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create Rate Request
|
||||
*
|
||||
* @param array $addRequestData
|
||||
* @return RateRequest
|
||||
*/
|
||||
private function createRequest(array $addRequestData = []): RateRequest
|
||||
{
|
||||
$requestData = $this->getRequestData();
|
||||
if (!empty($addRequestData)) {
|
||||
$requestData = array_merge($requestData, $addRequestData);
|
||||
}
|
||||
|
||||
return Bootstrap::getObjectManager()->create(RateRequest::class, ['data' => $requestData]);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<req:TrackingResponse xmlns:req="http://www.dhl.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dhl.com TrackingResponse.xsd">
|
||||
<Response>
|
||||
<ServiceHeader>
|
||||
<MessageTime>2018-02-27T12:59:34+01:00</MessageTime>
|
||||
<MessageReference>1234567890123456789012345678</MessageReference>
|
||||
<SiteID>CustomerSiteID</SiteID>
|
||||
</ServiceHeader>
|
||||
</Response>
|
||||
<AWBInfo>
|
||||
<AWBNumber>4781585060</AWBNumber>
|
||||
<Status>
|
||||
<ActionStatus>No Shipments Found</ActionStatus>
|
||||
<Condition>
|
||||
<ConditionCode>209</ConditionCode>
|
||||
<ConditionData>No Shipments Found for AWBNumber 6017300993</ConditionData>
|
||||
</Condition>
|
||||
</Status>
|
||||
</AWBInfo>
|
||||
<LanguageCode>String</LanguageCode>
|
||||
</req:TrackingResponse>
|
||||
<!-- ServiceInvocationId:20180227125934_5793_74fbd9e1-a8b0-4f6a-a326-26aae979e5f0 -->
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<req:ShipmentTrackingErrorResponse xmlns:req="http://www.dhl.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dhl.com track-err-res.xsd">
|
||||
<Response>
|
||||
<ServiceHeader>
|
||||
<MessageTime>2018-02-27T12:55:05+01:00</MessageTime>
|
||||
</ServiceHeader>
|
||||
<Status>
|
||||
<ActionStatus>Failure</ActionStatus>
|
||||
<Condition>
|
||||
<ConditionCode>111</ConditionCode>
|
||||
<ConditionData> Error Parsing incoming request XML
|
||||
Error: The content of element type
|
||||
"ShipperReference" must match
|
||||
"(ReferenceID,ReferenceType?)". at line
|
||||
16, column 22</ConditionData>
|
||||
</Condition>
|
||||
</Status>
|
||||
</Response>
|
||||
</req:ShipmentTrackingErrorResponse>
|
||||
<!-- ServiceInvocationId:20180227125505_5793_2008671c-9292-4790-87b6-b02ccdf913db -->
|
||||
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<req:KnownTrackingRequest xmlns:req="http://www.dhl.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dhl.com TrackingRequestKnown-1.0.xsd" schemaVersion="1.0">
|
||||
<Request>
|
||||
<ServiceHeader>
|
||||
<MessageTime>2002-06-25T11:28:56-08:00</MessageTime>
|
||||
<MessageReference>MAGE_TRCK_28TO32_Char_CHECKED</MessageReference>
|
||||
<SiteID>CustomerSiteID</SiteID>
|
||||
<Password>CustomerPassword</Password>
|
||||
</ServiceHeader>
|
||||
</Request>
|
||||
<LanguageCode>EN</LanguageCode>
|
||||
<AWBNumber>4781584780</AWBNumber>
|
||||
<AWBNumber>4781585060</AWBNumber>
|
||||
<AWBNumber>5702254250</AWBNumber>
|
||||
<LevelOfDetails>ALL_CHECK_POINTS</LevelOfDetails>
|
||||
</req:KnownTrackingRequest>
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<req:KnownTrackingRequest xmlns:req="http://www.dhl.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dhl.com TrackingRequestKnown-1.0.xsd" schemaVersion="1.0">
|
||||
<Request>
|
||||
<ServiceHeader>
|
||||
<MessageTime>2002-06-25T11:28:56-08:00</MessageTime>
|
||||
<MessageReference>MAGE_TRCK_28TO32_Char_CHECKED</MessageReference>
|
||||
<SiteID>CustomerSiteID</SiteID>
|
||||
<Password>CustomerPassword</Password>
|
||||
</ServiceHeader>
|
||||
</Request>
|
||||
<LanguageCode>EN</LanguageCode>
|
||||
<AWBNumber>4781585060</AWBNumber>
|
||||
<LevelOfDetails>ALL_CHECK_POINTS</LevelOfDetails>
|
||||
</req:KnownTrackingRequest>
|
||||
@@ -0,0 +1,174 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<req:TrackingResponse xmlns:req="http://www.dhl.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dhl.com TrackingResponse.xsd">
|
||||
<Response>
|
||||
<ServiceHeader>
|
||||
<MessageTime>2018-02-27T12:43:44+01:00</MessageTime>
|
||||
<MessageReference>1234567890123456789012345678</MessageReference>
|
||||
<SiteID>CustomerSiteID</SiteID>
|
||||
</ServiceHeader>
|
||||
</Response>
|
||||
<AWBInfo>
|
||||
<AWBNumber>4781584780</AWBNumber>
|
||||
<Status>
|
||||
<ActionStatus>success</ActionStatus>
|
||||
</Status>
|
||||
<ShipmentInfo>
|
||||
<OriginServiceArea>
|
||||
<ServiceAreaCode>PEK</ServiceAreaCode>
|
||||
<Description>BEIJING-CHN</Description>
|
||||
</OriginServiceArea>
|
||||
<DestinationServiceArea>
|
||||
<ServiceAreaCode>PHL</ServiceAreaCode>
|
||||
<Description>WEST PHILADELPHIA,PA-USA</Description>
|
||||
</DestinationServiceArea>
|
||||
<ShipperName>THE EXP HIGH SCH ATT TO BNU</ShipperName>
|
||||
<ShipperAccountNumber>123456789</ShipperAccountNumber>
|
||||
<ConsigneeName>HAVEFORD COLLEGE</ConsigneeName>
|
||||
<ShipmentDate>2017-12-25T14:38:00</ShipmentDate>
|
||||
<Pieces>1</Pieces>
|
||||
<Weight>0.5</Weight>
|
||||
<WeightUnit>K</WeightUnit>
|
||||
<GlobalProductCode>D</GlobalProductCode>
|
||||
<ShipmentDesc>DOCUMENT</ShipmentDesc>
|
||||
<DlvyNotificationFlag>Y</DlvyNotificationFlag>
|
||||
<Shipper>
|
||||
<City>BEIJING</City>
|
||||
<PostalCode>100032</PostalCode>
|
||||
<CountryCode>CN</CountryCode>
|
||||
</Shipper>
|
||||
<Consignee>
|
||||
<City>HAVERFORD</City>
|
||||
<DivisionCode>PA</DivisionCode>
|
||||
<PostalCode>19041</PostalCode>
|
||||
<CountryCode>US</CountryCode>
|
||||
</Consignee>
|
||||
<ShipperReference>
|
||||
<ReferenceID>2469</ReferenceID>
|
||||
</ShipperReference>
|
||||
<ShipmentEvent>
|
||||
<Date>2017-12-25</Date>
|
||||
<Time>14:38:00</Time>
|
||||
<ServiceEvent>
|
||||
<EventCode>SD</EventCode>
|
||||
<Description>Shipment information received</Description>
|
||||
</ServiceEvent>
|
||||
<Signatory/>
|
||||
<ServiceArea>
|
||||
<ServiceAreaCode>PEK</ServiceAreaCode>
|
||||
<Description>BEIJING-CHN</Description>
|
||||
</ServiceArea>
|
||||
</ShipmentEvent>
|
||||
</ShipmentInfo>
|
||||
</AWBInfo>
|
||||
<AWBInfo>
|
||||
<AWBNumber>4781585060</AWBNumber>
|
||||
<Status>
|
||||
<ActionStatus>success</ActionStatus>
|
||||
</Status>
|
||||
<ShipmentInfo>
|
||||
<OriginServiceArea>
|
||||
<ServiceAreaCode>HKG</ServiceAreaCode>
|
||||
<Description>HONG KONG-HKG</Description>
|
||||
</OriginServiceArea>
|
||||
<DestinationServiceArea>
|
||||
<ServiceAreaCode>HKG</ServiceAreaCode>
|
||||
<Description>HONG KONG-HKG</Description>
|
||||
</DestinationServiceArea>
|
||||
<ShipperName>NET-A-PORTER</ShipperName>
|
||||
<ShipperAccountNumber>123456789</ShipperAccountNumber>
|
||||
<ConsigneeName>NICOLE LI</ConsigneeName>
|
||||
<ShipmentDate>2017-12-24T13:35:00</ShipmentDate>
|
||||
<Pieces>1</Pieces>
|
||||
<Weight>2.0</Weight>
|
||||
<WeightUnit>K</WeightUnit>
|
||||
<GlobalProductCode>N</GlobalProductCode>
|
||||
<ShipmentDesc>NOT RESTRICTED FOR TRANSPORT,</ShipmentDesc>
|
||||
<DlvyNotificationFlag>Y</DlvyNotificationFlag>
|
||||
<Shipper>
|
||||
<City>HONG KONG</City>
|
||||
<CountryCode>HK</CountryCode>
|
||||
</Shipper>
|
||||
<Consignee>
|
||||
<City>HONG KONG</City>
|
||||
<DivisionCode>CH</DivisionCode>
|
||||
<CountryCode>HK</CountryCode>
|
||||
</Consignee>
|
||||
<ShipperReference>
|
||||
<ReferenceID>1060571</ReferenceID>
|
||||
</ShipperReference>
|
||||
<ShipmentEvent>
|
||||
<Date>2017-12-24</Date>
|
||||
<Time>13:35:00</Time>
|
||||
<ServiceEvent>
|
||||
<EventCode>SD</EventCode>
|
||||
<Description>Shipment information received</Description>
|
||||
</ServiceEvent>
|
||||
<Signatory/>
|
||||
<ServiceArea>
|
||||
<ServiceAreaCode>HKG</ServiceAreaCode>
|
||||
<Description>HONG KONG-HKG</Description>
|
||||
</ServiceArea>
|
||||
</ShipmentEvent>
|
||||
</ShipmentInfo>
|
||||
</AWBInfo>
|
||||
<AWBInfo>
|
||||
<AWBNumber>5702254250</AWBNumber>
|
||||
<Status>
|
||||
<ActionStatus>success</ActionStatus>
|
||||
</Status>
|
||||
<ShipmentInfo>
|
||||
<OriginServiceArea>
|
||||
<ServiceAreaCode>BHX</ServiceAreaCode>
|
||||
<Description>BIRMINGHAM-GBR</Description>
|
||||
</OriginServiceArea>
|
||||
<DestinationServiceArea>
|
||||
<ServiceAreaCode>AOI</ServiceAreaCode>
|
||||
<Description>ANCONA-ITA</Description>
|
||||
</DestinationServiceArea>
|
||||
<ShipperName>AMAZON EU SARL</ShipperName>
|
||||
<ShipperAccountNumber>123456789</ShipperAccountNumber>
|
||||
<ConsigneeName>MATTEO LOMBO</ConsigneeName>
|
||||
<ShipmentDate>2017-12-24T04:12:00</ShipmentDate>
|
||||
<Pieces>1</Pieces>
|
||||
<Weight>0.12</Weight>
|
||||
<WeightUnit>K</WeightUnit>
|
||||
<GlobalProductCode>U</GlobalProductCode>
|
||||
<ShipmentDesc>CD</ShipmentDesc>
|
||||
<DlvyNotificationFlag>Y</DlvyNotificationFlag>
|
||||
<Shipper>
|
||||
<City>PETERBOROUGH</City>
|
||||
<PostalCode>PE2 9EN</PostalCode>
|
||||
<CountryCode>GB</CountryCode>
|
||||
</Shipper>
|
||||
<Consignee>
|
||||
<City>ORTONA</City>
|
||||
<PostalCode>66026</PostalCode>
|
||||
<CountryCode>IT</CountryCode>
|
||||
</Consignee>
|
||||
<ShipperReference>
|
||||
<ReferenceID>DGWYDy4xN_1</ReferenceID>
|
||||
</ShipperReference>
|
||||
<ShipmentEvent>
|
||||
<Date>2017-12-24</Date>
|
||||
<Time>04:12:00</Time>
|
||||
<ServiceEvent>
|
||||
<EventCode>SD</EventCode>
|
||||
<Description>Shipment information received</Description>
|
||||
</ServiceEvent>
|
||||
<Signatory/>
|
||||
<ServiceArea>
|
||||
<ServiceAreaCode>BHX</ServiceAreaCode>
|
||||
<Description>BIRMINGHAM-GBR</Description>
|
||||
</ServiceArea>
|
||||
</ShipmentEvent>
|
||||
</ShipmentInfo>
|
||||
</AWBInfo>
|
||||
<LanguageCode>EN</LanguageCode>
|
||||
</req:TrackingResponse>
|
||||
<!-- ServiceInvocationId:20180227124344_5793_23bed3d9-e792-4955-8055-9472b1b41929 -->
|
||||
@@ -0,0 +1,69 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<req:TrackingResponse xmlns:req="http://www.dhl.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dhl.com TrackingResponse.xsd">
|
||||
<Response>
|
||||
<ServiceHeader>
|
||||
<MessageTime>2018-02-27T12:27:42+01:00</MessageTime>
|
||||
<MessageReference>1234567890123456789012345678</MessageReference>
|
||||
<SiteID>CustomerSiteID</SiteID>
|
||||
</ServiceHeader>
|
||||
</Response>
|
||||
<AWBInfo>
|
||||
<AWBNumber>4781585060</AWBNumber>
|
||||
<Status>
|
||||
<ActionStatus>success</ActionStatus>
|
||||
</Status>
|
||||
<ShipmentInfo>
|
||||
<OriginServiceArea>
|
||||
<ServiceAreaCode>HKG</ServiceAreaCode>
|
||||
<Description>HONG KONG-HKG</Description>
|
||||
</OriginServiceArea>
|
||||
<DestinationServiceArea>
|
||||
<ServiceAreaCode>HKG</ServiceAreaCode>
|
||||
<Description>HONG KONG-HKG</Description>
|
||||
</DestinationServiceArea>
|
||||
<ShipperName>NET-A-PORTER</ShipperName>
|
||||
<ShipperAccountNumber>123456789</ShipperAccountNumber>
|
||||
<ConsigneeName>NICOLE LI</ConsigneeName>
|
||||
<ShipmentDate>2017-12-24T13:35:00</ShipmentDate>
|
||||
<Pieces>1</Pieces>
|
||||
<Weight>2.0</Weight>
|
||||
<WeightUnit>K</WeightUnit>
|
||||
<GlobalProductCode>N</GlobalProductCode>
|
||||
<ShipmentDesc>NOT RESTRICTED FOR TRANSPORT,</ShipmentDesc>
|
||||
<DlvyNotificationFlag>Y</DlvyNotificationFlag>
|
||||
<Shipper>
|
||||
<City>HONG KONG</City>
|
||||
<CountryCode>HK</CountryCode>
|
||||
</Shipper>
|
||||
<Consignee>
|
||||
<City>HONG KONG</City>
|
||||
<DivisionCode>CH</DivisionCode>
|
||||
<CountryCode>HK</CountryCode>
|
||||
</Consignee>
|
||||
<ShipperReference>
|
||||
<ReferenceID>1060571</ReferenceID>
|
||||
</ShipperReference>
|
||||
<ShipmentEvent>
|
||||
<Date>2017-12-24</Date>
|
||||
<Time>13:35:00</Time>
|
||||
<ServiceEvent>
|
||||
<EventCode>SD</EventCode>
|
||||
<Description>Shipment information received</Description>
|
||||
</ServiceEvent>
|
||||
<Signatory/>
|
||||
<ServiceArea>
|
||||
<ServiceAreaCode>HKG</ServiceAreaCode>
|
||||
<Description>HONG KONG-HKG</Description>
|
||||
</ServiceArea>
|
||||
</ShipmentEvent>
|
||||
</ShipmentInfo>
|
||||
</AWBInfo>
|
||||
<LanguageCode>EN</LanguageCode>
|
||||
</req:TrackingResponse>
|
||||
<!-- ServiceInvocationId:20180227122741_5793_e0f8c40e-5245-4737-ab31-323030366721 -->
|
||||
@@ -0,0 +1,530 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<res:DCTResponse xmlns:res="http://www.dhl.com"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.dhl.com DCT-Response_global-2.0.xsd">
|
||||
<GetQuoteResponse>
|
||||
<Response>
|
||||
<ServiceHeader>
|
||||
<MessageTime>2014-01-09T12:13:29.498+00:00</MessageTime>
|
||||
<SiteID>EvgeniyUSA</SiteID>
|
||||
</ServiceHeader>
|
||||
</Response>
|
||||
<BkgDetails>
|
||||
<QtdShp>
|
||||
<OriginServiceArea>
|
||||
<FacilityCode>NUQ</FacilityCode>
|
||||
<ServiceAreaCode>NUQ</ServiceAreaCode>
|
||||
</OriginServiceArea>
|
||||
<DestinationServiceArea>
|
||||
<FacilityCode>BER</FacilityCode>
|
||||
<ServiceAreaCode>BER</ServiceAreaCode>
|
||||
</DestinationServiceArea>
|
||||
<GlobalProductCode>E</GlobalProductCode>
|
||||
<LocalProductCode>E</LocalProductCode>
|
||||
<ProductShortName>EXPRESS 9:00</ProductShortName>
|
||||
<LocalProductName>EXPRESS 9:00 NONDOC</LocalProductName>
|
||||
<NetworkTypeCode>TD</NetworkTypeCode>
|
||||
<POfferedCustAgreement>N</POfferedCustAgreement>
|
||||
<TransInd>Y</TransInd>
|
||||
<PickupDate>2014-01-09</PickupDate>
|
||||
<PickupCutoffTime>PT16H15M</PickupCutoffTime>
|
||||
<BookingTime>PT15H15M</BookingTime>
|
||||
<CurrencyCode>USD</CurrencyCode>
|
||||
<ExchangeRate>1.000000</ExchangeRate>
|
||||
<WeightCharge>42.060</WeightCharge>
|
||||
<WeightChargeTax>0.000</WeightChargeTax>
|
||||
<TotalTransitDays>2</TotalTransitDays>
|
||||
<PickupPostalLocAddDays>0</PickupPostalLocAddDays>
|
||||
<DeliveryPostalLocAddDays>0</DeliveryPostalLocAddDays>
|
||||
<DeliveryDate>
|
||||
<DlvyDateTime>2014-01-13 11:59:00</DlvyDateTime>
|
||||
<DeliveryDateTimeOffset>+00:00</DeliveryDateTimeOffset>
|
||||
</DeliveryDate>
|
||||
<DeliveryTime>PT9H</DeliveryTime>
|
||||
<DimensionalWeight>2.205</DimensionalWeight>
|
||||
<WeightUnit>LB</WeightUnit>
|
||||
<PickupDayOfWeekNum>4</PickupDayOfWeekNum>
|
||||
<DestinationDayOfWeekNum>1</DestinationDayOfWeekNum>
|
||||
<QtdShpExChrg>
|
||||
<SpecialServiceType>FF</SpecialServiceType>
|
||||
<LocalServiceType>FF</LocalServiceType>
|
||||
<GlobalServiceName>FUEL SURCHARGE</GlobalServiceName>
|
||||
<LocalServiceTypeName>FUEL SURCHARGE</LocalServiceTypeName>
|
||||
<ChargeCodeType>SCH</ChargeCodeType>
|
||||
<CurrencyCode>USD</CurrencyCode>
|
||||
<ChargeValue>3.790</ChargeValue>
|
||||
<QtdSExtrChrgInAdCur>
|
||||
<ChargeValue>3.790</ChargeValue>
|
||||
<CurrencyCode>USD</CurrencyCode>
|
||||
<CurrencyRoleTypeCode>BILLC</CurrencyRoleTypeCode>
|
||||
</QtdSExtrChrgInAdCur>
|
||||
<QtdSExtrChrgInAdCur>
|
||||
<ChargeValue>3.790</ChargeValue>
|
||||
<CurrencyCode>USD</CurrencyCode>
|
||||
<CurrencyRoleTypeCode>PULCL</CurrencyRoleTypeCode>
|
||||
</QtdSExtrChrgInAdCur>
|
||||
<QtdSExtrChrgInAdCur>
|
||||
<ChargeValue>3.790</ChargeValue>
|
||||
<CurrencyCode>USD</CurrencyCode>
|
||||
<CurrencyRoleTypeCode>BASEC</CurrencyRoleTypeCode>
|
||||
</QtdSExtrChrgInAdCur>
|
||||
</QtdShpExChrg>
|
||||
<PricingDate>2014-01-09</PricingDate>
|
||||
<ShippingCharge>45.850</ShippingCharge>
|
||||
<TotalTaxAmount>0.000</TotalTaxAmount>
|
||||
<QtdSInAdCur>
|
||||
<CurrencyCode>USD</CurrencyCode>
|
||||
<CurrencyRoleTypeCode>BILLC</CurrencyRoleTypeCode>
|
||||
<WeightCharge>42.060</WeightCharge>
|
||||
<TotalAmount>45.850</TotalAmount>
|
||||
<TotalTaxAmount>0.000</TotalTaxAmount>
|
||||
<WeightChargeTax>0.000</WeightChargeTax>
|
||||
</QtdSInAdCur>
|
||||
<QtdSInAdCur>
|
||||
<CurrencyCode>USD</CurrencyCode>
|
||||
<CurrencyRoleTypeCode>PULCL</CurrencyRoleTypeCode>
|
||||
<WeightCharge>42.060</WeightCharge>
|
||||
<TotalAmount>45.850</TotalAmount>
|
||||
<TotalTaxAmount>0.000</TotalTaxAmount>
|
||||
<WeightChargeTax>0.000</WeightChargeTax>
|
||||
</QtdSInAdCur>
|
||||
<QtdSInAdCur>
|
||||
<CurrencyCode>USD</CurrencyCode>
|
||||
<CurrencyRoleTypeCode>BASEC</CurrencyRoleTypeCode>
|
||||
<WeightCharge>42.060</WeightCharge>
|
||||
<TotalAmount>45.850</TotalAmount>
|
||||
<TotalTaxAmount>0.000</TotalTaxAmount>
|
||||
<WeightChargeTax>0.000</WeightChargeTax>
|
||||
</QtdSInAdCur>
|
||||
<PickupWindowEarliestTime>09:00:00</PickupWindowEarliestTime>
|
||||
<PickupWindowLatestTime>17:00:00</PickupWindowLatestTime>
|
||||
<BookingCutoffOffset>PT1H</BookingCutoffOffset>
|
||||
</QtdShp>
|
||||
<QtdShp>
|
||||
<OriginServiceArea>
|
||||
<FacilityCode>NUQ</FacilityCode>
|
||||
<ServiceAreaCode>NUQ</ServiceAreaCode>
|
||||
</OriginServiceArea>
|
||||
<DestinationServiceArea>
|
||||
<FacilityCode>BER</FacilityCode>
|
||||
<ServiceAreaCode>BER</ServiceAreaCode>
|
||||
</DestinationServiceArea>
|
||||
<GlobalProductCode>Q</GlobalProductCode>
|
||||
<LocalProductCode>Q</LocalProductCode>
|
||||
<ProductShortName>MEDICAL EXPRESS</ProductShortName>
|
||||
<LocalProductName>MEDICAL EXPRESS</LocalProductName>
|
||||
<NetworkTypeCode>TD</NetworkTypeCode>
|
||||
<POfferedCustAgreement>Y</POfferedCustAgreement>
|
||||
<TransInd>N</TransInd>
|
||||
<PickupDate>2014-01-09</PickupDate>
|
||||
<PickupCutoffTime>PT16H15M</PickupCutoffTime>
|
||||
<BookingTime>PT15H15M</BookingTime>
|
||||
<CurrencyCode>USD</CurrencyCode>
|
||||
<ExchangeRate>1.000000</ExchangeRate>
|
||||
<WeightCharge>32.350</WeightCharge>
|
||||
<WeightChargeTax>0.000</WeightChargeTax>
|
||||
<TotalTransitDays>2</TotalTransitDays>
|
||||
<PickupPostalLocAddDays>0</PickupPostalLocAddDays>
|
||||
<DeliveryPostalLocAddDays>0</DeliveryPostalLocAddDays>
|
||||
<DeliveryDate>
|
||||
<DlvyDateTime>2014-01-13 11:59:00</DlvyDateTime>
|
||||
<DeliveryDateTimeOffset>+00:00</DeliveryDateTimeOffset>
|
||||
</DeliveryDate>
|
||||
<DeliveryTime>PT9H</DeliveryTime>
|
||||
<DimensionalWeight>2.205</DimensionalWeight>
|
||||
<WeightUnit>LB</WeightUnit>
|
||||
<PickupDayOfWeekNum>4</PickupDayOfWeekNum>
|
||||
<DestinationDayOfWeekNum>1</DestinationDayOfWeekNum>
|
||||
<QtdShpExChrg>
|
||||
<SpecialServiceType>FF</SpecialServiceType>
|
||||
<LocalServiceType>FF</LocalServiceType>
|
||||
<GlobalServiceName>FUEL SURCHARGE</GlobalServiceName>
|
||||
<LocalServiceTypeName>FUEL SURCHARGE</LocalServiceTypeName>
|
||||
<ChargeCodeType>SCH</ChargeCodeType>
|
||||
<CurrencyCode>USD</CurrencyCode>
|
||||
<ChargeValue>2.910</ChargeValue>
|
||||
<QtdSExtrChrgInAdCur>
|
||||
<ChargeValue>2.910</ChargeValue>
|
||||
<CurrencyCode>USD</CurrencyCode>
|
||||
<CurrencyRoleTypeCode>BILLC</CurrencyRoleTypeCode>
|
||||
</QtdSExtrChrgInAdCur>
|
||||
<QtdSExtrChrgInAdCur>
|
||||
<ChargeValue>2.910</ChargeValue>
|
||||
<CurrencyCode>USD</CurrencyCode>
|
||||
<CurrencyRoleTypeCode>PULCL</CurrencyRoleTypeCode>
|
||||
</QtdSExtrChrgInAdCur>
|
||||
<QtdSExtrChrgInAdCur>
|
||||
<ChargeValue>2.910</ChargeValue>
|
||||
<CurrencyCode>USD</CurrencyCode>
|
||||
<CurrencyRoleTypeCode>BASEC</CurrencyRoleTypeCode>
|
||||
</QtdSExtrChrgInAdCur>
|
||||
</QtdShpExChrg>
|
||||
<PricingDate>2014-01-09</PricingDate>
|
||||
<ShippingCharge>35.260</ShippingCharge>
|
||||
<TotalTaxAmount>0.000</TotalTaxAmount>
|
||||
<QtdSInAdCur>
|
||||
<CurrencyCode>USD</CurrencyCode>
|
||||
<CurrencyRoleTypeCode>BILLC</CurrencyRoleTypeCode>
|
||||
<WeightCharge>32.350</WeightCharge>
|
||||
<TotalAmount>35.260</TotalAmount>
|
||||
<TotalTaxAmount>0.000</TotalTaxAmount>
|
||||
<WeightChargeTax>0.000</WeightChargeTax>
|
||||
</QtdSInAdCur>
|
||||
<QtdSInAdCur>
|
||||
<CurrencyCode>USD</CurrencyCode>
|
||||
<CurrencyRoleTypeCode>PULCL</CurrencyRoleTypeCode>
|
||||
<WeightCharge>32.350</WeightCharge>
|
||||
<TotalAmount>35.260</TotalAmount>
|
||||
<TotalTaxAmount>0.000</TotalTaxAmount>
|
||||
<WeightChargeTax>0.000</WeightChargeTax>
|
||||
</QtdSInAdCur>
|
||||
<QtdSInAdCur>
|
||||
<CurrencyCode>USD</CurrencyCode>
|
||||
<CurrencyRoleTypeCode>BASEC</CurrencyRoleTypeCode>
|
||||
<WeightCharge>32.350</WeightCharge>
|
||||
<TotalAmount>35.260</TotalAmount>
|
||||
<TotalTaxAmount>0.000</TotalTaxAmount>
|
||||
<WeightChargeTax>0.000</WeightChargeTax>
|
||||
</QtdSInAdCur>
|
||||
<PickupWindowEarliestTime>09:00:00</PickupWindowEarliestTime>
|
||||
<PickupWindowLatestTime>17:00:00</PickupWindowLatestTime>
|
||||
<BookingCutoffOffset>PT1H</BookingCutoffOffset>
|
||||
</QtdShp>
|
||||
<QtdShp>
|
||||
<OriginServiceArea>
|
||||
<FacilityCode>NUQ</FacilityCode>
|
||||
<ServiceAreaCode>NUQ</ServiceAreaCode>
|
||||
</OriginServiceArea>
|
||||
<DestinationServiceArea>
|
||||
<FacilityCode>BER</FacilityCode>
|
||||
<ServiceAreaCode>BER</ServiceAreaCode>
|
||||
</DestinationServiceArea>
|
||||
<GlobalProductCode>Y</GlobalProductCode>
|
||||
<LocalProductCode>Y</LocalProductCode>
|
||||
<ProductShortName>EXPRESS 12:00</ProductShortName>
|
||||
<LocalProductName>EXPRESS 12:00 NONDOC</LocalProductName>
|
||||
<NetworkTypeCode>TD</NetworkTypeCode>
|
||||
<POfferedCustAgreement>N</POfferedCustAgreement>
|
||||
<TransInd>Y</TransInd>
|
||||
<PickupDate>2014-01-09</PickupDate>
|
||||
<PickupCutoffTime>PT16H15M</PickupCutoffTime>
|
||||
<BookingTime>PT15H15M</BookingTime>
|
||||
<CurrencyCode>USD</CurrencyCode>
|
||||
<ExchangeRate>1.000000</ExchangeRate>
|
||||
<WeightCharge>34.290</WeightCharge>
|
||||
<WeightChargeTax>0.000</WeightChargeTax>
|
||||
<TotalTransitDays>2</TotalTransitDays>
|
||||
<PickupPostalLocAddDays>0</PickupPostalLocAddDays>
|
||||
<DeliveryPostalLocAddDays>0</DeliveryPostalLocAddDays>
|
||||
<DeliveryDate>
|
||||
<DlvyDateTime>2014-01-13 11:59:00</DlvyDateTime>
|
||||
<DeliveryDateTimeOffset>+00:00</DeliveryDateTimeOffset>
|
||||
</DeliveryDate>
|
||||
<DeliveryTime>PT12H</DeliveryTime>
|
||||
<DimensionalWeight>2.205</DimensionalWeight>
|
||||
<WeightUnit>LB</WeightUnit>
|
||||
<PickupDayOfWeekNum>4</PickupDayOfWeekNum>
|
||||
<DestinationDayOfWeekNum>1</DestinationDayOfWeekNum>
|
||||
<QtdShpExChrg>
|
||||
<SpecialServiceType>FF</SpecialServiceType>
|
||||
<LocalServiceType>FF</LocalServiceType>
|
||||
<GlobalServiceName>FUEL SURCHARGE</GlobalServiceName>
|
||||
<LocalServiceTypeName>FUEL SURCHARGE</LocalServiceTypeName>
|
||||
<ChargeCodeType>SCH</ChargeCodeType>
|
||||
<CurrencyCode>USD</CurrencyCode>
|
||||
<ChargeValue>3.090</ChargeValue>
|
||||
<QtdSExtrChrgInAdCur>
|
||||
<ChargeValue>3.090</ChargeValue>
|
||||
<CurrencyCode>USD</CurrencyCode>
|
||||
<CurrencyRoleTypeCode>BILLC</CurrencyRoleTypeCode>
|
||||
</QtdSExtrChrgInAdCur>
|
||||
<QtdSExtrChrgInAdCur>
|
||||
<ChargeValue>3.090</ChargeValue>
|
||||
<CurrencyCode>USD</CurrencyCode>
|
||||
<CurrencyRoleTypeCode>PULCL</CurrencyRoleTypeCode>
|
||||
</QtdSExtrChrgInAdCur>
|
||||
<QtdSExtrChrgInAdCur>
|
||||
<ChargeValue>3.090</ChargeValue>
|
||||
<CurrencyCode>USD</CurrencyCode>
|
||||
<CurrencyRoleTypeCode>BASEC</CurrencyRoleTypeCode>
|
||||
</QtdSExtrChrgInAdCur>
|
||||
</QtdShpExChrg>
|
||||
<PricingDate>2014-01-09</PricingDate>
|
||||
<ShippingCharge>37.380</ShippingCharge>
|
||||
<TotalTaxAmount>0.000</TotalTaxAmount>
|
||||
<QtdSInAdCur>
|
||||
<CurrencyCode>USD</CurrencyCode>
|
||||
<CurrencyRoleTypeCode>BILLC</CurrencyRoleTypeCode>
|
||||
<WeightCharge>34.290</WeightCharge>
|
||||
<TotalAmount>37.380</TotalAmount>
|
||||
<TotalTaxAmount>0.000</TotalTaxAmount>
|
||||
<WeightChargeTax>0.000</WeightChargeTax>
|
||||
</QtdSInAdCur>
|
||||
<QtdSInAdCur>
|
||||
<CurrencyCode>USD</CurrencyCode>
|
||||
<CurrencyRoleTypeCode>PULCL</CurrencyRoleTypeCode>
|
||||
<WeightCharge>34.290</WeightCharge>
|
||||
<TotalAmount>37.380</TotalAmount>
|
||||
<TotalTaxAmount>0.000</TotalTaxAmount>
|
||||
<WeightChargeTax>0.000</WeightChargeTax>
|
||||
</QtdSInAdCur>
|
||||
<QtdSInAdCur>
|
||||
<CurrencyCode>USD</CurrencyCode>
|
||||
<CurrencyRoleTypeCode>BASEC</CurrencyRoleTypeCode>
|
||||
<WeightCharge>34.290</WeightCharge>
|
||||
<TotalAmount>37.380</TotalAmount>
|
||||
<TotalTaxAmount>0.000</TotalTaxAmount>
|
||||
<WeightChargeTax>0.000</WeightChargeTax>
|
||||
</QtdSInAdCur>
|
||||
<PickupWindowEarliestTime>09:00:00</PickupWindowEarliestTime>
|
||||
<PickupWindowLatestTime>17:00:00</PickupWindowLatestTime>
|
||||
<BookingCutoffOffset>PT1H</BookingCutoffOffset>
|
||||
</QtdShp>
|
||||
<QtdShp>
|
||||
<OriginServiceArea>
|
||||
<FacilityCode>NUQ</FacilityCode>
|
||||
<ServiceAreaCode>NUQ</ServiceAreaCode>
|
||||
</OriginServiceArea>
|
||||
<DestinationServiceArea>
|
||||
<FacilityCode>BER</FacilityCode>
|
||||
<ServiceAreaCode>BER</ServiceAreaCode>
|
||||
</DestinationServiceArea>
|
||||
<GlobalProductCode>3</GlobalProductCode>
|
||||
<LocalProductCode>3</LocalProductCode>
|
||||
<ProductShortName>B2C</ProductShortName>
|
||||
<LocalProductName>EXPRESS WORLDWIDE (B2C)</LocalProductName>
|
||||
<NetworkTypeCode>TD</NetworkTypeCode>
|
||||
<POfferedCustAgreement>Y</POfferedCustAgreement>
|
||||
<TransInd>N</TransInd>
|
||||
<PickupDate>2014-01-09</PickupDate>
|
||||
<PickupCutoffTime>PT16H15M</PickupCutoffTime>
|
||||
<BookingTime>PT15H15M</BookingTime>
|
||||
<ExchangeRate>1.000000</ExchangeRate>
|
||||
<WeightCharge>0</WeightCharge>
|
||||
<WeightChargeTax>0.000</WeightChargeTax>
|
||||
<TotalTransitDays>2</TotalTransitDays>
|
||||
<PickupPostalLocAddDays>0</PickupPostalLocAddDays>
|
||||
<DeliveryPostalLocAddDays>0</DeliveryPostalLocAddDays>
|
||||
<DeliveryDate>
|
||||
<DlvyDateTime>2014-01-13 11:59:00</DlvyDateTime>
|
||||
<DeliveryDateTimeOffset>+00:00</DeliveryDateTimeOffset>
|
||||
</DeliveryDate>
|
||||
<DeliveryTime>PT23H59M</DeliveryTime>
|
||||
<DimensionalWeight>2.205</DimensionalWeight>
|
||||
<WeightUnit>LB</WeightUnit>
|
||||
<PickupDayOfWeekNum>4</PickupDayOfWeekNum>
|
||||
<DestinationDayOfWeekNum>1</DestinationDayOfWeekNum>
|
||||
<PricingDate>2014-01-09</PricingDate>
|
||||
<ShippingCharge>0.000</ShippingCharge>
|
||||
<TotalTaxAmount>0.000</TotalTaxAmount>
|
||||
<QtdSInAdCur>
|
||||
<CurrencyRoleTypeCode>BILLC</CurrencyRoleTypeCode>
|
||||
<WeightCharge>0</WeightCharge>
|
||||
<TotalAmount>0.000</TotalAmount>
|
||||
<TotalTaxAmount>0.000</TotalTaxAmount>
|
||||
<WeightChargeTax>0.000</WeightChargeTax>
|
||||
</QtdSInAdCur>
|
||||
<QtdSInAdCur>
|
||||
<CurrencyCode>USD</CurrencyCode>
|
||||
<CurrencyRoleTypeCode>PULCL</CurrencyRoleTypeCode>
|
||||
<WeightCharge>0</WeightCharge>
|
||||
<TotalAmount>0.000</TotalAmount>
|
||||
<TotalTaxAmount>0.000</TotalTaxAmount>
|
||||
<WeightChargeTax>0.000</WeightChargeTax>
|
||||
</QtdSInAdCur>
|
||||
<QtdSInAdCur>
|
||||
<CurrencyCode>USD</CurrencyCode>
|
||||
<CurrencyRoleTypeCode>BASEC</CurrencyRoleTypeCode>
|
||||
<WeightCharge>0</WeightCharge>
|
||||
<TotalAmount>0.000</TotalAmount>
|
||||
<TotalTaxAmount>0.000</TotalTaxAmount>
|
||||
<WeightChargeTax>0.000</WeightChargeTax>
|
||||
</QtdSInAdCur>
|
||||
<PickupWindowEarliestTime>09:00:00</PickupWindowEarliestTime>
|
||||
<PickupWindowLatestTime>17:00:00</PickupWindowLatestTime>
|
||||
<BookingCutoffOffset>PT1H</BookingCutoffOffset>
|
||||
</QtdShp>
|
||||
<QtdShp>
|
||||
<OriginServiceArea>
|
||||
<FacilityCode>NUQ</FacilityCode>
|
||||
<ServiceAreaCode>NUQ</ServiceAreaCode>
|
||||
</OriginServiceArea>
|
||||
<DestinationServiceArea>
|
||||
<FacilityCode>BER</FacilityCode>
|
||||
<ServiceAreaCode>BER</ServiceAreaCode>
|
||||
</DestinationServiceArea>
|
||||
<GlobalProductCode>P</GlobalProductCode>
|
||||
<LocalProductCode>P</LocalProductCode>
|
||||
<ProductShortName>EXPRESS WORLDWIDE</ProductShortName>
|
||||
<LocalProductName>EXPRESS WORLDWIDE NONDOC</LocalProductName>
|
||||
<NetworkTypeCode>TD</NetworkTypeCode>
|
||||
<POfferedCustAgreement>N</POfferedCustAgreement>
|
||||
<TransInd>Y</TransInd>
|
||||
<PickupDate>2014-01-09</PickupDate>
|
||||
<PickupCutoffTime>PT16H15M</PickupCutoffTime>
|
||||
<BookingTime>PT15H15M</BookingTime>
|
||||
<CurrencyCode>USD</CurrencyCode>
|
||||
<ExchangeRate>1.000000</ExchangeRate>
|
||||
<WeightCharge>32.350</WeightCharge>
|
||||
<WeightChargeTax>0.000</WeightChargeTax>
|
||||
<TotalTransitDays>2</TotalTransitDays>
|
||||
<PickupPostalLocAddDays>0</PickupPostalLocAddDays>
|
||||
<DeliveryPostalLocAddDays>0</DeliveryPostalLocAddDays>
|
||||
<DeliveryDate>
|
||||
<DlvyDateTime>2014-01-13 11:59:00</DlvyDateTime>
|
||||
<DeliveryDateTimeOffset>+00:00</DeliveryDateTimeOffset>
|
||||
</DeliveryDate>
|
||||
<DeliveryTime>PT23H59M</DeliveryTime>
|
||||
<DimensionalWeight>2.205</DimensionalWeight>
|
||||
<WeightUnit>LB</WeightUnit>
|
||||
<PickupDayOfWeekNum>4</PickupDayOfWeekNum>
|
||||
<DestinationDayOfWeekNum>1</DestinationDayOfWeekNum>
|
||||
<QtdShpExChrg>
|
||||
<SpecialServiceType>FF</SpecialServiceType>
|
||||
<LocalServiceType>FF</LocalServiceType>
|
||||
<GlobalServiceName>FUEL SURCHARGE</GlobalServiceName>
|
||||
<LocalServiceTypeName>FUEL SURCHARGE</LocalServiceTypeName>
|
||||
<ChargeCodeType>SCH</ChargeCodeType>
|
||||
<CurrencyCode>USD</CurrencyCode>
|
||||
<ChargeValue>2.910</ChargeValue>
|
||||
<QtdSExtrChrgInAdCur>
|
||||
<ChargeValue>2.910</ChargeValue>
|
||||
<CurrencyCode>USD</CurrencyCode>
|
||||
<CurrencyRoleTypeCode>BILLC</CurrencyRoleTypeCode>
|
||||
</QtdSExtrChrgInAdCur>
|
||||
<QtdSExtrChrgInAdCur>
|
||||
<ChargeValue>2.910</ChargeValue>
|
||||
<CurrencyCode>USD</CurrencyCode>
|
||||
<CurrencyRoleTypeCode>PULCL</CurrencyRoleTypeCode>
|
||||
</QtdSExtrChrgInAdCur>
|
||||
<QtdSExtrChrgInAdCur>
|
||||
<ChargeValue>2.910</ChargeValue>
|
||||
<CurrencyCode>USD</CurrencyCode>
|
||||
<CurrencyRoleTypeCode>BASEC</CurrencyRoleTypeCode>
|
||||
</QtdSExtrChrgInAdCur>
|
||||
</QtdShpExChrg>
|
||||
<PricingDate>2014-01-09</PricingDate>
|
||||
<ShippingCharge>35.260</ShippingCharge>
|
||||
<TotalTaxAmount>0.000</TotalTaxAmount>
|
||||
<QtdSInAdCur>
|
||||
<CurrencyCode>USD</CurrencyCode>
|
||||
<CurrencyRoleTypeCode>BILLC</CurrencyRoleTypeCode>
|
||||
<WeightCharge>32.350</WeightCharge>
|
||||
<TotalAmount>35.260</TotalAmount>
|
||||
<TotalTaxAmount>0.000</TotalTaxAmount>
|
||||
<WeightChargeTax>0.000</WeightChargeTax>
|
||||
</QtdSInAdCur>
|
||||
<QtdSInAdCur>
|
||||
<CurrencyCode>USD</CurrencyCode>
|
||||
<CurrencyRoleTypeCode>PULCL</CurrencyRoleTypeCode>
|
||||
<WeightCharge>32.350</WeightCharge>
|
||||
<TotalAmount>35.260</TotalAmount>
|
||||
<TotalTaxAmount>0.000</TotalTaxAmount>
|
||||
<WeightChargeTax>0.000</WeightChargeTax>
|
||||
</QtdSInAdCur>
|
||||
<QtdSInAdCur>
|
||||
<CurrencyCode>USD</CurrencyCode>
|
||||
<CurrencyRoleTypeCode>BASEC</CurrencyRoleTypeCode>
|
||||
<WeightCharge>32.350</WeightCharge>
|
||||
<TotalAmount>35.260</TotalAmount>
|
||||
<TotalTaxAmount>0.000</TotalTaxAmount>
|
||||
<WeightChargeTax>0.000</WeightChargeTax>
|
||||
</QtdSInAdCur>
|
||||
<PickupWindowEarliestTime>09:00:00</PickupWindowEarliestTime>
|
||||
<PickupWindowLatestTime>17:00:00</PickupWindowLatestTime>
|
||||
<BookingCutoffOffset>PT1H</BookingCutoffOffset>
|
||||
</QtdShp>
|
||||
</BkgDetails>
|
||||
<Srvs>
|
||||
<Srv>
|
||||
<GlobalProductCode>E</GlobalProductCode>
|
||||
<MrkSrv>
|
||||
<LocalProductCode>E</LocalProductCode>
|
||||
<ProductShortName>EXPRESS 9:00</ProductShortName>
|
||||
<LocalProductName>EXPRESS 9:00 NONDOC</LocalProductName>
|
||||
<NetworkTypeCode>TD</NetworkTypeCode>
|
||||
<POfferedCustAgreement>N</POfferedCustAgreement>
|
||||
<TransInd>Y</TransInd>
|
||||
</MrkSrv>
|
||||
<MrkSrv>
|
||||
<LocalServiceType>FF</LocalServiceType>
|
||||
<GlobalServiceName>FUEL SURCHARGE</GlobalServiceName>
|
||||
<LocalServiceTypeName>FUEL SURCHARGE</LocalServiceTypeName>
|
||||
<ChargeCodeType>SCH</ChargeCodeType>
|
||||
<MrkSrvInd>N</MrkSrvInd>
|
||||
</MrkSrv>
|
||||
</Srv>
|
||||
<Srv>
|
||||
<GlobalProductCode>Q</GlobalProductCode>
|
||||
<MrkSrv>
|
||||
<LocalProductCode>Q</LocalProductCode>
|
||||
<ProductShortName>MEDICAL EXPRESS</ProductShortName>
|
||||
<LocalProductName>MEDICAL EXPRESS</LocalProductName>
|
||||
<NetworkTypeCode>TD</NetworkTypeCode>
|
||||
<POfferedCustAgreement>Y</POfferedCustAgreement>
|
||||
<TransInd>N</TransInd>
|
||||
</MrkSrv>
|
||||
<MrkSrv>
|
||||
<LocalServiceType>FF</LocalServiceType>
|
||||
<GlobalServiceName>FUEL SURCHARGE</GlobalServiceName>
|
||||
<LocalServiceTypeName>FUEL SURCHARGE</LocalServiceTypeName>
|
||||
<ChargeCodeType>SCH</ChargeCodeType>
|
||||
<MrkSrvInd>N</MrkSrvInd>
|
||||
</MrkSrv>
|
||||
</Srv>
|
||||
<Srv>
|
||||
<GlobalProductCode>Y</GlobalProductCode>
|
||||
<MrkSrv>
|
||||
<LocalProductCode>Y</LocalProductCode>
|
||||
<ProductShortName>EXPRESS 12:00</ProductShortName>
|
||||
<LocalProductName>EXPRESS 12:00 NONDOC</LocalProductName>
|
||||
<NetworkTypeCode>TD</NetworkTypeCode>
|
||||
<POfferedCustAgreement>N</POfferedCustAgreement>
|
||||
<TransInd>Y</TransInd>
|
||||
</MrkSrv>
|
||||
<MrkSrv>
|
||||
<LocalServiceType>FF</LocalServiceType>
|
||||
<GlobalServiceName>FUEL SURCHARGE</GlobalServiceName>
|
||||
<LocalServiceTypeName>FUEL SURCHARGE</LocalServiceTypeName>
|
||||
<ChargeCodeType>SCH</ChargeCodeType>
|
||||
<MrkSrvInd>N</MrkSrvInd>
|
||||
</MrkSrv>
|
||||
</Srv>
|
||||
<Srv>
|
||||
<GlobalProductCode>3</GlobalProductCode>
|
||||
<MrkSrv>
|
||||
<LocalProductCode>3</LocalProductCode>
|
||||
<ProductShortName>B2C</ProductShortName>
|
||||
<LocalProductName>EXPRESS WORLDWIDE (B2C)</LocalProductName>
|
||||
<NetworkTypeCode>TD</NetworkTypeCode>
|
||||
<POfferedCustAgreement>Y</POfferedCustAgreement>
|
||||
<TransInd>N</TransInd>
|
||||
</MrkSrv>
|
||||
</Srv>
|
||||
<Srv>
|
||||
<GlobalProductCode>P</GlobalProductCode>
|
||||
<MrkSrv>
|
||||
<LocalProductCode>P</LocalProductCode>
|
||||
<ProductShortName>EXPRESS WORLDWIDE</ProductShortName>
|
||||
<LocalProductName>EXPRESS WORLDWIDE NONDOC</LocalProductName>
|
||||
<NetworkTypeCode>TD</NetworkTypeCode>
|
||||
<POfferedCustAgreement>N</POfferedCustAgreement>
|
||||
<TransInd>Y</TransInd>
|
||||
</MrkSrv>
|
||||
<MrkSrv>
|
||||
<LocalServiceType>FF</LocalServiceType>
|
||||
<GlobalServiceName>FUEL SURCHARGE</GlobalServiceName>
|
||||
<LocalServiceTypeName>FUEL SURCHARGE</LocalServiceTypeName>
|
||||
<ChargeCodeType>SCH</ChargeCodeType>
|
||||
<MrkSrvInd>N</MrkSrvInd>
|
||||
</MrkSrv>
|
||||
</Srv>
|
||||
</Srvs>
|
||||
</GetQuoteResponse>
|
||||
</res:DCTResponse>
|
||||
@@ -0,0 +1,85 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<req:ShipmentRequest xmlns:req="http://www.dhl.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.dhl.com ship-val-global-req.xsd" schemaVersion="10.0">
|
||||
<Request xmlns="">
|
||||
<ServiceHeader>
|
||||
<MessageTime>currentTime</MessageTime>
|
||||
<MessageReference>MAGE_SHIP_28TO32_Char_CHECKED</MessageReference>
|
||||
<SiteID>some ID</SiteID>
|
||||
<Password>some password</Password>
|
||||
</ServiceHeader>
|
||||
<MetaData>
|
||||
<SoftwareName>Magento</SoftwareName>
|
||||
<SoftwareVersion>1.0.0+no-v</SoftwareVersion>
|
||||
</MetaData>
|
||||
</Request>
|
||||
<RegionCode xmlns="">CHECKED</RegionCode>
|
||||
<RequestedPickupTime xmlns="">N</RequestedPickupTime>
|
||||
<LanguageCode xmlns="">EN</LanguageCode>
|
||||
<Billing xmlns="">
|
||||
<ShipperAccountNumber>123456789</ShipperAccountNumber>
|
||||
<ShippingPaymentType>S</ShippingPaymentType>
|
||||
<BillingAccountNumber>123456789</BillingAccountNumber>
|
||||
</Billing>
|
||||
<Consignee xmlns="">
|
||||
<CompanyName/>
|
||||
<AddressLine1>15099 Some Blvd</AddressLine1>
|
||||
<City/>
|
||||
<PostalCode/>
|
||||
<CountryCode/>
|
||||
<CountryName/>
|
||||
<Contact>
|
||||
<PersonName/>
|
||||
<PhoneNumber/>
|
||||
</Contact>
|
||||
</Consignee>
|
||||
<Commodity xmlns="">
|
||||
<CommodityCode>01</CommodityCode>
|
||||
</Commodity>
|
||||
<Reference xmlns="">
|
||||
<ReferenceID>shipment reference</ReferenceID>
|
||||
<ReferenceType>St</ReferenceType>
|
||||
</Reference>
|
||||
<ShipmentDetails xmlns="">
|
||||
<Pieces xmlns="">
|
||||
<Piece xmlns="">
|
||||
<PieceID>1</PieceID>
|
||||
<PackageType>CP</PackageType>
|
||||
<Weight>0.454</Weight>
|
||||
<Width>3</Width>
|
||||
<Height>3</Height>
|
||||
<Depth>3</Depth>
|
||||
<PieceContents>item_name</PieceContents>
|
||||
</Piece>
|
||||
</Pieces>
|
||||
<WeightUnit>K</WeightUnit>
|
||||
<GlobalProductCode/>
|
||||
<LocalProductCode/>
|
||||
<Date>currentTime</Date>
|
||||
<Contents>DHL Parcel</Contents>
|
||||
<DimensionUnit>C</DimensionUnit>
|
||||
<PackageType>CP</PackageType>
|
||||
<CurrencyCode>USD</CurrencyCode>
|
||||
</ShipmentDetails>
|
||||
<Shipper xmlns="">
|
||||
<ShipperID>123456789</ShipperID>
|
||||
<CompanyName/>
|
||||
<RegisteredAccount>123456789</RegisteredAccount>
|
||||
<AddressLine1>4956 Some Way</AddressLine1>
|
||||
<City/>
|
||||
<PostalCode/>
|
||||
<CountryCode/>
|
||||
<CountryName/>
|
||||
<Contact xmlns="">
|
||||
<PersonName/>
|
||||
<PhoneNumber/>
|
||||
</Contact>
|
||||
</Shipper>
|
||||
<LabelImageFormat xmlns="">PDF</LabelImageFormat>
|
||||
</req:ShipmentRequest>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<root>
|
||||
<AirwayBillNumber>1111</AirwayBillNumber>
|
||||
<LabelImage>
|
||||
<OutputImage>OutputImageContent</OutputImage>
|
||||
</LabelImage>
|
||||
<City>Nürnberg</City>
|
||||
</root>
|
||||
@@ -0,0 +1,112 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<req:ShipmentRequest xmlns:req="http://www.dhl.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.dhl.com ship-val-global-req.xsd" schemaVersion="10.0">
|
||||
<Request xmlns="">
|
||||
<ServiceHeader>
|
||||
<MessageTime>currentTime</MessageTime>
|
||||
<MessageReference>MAGE_SHIP_28TO32_Char_CHECKED</MessageReference>
|
||||
<SiteID>some ID</SiteID>
|
||||
<Password>some password</Password>
|
||||
</ServiceHeader>
|
||||
<MetaData>
|
||||
<SoftwareName>Magento</SoftwareName>
|
||||
<SoftwareVersion>1.0.0+no-v</SoftwareVersion>
|
||||
</MetaData>
|
||||
</Request>
|
||||
<RegionCode xmlns="">CHECKED</RegionCode>
|
||||
<RequestedPickupTime xmlns="">N</RequestedPickupTime>
|
||||
<LanguageCode xmlns="">EN</LanguageCode>
|
||||
<Billing xmlns="">
|
||||
<ShipperAccountNumber>123456789</ShipperAccountNumber>
|
||||
<ShippingPaymentType>S</ShippingPaymentType>
|
||||
<BillingAccountNumber>123456789</BillingAccountNumber>
|
||||
<DutyAccountNumber>123456789</DutyAccountNumber>
|
||||
</Billing>
|
||||
<Consignee xmlns="">
|
||||
<CompanyName/>
|
||||
<AddressLine1>15099 Some Blvd</AddressLine1>
|
||||
<City/>
|
||||
<PostalCode/>
|
||||
<CountryCode/>
|
||||
<CountryName/>
|
||||
<Contact>
|
||||
<PersonName/>
|
||||
<PhoneNumber/>
|
||||
</Contact>
|
||||
</Consignee>
|
||||
<Commodity xmlns="">
|
||||
<CommodityCode>01</CommodityCode>
|
||||
</Commodity>
|
||||
<Dutiable xmlns="">
|
||||
<DeclaredValue>10.00</DeclaredValue>
|
||||
<DeclaredCurrency>USD</DeclaredCurrency>
|
||||
<TermsOfTrade>DAP</TermsOfTrade>
|
||||
</Dutiable>
|
||||
<ExportDeclaration>
|
||||
<InvoiceNumber/>
|
||||
<InvoiceDate>1970-01-01</InvoiceDate>
|
||||
<ExportLineItem>
|
||||
<LineNumber>item1</LineNumber>
|
||||
<Quantity>1</Quantity>
|
||||
<QuantityUnit>PCS</QuantityUnit>
|
||||
<Description>item_name</Description>
|
||||
<Value>10.00</Value>
|
||||
<Weight>
|
||||
<Weight>0.454000000001</Weight>
|
||||
<WeightUnit>K</WeightUnit>
|
||||
</Weight>
|
||||
<GrossWeight>
|
||||
<Weight>0.454000000001</Weight>
|
||||
<WeightUnit>K</WeightUnit>
|
||||
</GrossWeight>
|
||||
<ManufactureCountryCode>GB</ManufactureCountryCode>
|
||||
</ExportLineItem>
|
||||
</ExportDeclaration>
|
||||
<Reference xmlns="">
|
||||
<ReferenceID>shipment reference</ReferenceID>
|
||||
<ReferenceType>St</ReferenceType>
|
||||
</Reference>
|
||||
<ShipmentDetails xmlns="">
|
||||
<Pieces xmlns="">
|
||||
<Piece xmlns="">
|
||||
<PieceID>1</PieceID>
|
||||
<PackageType>CP</PackageType>
|
||||
<Weight>0.454</Weight>
|
||||
<Width>3</Width>
|
||||
<Height>3</Height>
|
||||
<Depth>3</Depth>
|
||||
<PieceContents>item_name</PieceContents>
|
||||
</Piece>
|
||||
</Pieces>
|
||||
<WeightUnit>K</WeightUnit>
|
||||
<GlobalProductCode/>
|
||||
<LocalProductCode/>
|
||||
<Date>currentTime</Date>
|
||||
<Contents>DHL Parcel</Contents>
|
||||
<DimensionUnit>C</DimensionUnit>
|
||||
<PackageType>CP</PackageType>
|
||||
<IsDutiable>Y</IsDutiable>
|
||||
<CurrencyCode>USD</CurrencyCode>
|
||||
</ShipmentDetails>
|
||||
<Shipper xmlns="">
|
||||
<ShipperID>123456789</ShipperID>
|
||||
<CompanyName/>
|
||||
<RegisteredAccount>123456789</RegisteredAccount>
|
||||
<AddressLine1>4956 Some Way</AddressLine1>
|
||||
<City/>
|
||||
<PostalCode/>
|
||||
<CountryCode/>
|
||||
<CountryName/>
|
||||
<Contact xmlns="">
|
||||
<PersonName/>
|
||||
<PhoneNumber/>
|
||||
</Contact>
|
||||
</Shipper>
|
||||
<LabelImageFormat xmlns="">PDF</LabelImageFormat>
|
||||
</req:ShipmentRequest>
|
||||
Reference in New Issue
Block a user