-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWebhookPayload.php
More file actions
83 lines (72 loc) · 1.67 KB
/
Copy pathWebhookPayload.php
File metadata and controls
83 lines (72 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?php
declare(strict_types=1);
namespace Vatly\API\Webhooks;
/**
* Represents a parsed and verified incoming webhook payload from Vatly.
*
* @see \Vatly\API\Resources\WebhookEvent
*/
class WebhookPayload
{
/**
* Unique webhook event ID.
*
* @example webhook_event_Qk8pRtSvWm2NjLhYcZaE
*/
public string $id;
/**
* Resource type identifier.
*
* @example webhook_event
*/
public string $resource;
/**
* Name of the event that triggered this webhook.
*
* @see \Vatly\API\Types\WebhookEventName
* @example order.paid
*/
public string $eventName;
/**
* Type of the resource this event relates to.
*
* @example order
*/
public string $entityType;
/**
* ID of the resource this event relates to.
*
* @example order_Hn5xWqVfKm8RjTgYbUcP
*/
public string $entityId;
/**
* The full resource payload at the time of the event.
*
* @var object|null
*/
public ?object $object;
/**
* @example 2023-08-11T10:48:51+02:00
*/
public string $createdAt;
public bool $testmode;
public function __construct(
string $id,
string $resource,
string $eventName,
string $entityType,
string $entityId,
bool $testmode,
string $createdAt,
?object $object = null,
) {
$this->id = $id;
$this->resource = $resource;
$this->eventName = $eventName;
$this->entityType = $entityType;
$this->entityId = $entityId;
$this->object = $object;
$this->testmode = $testmode;
$this->createdAt = $createdAt;
}
}