打開範例GetItem.php
是不是看到有一段非常長的又討厭的code;
$requestXmlBody = '<?xml version="1.0" encoding="utf-8" ?>';
$requestXmlBody .= '<GetItemRequest xmlns="urn:ebay:apis:eBLBaseComponents">';
$requestXmlBody .= "<RequesterCredentials><eBayAuthToken>$userToken</eBayAuthToken></RequesterCredentials>";;
$requestXmlBody .= "<ItemID>$id</ItemID>";
$requestXmlBody .= '</GetItemRequest>';
老鷹這邊提供另一種方式來處理~~!
$requestXmlBody = <<<XML
<?xml version="1.0" encoding="utf-8"?>
<GetUserDisputesRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<RequesterCredentials>
<eBayAuthToken>$userToken</eBayAuthToken>
</RequesterCredentials>
<WarningLevel>High</WarningLevel>
<DisputeFilterType>AllInvolvedDisputes</DisputeFilterType>
<DisputeSortType>DisputeCreatedTimeDescending</DisputeSortType>
<Pagination>
<EntriesPerPage>5</EntriesPerPage>
<PageNumber>1</PageNumber>
</Pagination>
</GetUserDisputesRequest>
XML;
以上為GetUserDisputes呼叫~~!
這樣就可以直接從沙盤複製貼上過來使用~!
比較方便許多的寫法.
待續.....