keithbrink / amazon-mws-laravel

A Laravel library for Amazon's MWS web services, supporting Laravel 5-8+
Apache License 2.0
27 stars 23 forks source link

AmazonOrderList returns empty array #41

Closed allanshelly closed 4 years ago

allanshelly commented 4 years ago

AmazonOrderList returns empty array when used as an API end point for a laravel app

allanshelly commented 4 years ago

public function getAmazonOrders() { ini_set('max_execution_time', 1444); $amz = new AmazonOrderList("rockymountainoils"); $amz->setLimits('Modified', "- 720 hours"); $amz->setUseToken(); $amz->fetchOrders(); return $amz->getList(); }

this function returns the following image

allanshelly commented 4 years ago

fairly new to php and laravel in general. but there are no viable resources for laravel mws integration besides this repo and would love to receive some guidance of what im doing wrong

keithbrink commented 4 years ago

You need to get the data from each order:

$order_list = new AmazonOrderList(....);
...
$orders = $order_list->getList();
foreach($orders as $order) {
    $order_data = $order->getData();
}