【发布时间】:2014-11-14 11:26:03
【问题描述】:
我已从亚马逊卖家中心订购此交易报告,因为无法从报告的 API 请求。 现在我正在尝试使用运行良好的报告 api 下载此报告,但现在我正在尝试将报告类型设置为“_GET_DATE_RANGE_FINANCIAL_TRANSACTION_DATA_”,以便仅获得此类报告的请求报告列表。 我正在使用下面的代码,但它给了我这个错误
"致命错误:在非对象上调用成员函数 getType() /AmazonAPI/ReportsAPIClass/src/MarketplaceWebService/Client.php 上 第 1605 行"
$config = array(
'ServiceURL' => $serviceURL,
'ProxyHost' => null,
'ProxyPort' => -1,
'MaxErrorRetry' => 3,
);
$service = new MarketplaceWebService_Client(
$AWS_ACCESS_KEY_ID, $AWS_SECRET_ACCESS_KEY, $config, $APPLICATION_NAME, $APPLICATION_VERSION);
//===========================GETS REPORT ID
$request_report_list = new MarketplaceWebService_Model_GetReportListRequest();
$request_report_list->setMerchant($MERCHANT_ID);
$request_report_list->setAcknowledged(false);
$request_report_list->setMarketplace($MARKETPLACE_ID);
$request_report_list->setReportTypeList(array("TypeList" => "_GET_DATE_RANGE_FINANCIAL_TRANSACTION_DATA_"));
【问题讨论】:
-
删除行号中的“getType()”后工作正常。 Client.php 中的 1605 所以从 foreach ($reportTypeList->getType() as $typeIndex => $type) 到 "foreach ($reportTypeList as $typeIndex => $type)"
标签: php api amazon-web-services amazon amazon-mws