davidtsadler / ebay-sdk-php

An eBay SDK for PHP. Use the eBay API in your PHP projects.
Apache License 2.0
349 stars 341 forks source link

Shipping Cost not returned in findCompletedItems if SearchItem->shippingInfo->shippingType = Calculated #188

Closed rbur0425 closed 6 years ago

rbur0425 commented 6 years ago

I am getting the results of a findCompletedItemsRequest and I was going through the results and I noticed some of the shipping costs were not being added to the total price as my code does. I combed through the data and found that any SearchItem that is returned with shippingInfo->shippingType = Calculated there is no shippingServiceCost->value. Does anyone know how to get the cost of shipping for these items? Please see example below -

SearchItem {#1589 ▼
  -values: array:18 [▼
    "itemId" => "202262248525"
    "title" => "2008 coffee mug Starbucks 18 oz. HOUSTON White & Blue Magnolia city Architecture"
    "globalId" => "EBAY-US"
    "primaryCategory" => Category {#1604 ▼
      -values: array:2 [▼
        "categoryId" => "10795"
        "categoryName" => "Starbucks"
      ]
      -attachment: array:2 [▶]
    }
    "galleryURL" => "http://thumbs2.ebaystatic.com/m/mnMWUd_Jf5F7zGqet648Iag/140.jpg"
    "viewItemURL" => "http://www.ebay.com/itm/2008-coffee-mug-Starbucks-18-oz-HOUSTON-White-Blue-Magnolia-city-Architecture-/202262248525"
    "paymentMethod" => RepeatableType {#1603 ▼
      -data: array:1 [▼
        0 => "PayPal"
      ]
      -position: 0
      -class: "DTS\eBaySDK\Finding\Types\SearchItem"
      -property: "paymentMethod"
      -expectedType: "string"
    }
    "autoPay" => true
    "postalCode" => "66223"
    "location" => "Overland Park,KS,USA"
    "country" => "US"
    "shippingInfo" => ShippingInfo {#1605 ▼
      -values: array:5 [▼
        "shippingType" => "Calculated"
        "shipToLocations" => RepeatableType {#1608 ▼
          -data: array:1 [▼
            0 => "Worldwide"
          ]
          -position: 0
          -class: "DTS\eBaySDK\Finding\Types\ShippingInfo"
          -property: "shipToLocations"
          -expectedType: "string"
        }
        "expeditedShipping" => true
        "oneDayShippingAvailable" => false
        "handlingTime" => 3
      ]
      -attachment: array:2 [▶]
    }
    "sellingStatus" => SellingStatus {#1606 ▼
      -values: array:3 [▼
        "currentPrice" => Amount {#1607 ▼
          -values: array:2 [▼
            "currencyId" => "USD"
            "value" => 5.6
          ]
          -attachment: array:2 [▼
            "data" => null
            "mimeType" => null
          ]
        }
        "convertedCurrentPrice" => Amount {#1610 ▼
          -values: array:2 [▼
            "currencyId" => "USD"
            "value" => 5.6
          ]
          -attachment: array:2 [▶]
        }
        "sellingState" => "EndedWithSales"
      ]
      -attachment: array:2 [▶]
    }
    "listingInfo" => ListingInfo {#1609 ▼
      -values: array:6 [▼
        "bestOfferEnabled" => true
        "buyItNowAvailable" => false
        "startTime" => DateTime @1521143134 {#1611 ▼
          date: 2018-03-15 19:45:34.0 +00:00
        }
        "endTime" => DateTime @1524022008 {#1613 ▼
          date: 2018-04-18 03:26:48.0 +00:00
        }
        "listingType" => "FixedPrice"
        "gift" => false
      ]
      -attachment: array:2 [▶]
    }
    "returnsAccepted" => false
    "condition" => Condition {#1614 ▼
      -values: array:2 [▼
        "conditionId" => 1000
        "conditionDisplayName" => "New"
      ]
      -attachment: array:2 [▼
        "data" => null
        "mimeType" => null
      ]
    }
    "isMultiVariationListing" => false
    "topRatedListing" => false
  ]
  -attachment: array:2 [▼
    "data" => null
    "mimeType" => null
  ]
}

vs one with the shippingServiceCost->value field -

SearchItem {#1574 ▼
  -values: array:17 [▼
    "itemId" => "182823719658"
    "title" => "deleted 4116e42a-620d-47c1-81ce-2bd13752cd1e"
    "globalId" => "EBAY-US"
    "primaryCategory" => Category {#1577 ▶}
    "galleryURL" => "http://thumbs3.ebaystatic.com/m/m0WfTWMbOCw8_HQSi-3vfdg/140.jpg"
    "viewItemURL" => "http://www.ebay.com/itm/deleted-4116e42a-620d-47c1-81ce-2bd13752cd1e-/182823719658"
    "paymentMethod" => RepeatableType {#1576 ▶}
    "autoPay" => true
    "location" => "USA"
    "country" => "US"
    "shippingInfo" => ShippingInfo {#1579 ▼
      -values: array:6 [▼
        "shippingServiceCost" => Amount {#1580 ▼
          -values: array:2 [▼
            "currencyId" => "USD"
            "value" => 0.0
          ]
          -attachment: array:2 [▶]
        }
        "shippingType" => "Free"
        "shipToLocations" => RepeatableType {#1582 ▶}
        "expeditedShipping" => true
        "oneDayShippingAvailable" => true
        "handlingTime" => 0
      ]
      -attachment: array:2 [▶]
    }
    "sellingStatus" => SellingStatus {#1578 ▶}
    "listingInfo" => ListingInfo {#1583 ▶}
    "returnsAccepted" => true
    "condition" => Condition {#1588 ▶}
    "isMultiVariationListing" => false
    "topRatedListing" => false
  ]
  -attachment: array:2 [▶]
}
michabbb commented 6 years ago

That's not a question about this SDK, it's about using the ebay api, there for you should place your questions at the official eBay forum.

michabbb commented 6 years ago

@rbur0425 to be fair: if a return field is missing with the SDK but you get it with a raw request via the ebay api test tool and you can be sure that you use the same detaillevel etc. than it might be a bug, but before you should check that with the test tool.