|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
namespace Bip70\Protobuf\Proto; |
|
6
|
|
|
|
|
7
|
|
|
use DrSlump\Protobuf; |
|
8
|
|
|
use DrSlump\Protobuf\Descriptor; |
|
9
|
|
|
use DrSlump\Protobuf\Field; |
|
10
|
|
|
use DrSlump\Protobuf\Message; |
|
11
|
|
|
|
|
12
|
|
|
class PaymentRequest extends Message |
|
13
|
|
|
{ |
|
14
|
|
|
|
|
15
|
|
|
/** @var int */ |
|
16
|
|
|
public $payment_details_version = 1; |
|
17
|
|
|
|
|
18
|
|
|
/** @var string */ |
|
19
|
|
|
public $pki_type = 'none'; |
|
20
|
|
|
|
|
21
|
|
|
/** @var string */ |
|
22
|
|
|
public $pki_data ; |
|
23
|
|
|
|
|
24
|
|
|
/** @var string */ |
|
25
|
|
|
public $serialized_payment_details ; |
|
26
|
|
|
|
|
27
|
|
|
/** @var string */ |
|
28
|
|
|
public $signature ; |
|
29
|
|
|
|
|
30
|
|
|
/** @var \Closure[] */ |
|
31
|
|
|
protected static $__extensions = array(); |
|
32
|
|
|
|
|
33
|
1 |
|
public static function descriptor() |
|
34
|
|
|
{ |
|
35
|
1 |
|
$descriptor = new Descriptor(__CLASS__, 'payments.PaymentRequest'); |
|
36
|
|
|
|
|
37
|
|
|
// OPTIONAL UINT32 payment_details_version = 1 |
|
38
|
1 |
|
$f = new Field(); |
|
39
|
1 |
|
$f->number = 1; |
|
40
|
1 |
|
$f->name = 'payment_details_version'; |
|
41
|
1 |
|
$f->type = Protobuf::TYPE_UINT32; |
|
42
|
1 |
|
$f->rule = Protobuf::RULE_OPTIONAL; |
|
43
|
1 |
|
$f->default = 1; |
|
44
|
1 |
|
$descriptor->addField($f); |
|
45
|
|
|
|
|
46
|
|
|
// OPTIONAL STRING pki_type = 2 |
|
47
|
1 |
|
$f = new Field(); |
|
48
|
1 |
|
$f->number = 2; |
|
49
|
1 |
|
$f->name = 'pki_type'; |
|
50
|
1 |
|
$f->type = Protobuf::TYPE_STRING; |
|
51
|
1 |
|
$f->rule = Protobuf::RULE_OPTIONAL; |
|
52
|
1 |
|
$f->default = 'none'; |
|
53
|
1 |
|
$descriptor->addField($f); |
|
54
|
|
|
|
|
55
|
|
|
// OPTIONAL BYTES pki_data = 3 |
|
56
|
1 |
|
$f = new Field(); |
|
57
|
1 |
|
$f->number = 3; |
|
58
|
1 |
|
$f->name = 'pki_data'; |
|
59
|
1 |
|
$f->type = Protobuf::TYPE_BYTES; |
|
60
|
1 |
|
$f->rule = Protobuf::RULE_OPTIONAL; |
|
61
|
1 |
|
$descriptor->addField($f); |
|
62
|
|
|
|
|
63
|
|
|
// REQUIRED BYTES serialized_payment_details = 4 |
|
64
|
1 |
|
$f = new Field(); |
|
65
|
1 |
|
$f->number = 4; |
|
66
|
1 |
|
$f->name = 'serialized_payment_details'; |
|
67
|
1 |
|
$f->type = Protobuf::TYPE_BYTES; |
|
68
|
1 |
|
$f->rule = Protobuf::RULE_REQUIRED; |
|
69
|
1 |
|
$descriptor->addField($f); |
|
70
|
|
|
|
|
71
|
|
|
// OPTIONAL BYTES signature = 5 |
|
72
|
1 |
|
$f = new Field(); |
|
73
|
1 |
|
$f->number = 5; |
|
74
|
1 |
|
$f->name = 'signature'; |
|
75
|
1 |
|
$f->type = Protobuf::TYPE_BYTES; |
|
76
|
1 |
|
$f->rule = Protobuf::RULE_OPTIONAL; |
|
77
|
1 |
|
$descriptor->addField($f); |
|
78
|
|
|
|
|
79
|
1 |
|
foreach (self::$__extensions as $cb) { |
|
80
|
|
|
$descriptor->addField($cb(), true); |
|
81
|
|
|
} |
|
82
|
|
|
|
|
83
|
1 |
|
return $descriptor; |
|
84
|
|
|
} |
|
85
|
|
|
|
|
86
|
|
|
/** |
|
87
|
|
|
* Check if <payment_details_version> has a value |
|
88
|
|
|
* |
|
89
|
|
|
* @return boolean |
|
90
|
|
|
*/ |
|
91
|
5 |
|
public function hasPaymentDetailsVersion() |
|
92
|
|
|
{ |
|
93
|
5 |
|
return $this->_has(1); |
|
94
|
|
|
} |
|
95
|
|
|
|
|
96
|
|
|
/** |
|
97
|
|
|
* Clear <payment_details_version> value |
|
98
|
|
|
* |
|
99
|
|
|
* @return \Bip70\Protobuf\Proto\PaymentRequest |
|
100
|
|
|
*/ |
|
101
|
1 |
|
public function clearPaymentDetailsVersion() |
|
102
|
|
|
{ |
|
103
|
1 |
|
return $this->_clear(1); |
|
104
|
|
|
} |
|
105
|
|
|
|
|
106
|
|
|
/** |
|
107
|
|
|
* Get <payment_details_version> value |
|
108
|
|
|
* |
|
109
|
|
|
* @return int |
|
110
|
|
|
*/ |
|
111
|
5 |
|
public function getPaymentDetailsVersion() |
|
112
|
|
|
{ |
|
113
|
5 |
|
return $this->_get(1); |
|
114
|
|
|
} |
|
115
|
|
|
|
|
116
|
|
|
/** |
|
117
|
|
|
* Set <payment_details_version> value |
|
118
|
|
|
* |
|
119
|
|
|
* @param int $value |
|
120
|
|
|
* @return \Bip70\Protobuf\Proto\PaymentRequest |
|
121
|
|
|
*/ |
|
122
|
6 |
|
public function setPaymentDetailsVersion($value) |
|
123
|
|
|
{ |
|
124
|
6 |
|
return $this->_set(1, $value); |
|
125
|
|
|
} |
|
126
|
|
|
|
|
127
|
|
|
/** |
|
128
|
|
|
* Check if <pki_type> has a value |
|
129
|
|
|
* |
|
130
|
|
|
* @return boolean |
|
131
|
|
|
*/ |
|
132
|
3 |
|
public function hasPkiType() |
|
133
|
|
|
{ |
|
134
|
3 |
|
return $this->_has(2); |
|
135
|
|
|
} |
|
136
|
|
|
|
|
137
|
|
|
/** |
|
138
|
|
|
* Clear <pki_type> value |
|
139
|
|
|
* |
|
140
|
|
|
* @return \Bip70\Protobuf\Proto\PaymentRequest |
|
141
|
|
|
*/ |
|
142
|
1 |
|
public function clearPkiType() |
|
143
|
|
|
{ |
|
144
|
1 |
|
return $this->_clear(2); |
|
145
|
|
|
} |
|
146
|
|
|
|
|
147
|
|
|
/** |
|
148
|
|
|
* Get <pki_type> value |
|
149
|
|
|
* |
|
150
|
|
|
* @return string |
|
151
|
|
|
*/ |
|
152
|
9 |
|
public function getPkiType() |
|
153
|
|
|
{ |
|
154
|
9 |
|
return $this->_get(2); |
|
155
|
|
|
} |
|
156
|
|
|
|
|
157
|
|
|
/** |
|
158
|
|
|
* Set <pki_type> value |
|
159
|
|
|
* |
|
160
|
|
|
* @param string $value |
|
161
|
|
|
* @return \Bip70\Protobuf\Proto\PaymentRequest |
|
162
|
|
|
*/ |
|
163
|
8 |
|
public function setPkiType($value) |
|
164
|
|
|
{ |
|
165
|
8 |
|
return $this->_set(2, $value); |
|
166
|
|
|
} |
|
167
|
|
|
|
|
168
|
|
|
/** |
|
169
|
|
|
* Check if <pki_data> has a value |
|
170
|
|
|
* |
|
171
|
|
|
* @return boolean |
|
172
|
|
|
*/ |
|
173
|
3 |
|
public function hasPkiData() |
|
174
|
|
|
{ |
|
175
|
3 |
|
return $this->_has(3); |
|
176
|
|
|
} |
|
177
|
|
|
|
|
178
|
|
|
/** |
|
179
|
|
|
* Clear <pki_data> value |
|
180
|
|
|
* |
|
181
|
|
|
* @return \Bip70\Protobuf\Proto\PaymentRequest |
|
182
|
|
|
*/ |
|
183
|
1 |
|
public function clearPkiData() |
|
184
|
|
|
{ |
|
185
|
1 |
|
return $this->_clear(3); |
|
186
|
|
|
} |
|
187
|
|
|
|
|
188
|
|
|
/** |
|
189
|
|
|
* Get <pki_data> value |
|
190
|
|
|
* |
|
191
|
|
|
* @return string |
|
192
|
|
|
*/ |
|
193
|
5 |
|
public function getPkiData() |
|
194
|
|
|
{ |
|
195
|
5 |
|
return $this->_get(3); |
|
196
|
|
|
} |
|
197
|
|
|
|
|
198
|
|
|
/** |
|
199
|
|
|
* Set <pki_data> value |
|
200
|
|
|
* |
|
201
|
|
|
* @param string $value |
|
202
|
|
|
* @return \Bip70\Protobuf\Proto\PaymentRequest |
|
203
|
|
|
*/ |
|
204
|
6 |
|
public function setPkiData($value) |
|
205
|
|
|
{ |
|
206
|
6 |
|
return $this->_set(3, $value); |
|
207
|
|
|
} |
|
208
|
|
|
|
|
209
|
|
|
/** |
|
210
|
|
|
* Check if <serialized_payment_details> has a value |
|
211
|
|
|
* |
|
212
|
|
|
* @return boolean |
|
213
|
|
|
*/ |
|
214
|
1 |
|
public function hasSerializedPaymentDetails() |
|
215
|
|
|
{ |
|
216
|
1 |
|
return $this->_has(4); |
|
217
|
|
|
} |
|
218
|
|
|
|
|
219
|
|
|
/** |
|
220
|
|
|
* Clear <serialized_payment_details> value |
|
221
|
|
|
* |
|
222
|
|
|
* @return \Bip70\Protobuf\Proto\PaymentRequest |
|
223
|
|
|
*/ |
|
224
|
1 |
|
public function clearSerializedPaymentDetails() |
|
225
|
|
|
{ |
|
226
|
1 |
|
return $this->_clear(4); |
|
227
|
|
|
} |
|
228
|
|
|
|
|
229
|
|
|
/** |
|
230
|
|
|
* Get <serialized_payment_details> value |
|
231
|
|
|
* |
|
232
|
|
|
* @return string |
|
233
|
|
|
*/ |
|
234
|
5 |
|
public function getSerializedPaymentDetails() |
|
235
|
|
|
{ |
|
236
|
5 |
|
return $this->_get(4); |
|
237
|
|
|
} |
|
238
|
|
|
|
|
239
|
|
|
/** |
|
240
|
|
|
* Set <serialized_payment_details> value |
|
241
|
|
|
* |
|
242
|
|
|
* @param string $value |
|
243
|
|
|
* @return \Bip70\Protobuf\Proto\PaymentRequest |
|
244
|
|
|
*/ |
|
245
|
10 |
|
public function setSerializedPaymentDetails($value) |
|
246
|
|
|
{ |
|
247
|
10 |
|
return $this->_set(4, $value); |
|
248
|
|
|
} |
|
249
|
|
|
|
|
250
|
|
|
/** |
|
251
|
|
|
* Check if <signature> has a value |
|
252
|
|
|
* |
|
253
|
|
|
* @return boolean |
|
254
|
|
|
*/ |
|
255
|
3 |
|
public function hasSignature() |
|
256
|
|
|
{ |
|
257
|
3 |
|
return $this->_has(5); |
|
258
|
|
|
} |
|
259
|
|
|
|
|
260
|
|
|
/** |
|
261
|
|
|
* Clear <signature> value |
|
262
|
|
|
* |
|
263
|
|
|
* @return \Bip70\Protobuf\Proto\PaymentRequest |
|
264
|
|
|
*/ |
|
265
|
1 |
|
public function clearSignature() |
|
266
|
|
|
{ |
|
267
|
1 |
|
return $this->_clear(5); |
|
268
|
|
|
} |
|
269
|
|
|
|
|
270
|
|
|
/** |
|
271
|
|
|
* Get <signature> value |
|
272
|
|
|
* |
|
273
|
|
|
* @return string |
|
274
|
|
|
*/ |
|
275
|
5 |
|
public function getSignature() |
|
276
|
|
|
{ |
|
277
|
5 |
|
return $this->_get(5); |
|
278
|
|
|
} |
|
279
|
|
|
|
|
280
|
|
|
/** |
|
281
|
|
|
* Set <signature> value |
|
282
|
|
|
* |
|
283
|
|
|
* @param string $value |
|
284
|
|
|
* @return \Bip70\Protobuf\Proto\PaymentRequest |
|
285
|
|
|
*/ |
|
286
|
6 |
|
public function setSignature($value) |
|
287
|
|
|
{ |
|
288
|
6 |
|
return $this->_set(5, $value); |
|
289
|
|
|
} |
|
290
|
|
|
} |
|
291
|
|
|
|