Cdiscount / API-MarketPlace-SDK-PHP

15 stars 42 forks source link

Undefined index: RefundShippingCharges in API-MarketPlace-SDK-PHP\sdk\src\core\Soap\Order\GetOrderListResponse.php on line 320 #10

Open R-Wirtz opened 7 years ago

R-Wirtz commented 7 years ago

Hi, I get the following message when using getOrderList: "Notice: Undefined index: RefundShippingCharges in API-MarketPlace-SDK-PHP\sdk\src\core\Soap\Order\GetOrderListResponse.php on line 320"

The reason for that is that "RefundShippingCharges" is not in the xml data which I get as response, so the index cannot be created. As a simple fix I suggest to change line 320 to the following:

if (@$orderLineListOBJ['RefundShippingCharges'] == 'true') {

Thanks, Robert

fabianblum commented 7 years ago

Do add a @ is a very bad coding style.

Better check if the key exist in the if like

if (isset($orderLineListOBJ['RefundShippingCharges']) && $orderLineListOBJ['RefundShippingCharges'] == 'true') {