脚本宝典收集整理的这篇文章主要介绍了php – 未能使用亚马逊MWS Reports API获取财务交易报告,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在使用相同的报告API请求许多其他报告,它们完美无缺.
请告诉我是否有人遇到同样的问题.
这是我用来请求报告的代码:
$sdate = new DateTime('-7 days',new DateTimeZone('UTC')); $startdate = $sdate->format("Y-m-d\T00:00:00P"); $edate = new DateTime('-1 days',new DateTimeZone('UTC')); $enddate = $edate->format("Y-m-d\T23:59:59P"); $AWS_ACCESS_KEY_ID = $pos['azn_access_key']; $AWS_SECRET_ACCESS_KEY = $pos['azn_secret_access_key']; $APPLICATION_NamE = $pos['azn_app_name']; $APPLICATION_VERSION = $pos['azn_app_version']; $MERCHANT_ID = $pos['azn_merchant_id']; $MARKETPLACE_ID = $pos['azn_marketplace_id']; $MERCHANT_TOKEN = $pos['azn_merchant_token']; $pos_name = $pos['nickname']; $pos_id = $pos['id']; $serviceURL = $pos['azn_service_url']; $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); $marketplaceidArray = array("Id" => array($MARKETPLACE_ID)); //Sends Report Request $parameters = array( 'Merchant' => $MERCHANT_ID,'MarketplaceIdList' => $marketplaceIdArray,'ReportTyPE' => '_GET_DATE_RANGE_FINANCIAL_TRANSACTION_DATA_','ReportOptions' => 'ShowSalesChannel=true','StartDate' => new DateTime($startdate,new DateTimeZone('UTC')),'EndDate' => new DateTime($enddate,); $request = new MarketplaceWebService_Model_RequestReportRequest($parameters); $request = new MarketplaceWebService_Model_RequestReportRequest(); $request->setMarketplaceIdList($marketplaceIdArray); $request->setMerchant($MERCHANT_ID); $request->setReportType('_GET_DATE_RANGE_FINANCIAL_TRANSACTION_DATA_'); $request->setReportOptions('ShowSalesChannel=true'); $request->setStartDate(new DateTime($startdate,new DateTimeZone('UTC'))); $request->setEndDate(new DateTime($enddate,new DateTimeZone('UTC'))); $report_requestID = invokeRequestReport($service,$request);
以上是脚本宝典为你收集整理的php – 未能使用亚马逊MWS Reports API获取财务交易报告全部内容,希望文章能够帮你解决php – 未能使用亚马逊MWS Reports API获取财务交易报告所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。