2014-11-14 6 views
2

보고서의 API에서 요청할 수 없기 때문에이 거래 보고서를 Amazon 판매자 센터에서 주문했습니다. 이제 제대로 작동하는 report api를 사용하여이 보고서를 다운로드하려고합니다. 그러나 이제 보고서 유형을 "_GET_DATE_RANGE_FINANCIAL_TRANSACTION_DATA_"(으)로 설정하여이 보고서 유형에만 요청 된 보고서 목록을 가져 오려고합니다. 내가 코드 아래 사용하고 있지만, 그것은 나에게이 오류Amazon MWS 보고서 api에 대한 보고서 유형을 설정하는 방법

"Fatal error: Call to a member function getType() on a non-object in /AmazonAPI/ReportsAPIClass/src/MarketplaceWebService/Client.php on line 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_")); 
+0

잘 작동 매개 변수로 보내야을주고 "getType로() "라인 번호. 1605 to Client.php "foreach ($ reportTypeList-> getType() $ typeIndex => $ type) $ foreach ($ reportTypeList as $ typeIndex => $ type)" –

답변

4

당신이 형 typelist의 클래스를 생성하고 제거한 후

$TypeList = new MarketplaceWebService_Model_TypeList(); 
$TypeList->setType('_GET_DATE_RANGE_FINANCIAL_TRANSACTION_DATA_'); 
$request_report_list->setReportTypeList($TypeList); 
+0

"getType()"을 제거한 후에 제대로 작동합니다. 라인 번호. 1605 Client.php 그래서 foreach ($ reportTypeList-> getType() $ typeIndex => $ type)에서 "foreach ($ reportTypeList as $ typeIndex => $ type)" –

+0

물론 공식을 변경하고 있습니다. 라이브러리, 라이브러리에 문제가되지 않습니다, 문제는 매개 변수가 올바르지 않다는 것이지만 작동한다면 더 걱정하지 마십시오. – mameyugo

+0

Ooh Thanks @mameyugo 아마존이 API에 대한 더 나은 문서 작업을 시작하기를 바랍니다. –