I have created a page using GetReport with a Settlement ID.
So far I'm able to get a data from Amazon Seller, but i am trying to figure out how to turn the report into a tidy table.
Here is my code:
function invokeGetReport(MarketplaceWebService_Interface $service, $request) {
try {
$response = $service->getReport($request);
echo ("<table class='table table-bordered table-striped table-hover table-condensed table-responsive'>\n");
echo ("<thead>");
echo ("<tr> ");
echo ("<th >Settlement ID</th> ");
echo ("<td>");
echo ("Settlement ID Report display here");
echo ("</td></tr>");
echo ("<tr> ");
echo ("<th>GetReportResponse\n</th> ");
echo ("<td>");
if ($response->isSetGetReportResult()) {
$getReportResult = $response->getGetReportResult();
echo (" GetReport");
echo ("</td></tr>");
}
//Report Content
echo ("<tr> ");
echo ("<th>Settlement ID</th> ");
echo ("<td>");
echo (stream_get_contents($request->getReport()) . "\n");
echo ("</td></tr>");
} catch (MarketplaceWebService_Exception $ex) {
echo("Caught Exception: " . $ex->getMessage() . "\n");
echo("Response Status Code: " . $ex->getStatusCode() . "\n");
echo("Error Code: " . $ex->getErrorCode() . "\n");
echo("Error Type: " . $ex->getErrorType() . "\n");
echo("Request ID: " . $ex->getRequestId() . "\n");
echo("XML: " . $ex->getXML() . "\n");
echo("ResponseHeaderMetadata: " . $ex->getResponseHeaderMetadata() . "\n");
echo ("</td></tr>");
echo ("</table>\n");
}
}
As you can see:
stream_get_contents($request->getReport())
is where I pull the Settlement Report, however, I want getReport()
to breakdown into more details in a tidy table, at the moment it looks like this
I was hoping for more like this