white-nl / commerce-sendcloud

Sendcloud integration for Craft Commerce
Other
5 stars 2 forks source link

City must not be blank, comes up with Singapore, maybe others. #15

Closed bleepsandblops closed 1 year ago

bleepsandblops commented 1 year ago

Description

We're getting this error message with an address from Singapore [TypeError] JouwWeb\SendCloud\Model\Address::__construct(): Argument #5 ($city) must be of type string, null given

Singapore addresses do not have a city, it's just "Singapore".

My quick fix was this: https://github.com/white-nl/commerce-sendcloud/blob/51f2e693ea472e8c08cbb9bceabe8a37c85e8154/src/client/JouwWebSendcloudAdapter.php#L248 but it could be cleaner (sending the country name), or something else, like sending the state if it exists, then the country.

Steps to reproduce

1. 2.

Additional info

WHITE-developer commented 1 year ago

Hi @bleepsandblops, I'll try to push a fix for this today

WHITE-developer commented 1 year ago

3.0.0 is now released with the fix. Thank you for your patience.