ho-nl / BolCom_RetailerApi

Package that talks to the bol.com v8 API
10 stars 10 forks source link

"Email" is optional in address in real world. #28

Closed DangerLifter closed 4 years ago

DangerLifter commented 4 years ago

In real world it is possible has no email in address info. Below output of "GetOrder" call which ends with exception:

In AddressDetails.php line 279: [InvalidArgumentException] Key 'email' is missing in data array or is not a string
Exception trace: at /var/www/projects/bol.com-app/vendor/bol-com/retailer-api/src/Model/Order/AddressDetails.php:279

Array
(
    [orderId] => 2803264670
    [dateTimeOrderPlaced] => 2020-01-05T19:42:56+01:00
    [customerDetails] => Array
        (
            [shipmentDetails] => Array
                (
                    [salutationCode] => XXX
                    [firstName] => XXX
                    [surName] => XXX
                    [streetName] => XXX
                    [houseNumber] => XXX
                    [zipCode] => XXX
                    [city] => XXX
                    [countryCode] => NL
                )
            [billingDetails] => Array
                (
                    [salutationCode] => XXX
                    [firstName] => XXX
                    [surName] => XXX
                    [streetName] => XXX
                    [houseNumber] => XXX
                    [zipCode] => XXX
                    [city] => XXX
                    [countryCode] => NL
                )
        )
    [orderItems] => Array
        (
            [0] => Array
                (
                    XXX
                )
        )
)