question

swappart avatar image
0 Likes"
swappart asked

Get actual shipping cost from selling manager when buyer combined items in cart.

Below is my code which has worked fine for weeks until today when a buyer combined items in cart. When items have been combined in cart, ActualShippingCost is not returned. I'd imagine it would also happen if I combined orders for shipping, but I don't have any such orders to test with at the moment. public double getShippingCost(String orderLineItemID) { ApiContext apiContext = null; try { // Retrieves stored token. apiContext = AuthToken.getApiContext(); } catch (IOException e1) { e1.printStackTrace(); } catch (SQLException e) { e.printStackTrace(); } GetSellingManagerSaleRecordCall api = new GetSellingManagerSaleRecordCall(apiContext); DetailLevelCodeType[] detailLevels = new DetailLevelCodeType[] { DetailLevelCodeType.RETURN_ALL, }; api.setDetailLevel(detailLevels); api.setOrderLineItemID(orderLineItemID); SellingManagerSoldOrderType record = null; try { // Retrieves requested sales record. record = api.getSellingManagerSaleRecord(); } catch (Exception e) { e.printStackTrace(); } Double cost = null; // Prevents NPE when ActualShippingCost is not returned. if (record.getActualShippingCost() != null) { cost = record.getActualShippingCost().getValue(); } else { cost = 0.0; } return cost; }
selling-managercombined paymentsactualshippingcostcombined shippingsales record
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

· Write an Answer

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.