Read from the package's own PHP files at the commit 16dd5a5e2f86: its namespaces, classes, interfaces and enums, their public constants, properties and methods with their PHPDoc, and the options its factories take. Nothing of it is run.
TrustpilotGatewayclassTrustpilot: the TrustScore (Data Solutions API), the reviews and the profile's links (public API, the API key), replying and inviting (the business user's OAuth token: client credentials, the business user's id).
11 methods · 3 constants
TrustpilotGatewayFactoryclassTrustpilot.
8 options · 1 method
Omnireview\Trustpilot
TrustpilotGateway class
final class TrustpilotGateway implements RatingInterface, ReviewsInterface, ReplyInterface, InviteInterface, WriteUrlInterface TrustpilotGateway.php:29
Trustpilot: the TrustScore (Data Solutions API), the reviews and the profile's links (public API, the API key), replying and inviting (the business user's OAuth token: client credentials, the business user's id).
A Place is a business unit ID - found once by the site's domain, and kept.
const API = 'https://api.trustpilot.com/v1/'const DATA = 'https://datasolutions.trustpilot.com/v1/'const INVITATIONS = 'https://invitations-api.trustpilot.com/v1/'
TrustpilotGateway::__construct()
public function __construct(readonly HttpClientInterface $http, readonly string $apiKey, readonly ?string $apiSecret = null, readonly ?string $businessUserId = null, readonly string $locale = 'fr-FR', readonly ?string $templateId = null, readonly ?string $replyTo = null, readonly ?string $senderName = null, readonly ?string $senderEmail = null)TrustpilotGateway::getName()
public function getName(): stringTrustpilotGateway::getTitle()
public function getTitle(): stringTrustpilotGateway::capabilities()
public function capabilities(): CapabilitiesTrustpilotGateway::terms()
public function terms(): TermsTrustpilotGateway::find()
public function find(string $domain): PlaceThe business unit of a domain: once, then keep its ID.
TrustpilotGateway::rating()
public function rating(Place $place): RatingTrustpilotGateway::reviews()
public function reviews(Place $place, int $limit = 5, ?string $language = null): arrayTrustpilotGateway::reply()
public function reply(Place $place, Review $review, string $text): ReplyTrustpilotGateway::invite()
public function invite(Place $place, Invitation $invitation): ?stringTrustpilotGateway::writeUrl()
public function writeUrl(Place $place): stringTrustpilotGatewayFactory class
final class TrustpilotGatewayFactory extends GatewayFactory TrustpilotGatewayFactory.php:25
Trustpilot.
options: api_key: '%env(TRUSTPILOT_API_KEY)%' # required: the TrustScore, the reviews, the links locale: fr-FR # the profile's links (/web-links); an invitation's is its own Invitation::$locale # replying and inviting: the business user's token api_secret: '%env(default::TRUSTPILOT_API_SECRET)%' business_user_id: '%env(default::TRUSTPILOT_BUSINESS_USER_ID)%' template_id: ~ # the invitation's template reply_to: ~ sender_name: ~ sender_email: ~
Options
| Option | Default | |
|---|---|---|
locale | 'fr-FR' | |
api_secret | null | |
business_user_id | null | |
template_id | null | |
reply_to | null | |
sender_name | null | |
sender_email | null | |
api_key | required |
TrustpilotGatewayFactory::__construct()
public function __construct(readonly ?HttpClientInterface $http = null)