REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 1.40 KB
Close
/home/nshryvcy/radiantskinclinics.org/wp-content/plugins/wpforms-lite/src/Integrations/Square/Api/WebhookEvent.php
Text
Base64
<?php namespace WPForms\Integrations\Square\Api; use RuntimeException; use WPForms\Integrations\Square\Helpers; use WPForms\Vendor\Square\Utils\WebhooksHelper; /** * Webhook event handler. * * @since 1.9.5 */ class WebhookEvent { /** * Construct and validate the Square webhook event. * * @since 1.9.5 * * @param string $payload The raw JSON payload from Square. * @param string $signature The Square webhook signature from headers. * @param string $webhook_secret The webhook signing secret from Square Developer Dashboard. * * @return object The decoded event data. * * @throws RuntimeException If the webhook payload structure is invalid. */ public static function construct_event( string $payload, string $signature, string $webhook_secret ) { // Validate the webhook signature. if ( ! WebhooksHelper::isValidWebhookEventSignature( $payload, $signature, $webhook_secret, Helpers::get_webhook_url() ) ) { throw new RuntimeException( 'Invalid webhook signature. Possible unauthorized request.' ); } // Decode JSON payload. $event = json_decode( $payload, false ); // Check for JSON decoding errors. if ( json_last_error() !== JSON_ERROR_NONE ) { throw new RuntimeException( 'Invalid JSON payload' ); } if ( ! $event || ! isset( $event->type, $event->data ) ) { throw new RuntimeException( 'Invalid webhook payload structure.' ); } return $event; } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 4
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
Webhooks
DIR
-
drwxr-xr-x
2026-06-04 03:43:03
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Api.php
43.79 KB
lrw-r--r--
2025-04-24 14:53:30
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
WebhookEvent.php
1.40 KB
lrw-r--r--
2025-04-24 14:53:30
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
WebhookRoute.php
7.67 KB
lrw-r--r--
2025-04-24 14:53:30
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
WebhooksManager.php
5.69 KB
lrw-r--r--
2025-04-24 14:53:30
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).