Webador / sendcloud

Provides a PHP client to interact with the SendCloud API in an object-oriented way.
MIT License
16 stars 15 forks source link

address_2 is not available for Address Model #6

Closed roberthenniger closed 4 years ago

roberthenniger commented 4 years ago

We have german "Poststation" addresses and the expected format from sendcloud side is: Example Address: 21234567 Packstation 123 address: Packstation address_2: 21234567 house_number: 123

Seems we can not set the Address2 for address and have no influence on the createParcel method.

Why not give an option to add an array with additional data to the Address Model and this will be merged into the data consumed by the createParcel method?

villermen commented 4 years ago

@roberthenniger Thanks for the report. I'll make address 2 available shortly.

Why not give an option to add an array with additional data to the Address Model and this will be merged into the data consumed by the createParcel method?

If there would be additional always-optional (meta) data not part of the address that would be the way to go. However, address line 2 is tightly linked with the address. Having to add that in a non-OOP way would be weird as you can't easily discover that by yourself. That's why it's better to add these fields as first-class properties instead of adding them in a catch-all array that will have the end user wonder whether they did it correctly.

villermen commented 4 years ago

@roberthenniger The newest release (v3.5.0) supports address line 2. I've tested its working against Sendcloud's production environment so there shouldn't be any problems in using it.