hypeit / tradetracker-api-client
TradeTracker API 客户端
v0.5.0
2022-11-17 10:51 UTC
Requires
- php: >=7.1
Requires (Dev)
- phpunit/phpunit: ^7.2
This package is not auto-updated.
Last update: 2024-09-20 21:32:29 UTC
README
一个用于与 Web 服务通信并将结果映射到实际模型对象的 TradeTracker API 客户端。
安装
您可以通过 composer 安装此软件包。
$ composer require hypeit/tradetracker-api-client
为了使用客户端,您必须配置身份验证。
$authentication = new Authentication( 12345, // The customer id 'passphrase', // The passphrase true, // Whether to not allow changes (optional) 'en_GB', // The locale to be used for results. (optional) false // Whether to receive demo results. (optional) );
然后将 wsdl 和身份验证对象注入到客户端中。
$client = new TradeTrackerClient('http://ws.tradetracker.com/soap/affiliate?wsdl', $authenticate);
使用方法
调用客户端方法以初始化 API 调用
$affiliateSites = $client->getAffiliateSites();
常见方法包括
- getAffiliateSites
- getCampaigns
- getClickTransactions
- getConversionTransactions
- getTransactions
- getReportAffiliateSite
- getReportCampaign
- getFeeds
- getFeedProductCategories
- getFeedProducts
某些方法调用可以有一个可选的过滤器
$filter = new AffiliateSiteFilter(); $filter->setLimit(5); $affiliateSites = $client->getAffiliateSites($filter);
测试
$ composer test
许可证
MIT 许可证 (MIT)。有关更多信息,请参阅 许可证文件。