ho-nl / BolCom_RetailerApi

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

GetShipment: various errors on parsing API response #15

Closed DangerLifter closed 4 years ago

DangerLifter commented 4 years ago

Api returns:

Array
(
    [shipmentId] => 578966572
    [shipmentDate] => 2018-05-14T13:37:37+02:00
    [shipmentItems] => Array
        (
            [0] => Array
                (
                    [orderItemId] => XXXXX
                    [orderId] =>XXXXX
                    [orderDate] => 2018-05-11T21:31:30+02:00
                    [latestDeliveryDate] => 2018-05-15
                    [ean] => XXXXX
                    [title] => Product Title
                    [quantity] => 1
                    [offerPrice] => 16.95
                    [offerCondition] => NEW
                    [fulfilmentMethod] => FBR
                )
        )
)

Library returns various errors:

1) In Shipment.php line 127: [InvalidArgumentException]
Key 'shipmentReference' is missing in data array or is not a string

() at /var/www/projects/bol.com-app/vendor/bol-com/retailer-api/src/Model/Shipment/Shipment.php:127 BolCom\RetailerApi\Model\Shipment\Shipment::fromArray() at /var/www/projects/bol.com-app/vendor/bol-com/retailer-api/src/Handler/Shipment/GetShipmentHandler.php:46 BolCom\RetailerApi\Handler\Shipment\GetShipmentHandler->__invoke() at /var/www/projects/bol.com-app/vendor/bol-com/retailer-api/src/Infrastructure/MessageBus.php:111

2) In ShipmentItem.php line 219:

[InvalidArgumentException]
Key 'offerReference' 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/Shipment/ShipmentItem.php:219 BolCom\RetailerApi\Model\Shipment\ShipmentItem::fromArray() at /var/www/projects/bol.com-app/vendor/bol-com/retailer-api/src/Model/Shipment/Shipment.php:143 BolCom\RetailerApi\Model\Shipment\Shipment::fromArray() at /var/www/projects/bol.com-app/vendor/bol-com/retailer-api/src/Handler/Shipment/GetShipmentHandler.php:46 BolCom\RetailerApi\Handler\Shipment\GetShipmentHandler->__invoke() at /var/www/projects/bol.com-app/vendor/bol-com/retailer-api/src/Infrastructure/MessageBus.php:111

3) In Shipment.php line 148:

[InvalidArgumentException]
Key 'transport' is missing in data array or is not an array

Exception trace: () at /var/www/projects/bol.com-app/vendor/bol-com/retailer-api/src/Model/Shipment/Shipment.php:148 BolCom\RetailerApi\Model\Shipment\Shipment::fromArray() at /var/www/projects/bol.com-app/vendor/bol-com/retailer-api/src/Handler/Shipment/GetShipmentHandler.php:46 BolCom\RetailerApi\Handler\Shipment\GetShipmentHandler->__invoke() at /var/www/projects/bol.com-app/vendor/bol-com/retailer-api/src/Infrastructure/MessageBus.php:111

4) In Shipment.php line 154:

[InvalidArgumentException]
Key 'customerDetails' is missing in data array or is not an array

Exception trace: () at /var/www/projects/bol.com-app/vendor/bol-com/retailer-api/src/Model/Shipment/Shipment.php:154 BolCom\RetailerApi\Model\Shipment\Shipment::fromArray() at /var/www/projects/bol.com-app/vendor/bol-com/retailer-api/src/Handler/Shipment/GetShipmentHandler.php:46 BolCom\RetailerApi\Handler\Shipment\GetShipmentHandler->__invoke() at /var/www/projects/bol.com-app/vendor/bol-com/retailer-api/src/Infrastructure/MessageBus.php:111

JeroenVanLeusden commented 4 years ago

Thanks for the detailed feedback!