Skip to content

Commit 596c984

Browse files
committed
#AC3023-DHL Migration from V6.2 to V10: Updated Shipment request schema for domestic and international
1 parent 2d8d198 commit 596c984

File tree

3 files changed

+21
-31
lines changed

3 files changed

+21
-31
lines changed

app/code/Magento/Dhl/Model/Carrier.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1649,6 +1649,7 @@ protected function _doRequest()
16491649
);
16501650
$baseCurrencyCode = $this->_storeManager->getWebsite($rawRequest->getWebsiteId())->getBaseCurrencyCode();
16511651
$nodeDutiable->addChild('DeclaredCurrency', $baseCurrencyCode);
1652+
$nodeDutiable->addChild('TermsOfTrade', 'DAP');
16521653
}
16531654

16541655
/**
@@ -1665,9 +1666,9 @@ protected function _doRequest()
16651666

16661667
/** Shipper */
16671668
$nodeShipper = $xml->addChild('Shipper', '', '');
1668-
$nodeShipper->addChild('ShipperID', (string)$this->getConfigData('account'));
1669+
$nodeShipper->addChild('ShipperID', (string)substr($this->getConfigData('account'), 0, 9));
16691670
$nodeShipper->addChild('CompanyName', $rawRequest->getShipperContactCompanyName());
1670-
$nodeShipper->addChild('RegisteredAccount', (string)$this->getConfigData('account'));
1671+
$nodeShipper->addChild('RegisteredAccount', (string)substr($this->getConfigData('account'), 0, 9));
16711672

16721673
$address = $rawRequest->getShipperAddressStreet1() . ' ' . $rawRequest->getShipperAddressStreet2();
16731674
$address = $this->string->split($address, 45, false, true);
@@ -2053,7 +2054,6 @@ protected function _checkDomesticStatus($origCountryCode, $destCountryCode)
20532054

20542055
$origCountry = (string)$this->getCountryParams($origCountryCode)->getData('name');
20552056
$destCountry = (string)$this->getCountryParams($destCountryCode)->getData('name');
2056-
$isDomestic = (string)$this->getCountryParams($destCountryCode)->getData('domestic');
20572057

