Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deserializable entity CurrentStatusResponseShipment contains unknown properties: ['Amount'] #84

Open
bastiaansenglenn opened this issue Oct 17, 2023 · 0 comments

Comments

@bastiaansenglenn
Copy link

When retrieving the state of the shipment with barcode we get the following deserialize error:
Deserializable entity CurrentStatusResponseShipment contains unknown properties: ['Amount']

It is triggered by this function:
$shipmentDetails = $this->client->getShippingStatusByBarcode($shipment->track_trace_code);

On the CurrentStatusResponseShipment class is amounts defined but the request response only contains amount. Response returned by PostNL API before deserialize;

  +"CurrentStatusResponseShipment": {#3937
    +"MainBarcode": "xxxxxxxxxxx"
    +"Barcode": "xxxxxxxxxxx"
    +"ShipmentAmount": "1"
    +"ShipmentCounter": "1"
    +"Customer": Customer object
    +"ProductCode": "003087"
    +"ProductDescription": "Verhoogde Aansprakelijkheid Zending"
    +"Reference": "xxxxxxx"
    +"Dimension": {#3918
      +"Height": "390"
      +"Length": "600"
      +"Volume": "93600"
      +"Weight": "8820"
      +"Width": "400"
    }
    +"Amount": {#3907
      +"VerzekerdBedrag": "EUR800.00"
    }
    +"ProductOptions": array:4 [
      0 => {#3941
        +"OptionCode": "27"
        +"CharacteristicCode": "122"
      }
      1 => {#3942
        +"OptionCode": "17"
        +"CharacteristicCode": "122"
      }
      2 => {#3943
        +"OptionCode": "21"
        +"CharacteristicCode": "122"
      }
      3 => {#3944
        +"OptionCode": "1"
        +"CharacteristicCode": "112"
      }
    ]
    +"Expectation": {#3945
      +"ETAFrom": "2023-10-11T14:35:00"
      +"ETATo": "2023-10-11T16:35:00"
    }
    +"Status": {#3946
      +"TimeStamp": "11-10-2023 15:32:16"
      +"StatusCode": "11"
      +"StatusDescription": "Zending afgeleverd"
      +"PhaseCode": "4"
      +"PhaseDescription": "Afgeleverd"
    }
    +"Addresses": array:2 [
      0 => Address object
      1 => Address object
    ]
  }
}

This error will only occur for me when retrieving status of an insured shipment. I can make a PR and change the amounts to amount on the CurrentStatusResponseShipment class, but i don't know if that has any impact on other users off this package.

If I need to provide more data, please let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant