????JFIF??x?x????'
Server IP : 104.21.96.1 / Your IP : 216.73.216.145 Web Server : LiteSpeed System : Linux premium151.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64 User : tempvsty ( 647) PHP Version : 8.0.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/self/cwd/wp-content/plugins/wpforms-lite/vendor_prefixed/square/square/src/Apis/ |
Upload File : |
<?php declare (strict_types=1); namespace WPForms\Vendor\Square\Apis; use WPForms\Vendor\Core\Request\Parameters\BodyParam; use WPForms\Vendor\Core\Request\Parameters\HeaderParam; use WPForms\Vendor\Core\Request\Parameters\QueryParam; use WPForms\Vendor\CoreInterfaces\Core\Request\RequestMethod; use WPForms\Vendor\Square\Http\ApiResponse; use WPForms\Vendor\Square\Models\DisableEventsResponse; use WPForms\Vendor\Square\Models\EnableEventsResponse; use WPForms\Vendor\Square\Models\ListEventTypesResponse; use WPForms\Vendor\Square\Models\SearchEventsRequest; use WPForms\Vendor\Square\Models\SearchEventsResponse; class EventsApi extends BaseApi { /** * Search for Square API events that occur within a 28-day timeframe. * * @param SearchEventsRequest $body An object containing the fields to POST for the request. See * the corresponding object definition for field details. * * @return ApiResponse Response from the API call */ public function searchEvents(SearchEventsRequest $body) : ApiResponse { $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/events')->auth('global')->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body)); $_resHandler = $this->responseHandler()->type(SearchEventsResponse::class)->returnApiResponse(); return $this->execute($_reqBuilder, $_resHandler); } /** * Disables events to prevent them from being searchable. * All events are disabled by default. You must enable events to make them searchable. * Disabling events for a specific time period prevents them from being searchable, even if you re- * enable them later. * * @return ApiResponse Response from the API call */ public function disableEvents() : ApiResponse { $_reqBuilder = $this->requestBuilder(RequestMethod::PUT, '/v2/events/disable')->auth('global'); $_resHandler = $this->responseHandler()->type(DisableEventsResponse::class)->returnApiResponse(); return $this->execute($_reqBuilder, $_resHandler); } /** * Enables events to make them searchable. Only events that occur while in the enabled state are * searchable. * * @return ApiResponse Response from the API call */ public function enableEvents() : ApiResponse { $_reqBuilder = $this->requestBuilder(RequestMethod::PUT, '/v2/events/enable')->auth('global'); $_resHandler = $this->responseHandler()->type(EnableEventsResponse::class)->returnApiResponse(); return $this->execute($_reqBuilder, $_resHandler); } /** * Lists all event types that you can subscribe to as webhooks or query using the Events API. * * @param string|null $apiVersion The API version for which to list event types. Setting this * field overrides the default version used by the application. * * @return ApiResponse Response from the API call */ public function listEventTypes(?string $apiVersion = null) : ApiResponse { $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/events/types')->auth('global')->parameters(QueryParam::init('api_version', $apiVersion)); $_resHandler = $this->responseHandler()->type(ListEventTypesResponse::class)->returnApiResponse(); return $this->execute($_reqBuilder, $_resHandler); } }