20582058
if (($origCountry == $destCountry)
20592059
|| (

dev/tests/integration/testsuite/Magento/Dhl/_files/domestic_shipment_request.xml

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
-->
88
<req:ShipmentRequest xmlns:req="http://www.dhl.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9-
xsi:schemaLocation="http://www.dhl.com ship-val-global-req.xsd" schemaVersion="6.2">
9+
xsi:schemaLocation="http://www.dhl.com ship-val-global-req.xsd" schemaVersion="10.0">
1010
<Request xmlns="">
1111
<ServiceHeader>
1212
<MessageTime>currentTime</MessageTime>
@@ -21,17 +21,15 @@
2121
</Request>
2222
<RegionCode xmlns="">CHECKED</RegionCode>
2323
<RequestedPickupTime xmlns="">N</RequestedPickupTime>
24-
<NewShipper xmlns="">N</NewShipper>
2524
<LanguageCode xmlns="">EN</LanguageCode>
26-
<PiecesEnabled xmlns="">Y</PiecesEnabled>
2725
<Billing xmlns="">
28-
<ShipperAccountNumber>1234567890</ShipperAccountNumber>
26+
<ShipperAccountNumber>123456789</ShipperAccountNumber>
2927
<ShippingPaymentType>S</ShippingPaymentType>
30-
<BillingAccountNumber>1234567890</BillingAccountNumber>
28+
<BillingAccountNumber>123456789</BillingAccountNumber>
3129
</Billing>
3230
<Consignee xmlns="">
3331
<CompanyName/>
34-
<AddressLine>15099 Some Blvd</AddressLine>
32+
<AddressLine1>15099 Some Blvd</AddressLine1>
3533
<City/>
3634
<PostalCode/>
3735
<CountryCode/>
@@ -42,14 +40,13 @@
4240
</Contact>
4341
</Consignee>
4442
<Commodity xmlns="">
45-
<CommodityCode>1</CommodityCode>
43+
<CommodityCode>11</CommodityCode>
4644
</Commodity>
4745
<Reference xmlns="">
4846
<ReferenceID>shipment reference</ReferenceID>
4947
<ReferenceType>St</ReferenceType>
5048
</Reference>
5149
<ShipmentDetails xmlns="">
52-
<NumberOfPieces>1</NumberOfPieces>
5350
<Pieces xmlns="">
5451
<Piece xmlns="">
5552
<PieceID>1</PieceID>
@@ -61,22 +58,20 @@
6158
<PieceContents>item_name</PieceContents>
6259
</Piece>
6360
</Pieces>
64-
<Weight>0.454</Weight>
6561
<WeightUnit>K</WeightUnit>
6662
<GlobalProductCode/>
6763
<LocalProductCode/>
6864
<Date>currentTime</Date>
6965
<Contents>DHL Parcel</Contents>
70-
<DoorTo>DD</DoorTo>
7166
<DimensionUnit>C</DimensionUnit>
7267
<PackageType>CP</PackageType>
7368
<CurrencyCode>USD</CurrencyCode>
7469
</ShipmentDetails>
7570
<Shipper xmlns="">
76-
<ShipperID>1234567890</ShipperID>
71+
<ShipperID>123456789</ShipperID>
7772
<CompanyName/>
78-
<RegisteredAccount>1234567890</RegisteredAccount>
79-
<AddressLine>4956 Some Way</AddressLine>
73+
<RegisteredAccount>123456789</RegisteredAccount>
74+
<AddressLine1>4956 Some Way</AddressLine1>
8075
<City/>
8176
<PostalCode/>
8277
<CountryCode/>

dev/tests/integration/testsuite/Magento/Dhl/_files/shipment_request.xml

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
-->
88
<req:ShipmentRequest xmlns:req="http://www.dhl.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9-
xsi:schemaLocation="http://www.dhl.com ship-val-global-req.xsd" schemaVersion="6.2">
9+
xsi:schemaLocation="http://www.dhl.com ship-val-global-req.xsd" schemaVersion="10.0">
1010
<Request xmlns="">
1111
<ServiceHeader>
1212
<MessageTime>currentTime</MessageTime>
@@ -21,19 +21,16 @@
2121
</Request>
2222
<RegionCode xmlns="">CHECKED</RegionCode>
2323
<RequestedPickupTime xmlns="">N</RequestedPickupTime>
24-
<NewShipper xmlns="">N</NewShipper>
2524
<LanguageCode xmlns="">EN</LanguageCode>
26-
<PiecesEnabled xmlns="">Y</PiecesEnabled>
2725
<Billing xmlns="">
28-
<ShipperAccountNumber>1234567890</ShipperAccountNumber>
26+
<ShipperAccountNumber>123456789</ShipperAccountNumber>
2927
<ShippingPaymentType>S</ShippingPaymentType>
30-
<BillingAccountNumber>1234567890</BillingAccountNumber>
31-
<DutyPaymentType>S</DutyPaymentType>
32-
<DutyAccountNumber>1234567890</DutyAccountNumber>
28+
<BillingAccountNumber>123456789</BillingAccountNumber>
29+
<DutyAccountNumber>123456789</DutyAccountNumber>
3330
</Billing>
3431
<Consignee xmlns="">
3532
<CompanyName/>
36-
<AddressLine>15099 Some Blvd</AddressLine>
33+
<AddressLine1>15099 Some Blvd</AddressLine1>
3734
<City/>
3835
<PostalCode/>
3936
<CountryCode/>
@@ -44,18 +41,18 @@
4441
</Contact>
4542
</Consignee>
4643
<Commodity xmlns="">
47-
<CommodityCode>1</CommodityCode>
44+
<CommodityCode>11</CommodityCode>
4845
</Commodity>
4946
<Dutiable xmlns="">
5047
<DeclaredValue>10.00</DeclaredValue>
5148
<DeclaredCurrency>USD</DeclaredCurrency>
49+
<TermsOfTrade>DAP</TermsOfTrade>
5250
</Dutiable>
5351
<Reference xmlns="">
5452
<ReferenceID>shipment reference</ReferenceID>
5553
<ReferenceType>St</ReferenceType>
5654
</Reference>
5755
<ShipmentDetails xmlns="">
58-
<NumberOfPieces>1</NumberOfPieces>
5956
<Pieces xmlns="">
6057
<Piece xmlns="">
6158
<PieceID>1</PieceID>
@@ -67,23 +64,21 @@
6764
<PieceContents>item_name</PieceContents>
6865
</Piece>
6966
</Pieces>
70-
<Weight>0.454</Weight>
7167
<WeightUnit>K</WeightUnit>
7268
<GlobalProductCode/>
7369
<LocalProductCode/>
7470
<Date>currentTime</Date>
7571
<Contents>DHL Parcel</Contents>
76-
<DoorTo>DD</DoorTo>
7772
<DimensionUnit>C</DimensionUnit>
7873
<PackageType>CP</PackageType>
7974
<IsDutiable>Y</IsDutiable>
8075
<CurrencyCode>USD</CurrencyCode>
8176
</ShipmentDetails>
8277
<Shipper xmlns="">
83-
<ShipperID>1234567890</ShipperID>
78+
<ShipperID>123456789</ShipperID>
8479
<CompanyName/>
85-
<RegisteredAccount>1234567890</RegisteredAccount>
86-
<AddressLine>4956 Some Way</AddressLine>
80+
<RegisteredAccount>123456789</RegisteredAccount>
81+
<AddressLine1>4956 Some Way</AddressLine1>
8782
<City/>
8883
<PostalCode/>
8984
<CountryCode/>

0 commit comments

Comments
 (0)