1 | <?php |
||
9 | class WebhookServer |
||
10 | { |
||
11 | /** |
||
12 | * @var WebhookAuthenticator |
||
13 | */ |
||
14 | protected $webhookAuthenticator; |
||
15 | |||
16 | /** |
||
17 | * @var callable |
||
18 | */ |
||
19 | protected $webhookCallback; |
||
20 | |||
21 | /** |
||
22 | * @param callable $webhookCallback |
||
23 | * @param string $projectSecretKey |
||
24 | * |
||
25 | * @return WebhookServer |
||
26 | */ |
||
27 | public static function create($webhookCallback, $projectSecretKey) |
||
31 | |||
32 | /** |
||
33 | * @param callable $webhookCallback |
||
34 | * @param WebhookAuthenticator $webhookAuthenticator |
||
35 | * |
||
36 | * @throws XsollaWebhookException |
||
37 | */ |
||
38 | public function __construct($webhookCallback, WebhookAuthenticator $webhookAuthenticator) |
||
46 | |||
47 | /** |
||
48 | * @param WebhookRequest $webhookRequest |
||
49 | * @param bool $authenticateClientIp |
||
50 | */ |
||
51 | public function start(WebhookRequest $webhookRequest = null, $authenticateClientIp = true) |
||
56 | |||
57 | /** |
||
58 | * @param WebhookRequest $webhookRequest |
||
59 | * @param bool $authenticateClientIp |
||
60 | * |
||
61 | * @return Response |
||
62 | */ |
||
63 | public function getSymfonyResponse(WebhookRequest $webhookRequest = null, $authenticateClientIp = true) |
||
81 | } |
||
82 |