itspirit/trustpilot-authenticator

用于获取Trustpilot API访问令牌的PHP库

1.0.0 2017-07-05 06:11 UTC

This package is auto-updated.

Last update: 2024-09-29 02:40:16 UTC


README

Latest Stable Version Total Downloads License

这是一个用于获取Trustpilot 商户API访问令牌的PHP库。

安装

使用 composer 进行安装

composer install itspirit/trustpilot-authenticator

使用方法

$authenticator = new Trustpilot\Api\Authenticator\Authenticator($apiKey, $apiToken, $username, $password);

$accessToken = $authenticator->getAccessToken();

// $accessToken->getToken(): string
// $accessToken->hasExpired(): bool
// $accessToken->getExpiry(): \DateTimeImmutable
// $accessToken->serialize(): string

测试

此包使用Codeception进行测试。要运行测试,只需输入

vendor/bin/codecept run