clsystems / tt-api-client
TradeTracker API 客户端
v1.0.0
2020-04-24 07:13 UTC
Requires
- php: >=7.2
- ext-soap: *
Requires (Dev)
- phpunit/phpunit: ^7.2
This package is auto-updated.
Last update: 2024-09-25 16:24:11 UTC
README
TradeTracker API 客户端,用于与 web 服务通信并将结果映射到真实模型对象。
安装
您可以通过 composer 安装此包。
$ composer require clsystems/tt-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
- getMaterialItems
- getClickTransactions
- getConversionTransactions
- getTransactions
- getReportAffiliateSite
- getReportCampaign
- getFeeds
- getFeedProductCategories
- getFeedProducts
某些方法调用可以有可选的过滤器
$filter = new AffiliateSiteFilter(); $filter->setLimit(5); $affiliateSites = $client->getAffiliateSites($filter);
测试
$ composer test
许可证
MIT 许可证 (MIT)。有关更多信息,请参阅许可证文件。