postnl / postnl-magento2

This is the official Magento 2 extension for the logistics company PostNL. Add shipping options and parcelshops to your checkout. Create labels with track and trace functionality from the backend.
59 stars 60 forks source link

No available labels while pricing, missing address #237

Closed pimjansen closed 3 years ago

pimjansen commented 3 years ago

To Reproduce Place an order and shipment and try to send it. While sending below errors are received. The problem is that there actually is an address set and the order overview (shipment) is also showing this.

postnl-error

Expected result Labels is printed and all is sent properly

Actual result [POSTNL-0252] - Er zijn geen valide labels gegenereerd. Bekijk de logs voor meer informatie.

[2021-03-03 13:22:36] postnl_logging.CRITICAL: Check CIFException in the detail section

- 4: Required parameter 'Shipments.Shipment.0.Addresses.Address.0.Countrycode' is missing.
- 4: Required parameter 'Shipments.Shipment.0.Addresses.Address.0.City' is missing.

<<<< Request XML >>>>
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://postnl.nl/cif/domain/LabellingWebService/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://postnl.nl/cif/services/LabellingWebService/">
  <env:Header/>
  <env:Body>
    <ns2:GenerateLabel>
      <ns1:Customer>
        <ns1:Address>
          <ns1:AddressType>02</ns1:AddressType>
          <ns1:City>City</ns1:City>
          <ns1:CompanyName>My Company</ns1:CompanyName>
          <ns1:Countrycode>NL</ns1:Countrycode>
          <ns1:Department xsi:nil="true"/>
          <ns1:FirstName xsi:nil="true"/>
          <ns1:HouseNr>6</ns1:HouseNr>
          <ns1:HouseNrExt>b</ns1:HouseNrExt>
          <ns1:Name xsi:nil="true"/>
          <ns1:Street>My Street</ns1:Street>
          <ns1:Zipcode>1234AB</ns1:Zipcode>
        </ns1:Address>
        <ns1:CollectionLocation>103861</ns1:CollectionLocation>
        <ns1:CustomerCode>TOTA</ns1:CustomerCode>
        <ns1:CustomerNumber>11223344</ns1:CustomerNumber>
      </ns1:Customer>
      <ns1:Message>
        <ns1:MessageID>705efa4eedefcbb64c8b3c1b7262a58b</ns1:MessageID>
        <ns1:MessageTimeStamp>03-03-2021 14:22:35</ns1:MessageTimeStamp>
        <ns1:Printertype>GraphicFile|PDF</ns1:Printertype>
      </ns1:Message>
      <ns1:Shipments>
        <ns1:Shipment>
          <ns1:Addresses>
            <ns1:Address>
              <ns1:AddressType>01</ns1:AddressType>
              <ns1:City xsi:nil="true"/>
              <ns1:CompanyName xsi:nil="true"/>
              <ns1:Countrycode xsi:nil="true"/>
              <ns1:FirstName/>
              <ns1:HouseNr/>
              <ns1:HouseNrExt/>
              <ns1:Name xsi:nil="true"/>
              <ns1:Region xsi:nil="true"/>
              <ns1:Street/>
              <ns1:Zipcode/>
            </ns1:Address>
            <ns1:Address>
              <ns1:AddressType>09</ns1:AddressType>
              <ns1:City>Heerhugowaard</ns1:City>
              <ns1:CompanyName>Customer Name</ns1:CompanyName>
              <ns1:Countrycode>NL</ns1:Countrycode>
              <ns1:FirstName>P van</ns1:FirstName>
              <ns1:HouseNr>32</ns1:HouseNr>
              <ns1:HouseNrExt/>
              <ns1:Name>Jansen</ns1:Name>
              <ns1:Region xsi:nil="true"/>
              <ns1:Street>My Streetname</ns1:Street>
              <ns1:Zipcode>1111AA</ns1:Zipcode>
            </ns1:Address>
          </ns1:Addresses>
          <ns1:Barcode>3STOTA335643881</ns1:Barcode>
          <ns1:CollectionTimeStampEnd/>
          <ns1:CollectionTimeStampStart/>
          <ns1:Contacts>
            <ns1:Contact>
              <ns1:ContactType>01</ns1:ContactType>
              <ns1:Email>me@domain.tld</ns1:Email>
              <ns1:TelNr>0612345678</ns1:TelNr>
            </ns1:Contact>
          </ns1:Contacts>
          <ns1:DeliveryDate>19-11-2020 00:00:00</ns1:DeliveryDate>
          <ns1:Dimension>
            <ns1:Weight>2</ns1:Weight>
          </ns1:Dimension>
          <ns1:DownPartnerBarcode xsi:nil="true"/>
          <ns1:DownPartnerID xsi:nil="true"/>
          <ns1:DownPartnerLocation xsi:nil="true"/>
          <ns1:ProductCodeDelivery>3085</ns1:ProductCodeDelivery>
          <ns1:Reference>000000011</ns1:Reference>
          <ns1:ReturnBarcode xsi:nil="true"/>
        </ns1:Shipment>
      </ns1:Shipments>
    </ns2:GenerateLabel>
  </env:Body>
