首页 / PHP / php – Ebay Auth令牌
php – Ebay Auth令牌
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了php – Ebay Auth令牌,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2287字,纯文字阅读大概需要4分钟。
内容图文
![php – Ebay Auth令牌](/upload/InfoBanner/zyjiaocheng/726/a8d510f1ee384ac9bca844eec1146ac4.jpg)
我正在使用Sandbox Auth.令牌在这里它总是发送给我一个这样的错误.
错误:身份验证令牌无效. API请求中的身份验证令牌验证失败.
但如果我使用我的Production Auth.令牌似乎在锻炼,完全没有问题.
我还检查了我的Sandbox令牌的有效性,截止日期是2016年11月,这已经足够了.有人可以帮我解决我的问题吗?提前致谢.
这是代码:
require __DIR__.'/../vendor/autoload.php';
$config = require __DIR__.'/../configuration.php';
use \DTS\eBaySDK\Constants;
use \DTS\eBaySDK\Trading\Services;
use \DTS\eBaySDK\Trading\Types;
use \DTS\eBaySDK\Trading\Enums;
$service = new Services\TradingService(array(
'apiVersion' => $config['tradingApiVersion'],
'siteId' => Constants\SiteIds::US
));
$request = new Types\GetMyeBaySellingRequestType();
$request->RequesterCredentials = new Types\CustomSecurityHeaderType();
$request->RequesterCredentials->eBayAuthToken = $config['sandbox']['userToken'];
$request->ActiveList = new Types\ItemListCustomizationType();
$request->ActiveList->Include = true;
$request->ActiveList->Pagination = new Types\PaginationType();
$request->ActiveList->Pagination->EntriesPerPage = 10;
$request->ActiveList->Sort = Enums\ItemSortTypeCodeType::C_CURRENT_PRICE_DESCENDING;
$pageNum = 1;
do {
$request->ActiveList->Pagination->PageNumber = $pageNum;
$response = $service->getMyeBaySelling($request);
echo "==================\nResults for page $pageNum\n==================\n";
if (isset($response->Errors)) {
foreach ($response->Errors as $error) {
printf("%s: %s\n%s\n\n",
$error->SeverityCode === Enums\SeverityCodeType::C_ERROR ? 'Error' : 'Warning',
$error->ShortMessage,
$error->LongMessage
);
}
}
if ($response->Ack !== 'Failure' && isset($response->ActiveList)) {
foreach ($response->ActiveList->ItemArray->Item as $item) {
printf("(%s) %s: %s %.2f\n",
$item->ItemID,
$item->Title,
$item->SellingStatus->CurrentPrice->currencyID,
$item->SellingStatus->CurrentPrice->value
);
}
}
$pageNum += 1;
} while(isset($response->ActiveList) && $pageNum <= $response->ActiveList->PaginationResult->TotalNumberOfPages);
致David S. Sadler先生的致谢
解决方法:
默认情况下,SDK将连接到生产API.如果要使用沙箱API,只需在创建TradingService对象时将true传递给沙箱配置选项.可以获得所有configuration options的列表.
$service = new Services\TradingService(array(
'apiVersion' => $config['tradingApiVersion'],
'siteId' => Constants\SiteIds::US,
'sandbox' => true
));
内容总结
以上是互联网集市为您收集整理的php – Ebay Auth令牌全部内容,希望文章能够帮你解决php – Ebay Auth令牌所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。