-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModels.php
More file actions
149 lines (130 loc) · 4.45 KB
/
Models.php
File metadata and controls
149 lines (130 loc) · 4.45 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<?php
class User {
public $id;
public $is_bot;
public $first_name;
public $last_name;
public $username;
public $language_code;
public function __construct($data) {
$this->id = $data['id'] ?? null;
$this->is_bot = $data['is_bot'] ?? false;
$this->first_name = $data['first_name'] ?? null;
$this->last_name = $data['last_name'] ?? null;
$this->username = $data['username'] ?? null;
$this->language_code = $data['language_code'] ?? null;
}
}
class Chat {
public $id;
public $type;
public $title;
public $username;
public $first_name;
public $last_name;
public function __construct($data) {
$this->id = $data['id'] ?? null;
$this->type = $data['type'] ?? null;
$this->title = $data['title'] ?? null;
$this->username = $data['username'] ?? null;
$this->first_name = $data['first_name'] ?? null;
$this->last_name = $data['last_name'] ?? null;
}
}
class Message {
public $message_id;
public $from;
public $date;
public $chat;
public $text;
public $entities;
public function __construct($data) {
$this->message_id = $data['message_id'] ?? null;
$this->from = isset($data['from']) ? new User($data['from']) : null;
$this->date = $data['date'] ?? null;
$this->chat = isset($data['chat']) ? new Chat($data['chat']) : null;
$this->text = $data['text'] ?? null;
$this->entities = $data['entities'] ?? null;
}
}
class Update {
public $update_id;
public $message;
public $edited_message;
public $callback_query;
public $pre_checkout_query;
public function __construct($data) {
$this->update_id = $data['update_id'] ?? null;
$this->message = isset($data['message']) ? new Message($data['message']) : null;
$this->edited_message = isset($data['edited_message']) ? new Message($data['edited_message']) : null;
$this->callback_query = isset($data['callback_query']) ? new CallbackQuery($data['callback_query']) : null;
$this->pre_checkout_query = isset($data['pre_checkout_query']) ? new PreCheckoutQuery($data['pre_checkout_query']) : null;
}
}
class CallbackQuery {
public $id;
public $from;
public $message;
public $data;
public function __construct($data) {
$this->id = $data['id'] ?? null;
$this->from = isset($data['from']) ? new User($data['from']) : null;
$this->message = isset($data['message']) ? new Message($data['message']) : null;
$this->data = $data['data'] ?? null;
}
}
class PreCheckoutQuery {
public $id;
public $from;
public $currency;
public $total_amount;
public $invoice_payload;
public function __construct($data) {
$this->id = $data['id'] ?? null;
$this->from = isset($data['from']) ? new User($data['from']) : null;
$this->currency = $data['currency'] ?? null;
$this->total_amount = $data['total_amount'] ?? null;
$this->invoice_payload = $data['invoice_payload'] ?? null;
}
}
class File {
public $file_id;
public $file_unique_id;
public $file_size;
public $file_path;
public function __construct($data) {
$this->file_id = $data['file_id'] ?? null;
$this->file_unique_id = $data['file_unique_id'] ?? null;
$this->file_size = $data['file_size'] ?? null;
$this->file_path = $data['file_path'] ?? null;
}
}
class SuccessfulPayment {
public $currency;
public $total_amount;
public $invoice_payload;
public $telegram_payment_charge_id;
public $provider_payment_charge_id;
public function __construct($data) {
$this->currency = $data['currency'] ?? null;
$this->total_amount = $data['total_amount'] ?? null;
$this->invoice_payload = $data['invoice_payload'] ?? null;
$this->telegram_payment_charge_id = $data['telegram_payment_charge_id'] ?? null;
$this->provider_payment_charge_id = $data['provider_payment_charge_id'] ?? null;
}
}
class Transaction {
public $id;
public $status;
public $userID;
public $amount;
public $createdAt;
public function __construct($data) {
$this->id = $data['id'] ?? null;
$this->status = $data['status'] ?? null;
$this->userID = $data['userID'] ?? null;
$this->amount = $data['amount'] ?? null;
$this->createdAt = $data['createdAt'] ?? null;
}
}
?>