</env:Envelope>

<<<< Response XML >>>>
<?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Body>
    <s:Fault>
      <faultcode>s:CIF Framework Message Interceptor</faultcode>
      <faultstring xml:lang="en-US">Check CIFException in the detail section</faultstring>
      <detail>
        <CifException xmlns="http://postnl.nl/cif/services/common/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
          <Errors>
            <ExceptionData>
              <Description i:nil="true"/>
              <ErrorMsg>Required parameter 'Shipments.Shipment.0.Addresses.Address.0.Countrycode' is missing.</ErrorMsg>
              <ErrorNumber>4</ErrorNumber>
            </ExceptionData>
            <ExceptionData>
              <Description i:nil="true"/>
              <ErrorMsg>Required parameter 'Shipments.Shipment.0.Addresses.Address.0.City' is missing.</ErrorMsg>
              <ErrorNumber>4</ErrorNumber>
            </ExceptionData>
          </Errors>
        </CifException>
      </detail>
    </s:Fault>
  </s:Body>
</s:Envelope>
 [] []

Workaround None

Screenshots n/a

Please complete the following information

pimjansen commented 3 years ago

I notice that on the initial selection page below happens when loading the locations.

Untitled

When i select the default option here, it tries to delivery to an unknown location it seems and it is not trying to do an home delivery?

[2021-03-03 13:43:19] postnl_logging.CRITICAL: Check CIFException in the detail section

- 5: Value 'Location.DeliveryDate' is not in the correct format 'Date'.

<<<< Request XML >>>>
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://postnl.nl/cif/domain/LocationWebService/" xmlns:ns2="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:ns3="http://postnl.nl/cif/services/LocationWebService/">
  <env:Header/>
  <env:Body>
    <ns3:GetNearestLocations>
      <ns1:Countrycode>NL</ns1:Countrycode>
      <ns1:Location>
        <ns1:AllowSundaySorting>true</ns1:AllowSundaySorting>
        <ns1:DeliveryDate>Ongeldig GetDeliveryDate response: NULL</ns1:DeliveryDate>
        <ns1:DeliveryOptions>
          <ns2:string>PG</ns2:string>
        </ns1:DeliveryOptions>
        <ns1:Options>
          <ns2:string>Daytime</ns2:string>
          <ns2:string>Morning</ns2:string>
        </ns1:Options>
        <ns1:Postalcode>1704RW</ns1:Postalcode>
      </ns1:Location>
      <ns1:Message>
        <ns1:MessageID>c38e7cd9973c73ea71b1d337eb0ab478</ns1:MessageID>
        <ns1:MessageTimeStamp>03-03-2021 14:43:19</ns1:MessageTimeStamp>
      </ns1:Message>
    </ns3:GetNearestLocations>
  </env:Body>
</env:Envelope>

<<<< Response XML >>>>
<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Body>
    <s:Fault>
      <faultcode>s:CIF Framework Message Interceptor</faultcode>
      <faultstring xml:lang="en-US">Check CIFException in the detail section</faultstring>
      <detail>
        <CifException xmlns="http://postnl.nl/cif/services/common/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
          <Errors>
            <ExceptionData>
              <Description i:nil="true"/>
              <ErrorMsg>Value 'Location.DeliveryDate' is not in the correct format 'Date'.</ErrorMsg>
              <ErrorNumber>5</ErrorNumber>
            </ExceptionData>
          </Errors>
        </CifException>
      </detail>
    </s:Fault>
  </s:Body>
</s:Envelope>
 [] []
tig-jeffreybranderhorst commented 3 years ago

Hi @pimjansen ,

could you contact us at support@tig.nl, so we can assist you further. On a clean magento installation I cannot reproduce this. So we would like to investigate if this is caused by certain settings.

Have a great day, Jeffrey