1 | <?php |
||
10 | class PaymentDetails extends Message |
||
11 | { |
||
12 | |||
13 | /** @var string */ |
||
14 | public $network = 'main'; |
||
15 | |||
16 | /** @var \BitWasp\Bitcoin\PaymentProtocol\Protobufs\Output[] */ |
||
17 | public $outputs = array(); |
||
18 | |||
19 | /** @var int */ |
||
20 | public $time; |
||
21 | |||
22 | /** @var int */ |
||
23 | public $expires; |
||
24 | |||
25 | /** @var string */ |
||
26 | public $memo; |
||
27 | |||
28 | /** @var string */ |
||
29 | public $payment_url; |
||
30 | |||
31 | /** @var string */ |
||
32 | public $merchant_data; |
||
33 | |||
34 | |||
35 | /** @var \Closure[] */ |
||
36 | protected static $__extensions = array(); |
||
37 | |||
38 | public static function descriptor() |
||
39 | { |
||
40 | $descriptor = new Descriptor(__CLASS__, 'payments.PaymentDetails'); |
||
41 | |||
42 | // OPTIONAL STRING network = 1 |
||
43 | $f = new Field(); |
||
44 | $f->number = 1; |
||
45 | $f->name = 'network'; |
||
46 | $f->type = Protobuf::TYPE_STRING; |
||
47 | $f->rule = Protobuf::RULE_OPTIONAL; |
||
48 | $f->default = 'main'; |
||
49 | $descriptor->addField($f); |
||
50 | |||
51 | // REPEATED MESSAGE outputs = 2 |
||
52 | $f = new Field(); |
||
53 | $f->number = 2; |
||
54 | $f->name = 'outputs'; |
||
55 | $f->type = Protobuf::TYPE_MESSAGE; |
||
56 | $f->rule = Protobuf::RULE_REPEATED; |
||
57 | $f->reference = '\BitWasp\Bitcoin\PaymentProtocol\Protobufs\Output'; |
||
58 | $descriptor->addField($f); |
||
59 | |||
60 | // REQUIRED UINT64 time = 3 |
||
61 | $f = new Field(); |
||
62 | $f->number = 3; |
||
63 | $f->name = 'time'; |
||
64 | $f->type = Protobuf::TYPE_UINT64; |
||
65 | $f->rule = Protobuf::RULE_REQUIRED; |
||
66 | $descriptor->addField($f); |
||
67 | |||
68 | // OPTIONAL UINT64 expires = 4 |
||
69 | $f = new Field(); |
||
70 | $f->number = 4; |
||
71 | $f->name = 'expires'; |
||
72 | $f->type = Protobuf::TYPE_UINT64; |
||
73 | $f->rule = Protobuf::RULE_OPTIONAL; |
||
74 | $descriptor->addField($f); |
||
75 | |||
76 | // OPTIONAL STRING memo = 5 |
||
77 | $f = new Field(); |
||
78 | $f->number = 5; |
||
79 | $f->name = 'memo'; |
||
80 | $f->type = Protobuf::TYPE_STRING; |
||
81 | $f->rule = Protobuf::RULE_OPTIONAL; |
||
82 | $descriptor->addField($f); |
||
83 | |||
84 | // OPTIONAL STRING payment_url = 6 |
||
85 | $f = new Field(); |
||
86 | $f->number = 6; |
||
87 | $f->name = 'payment_url'; |
||
88 | $f->type = Protobuf::TYPE_STRING; |
||
89 | $f->rule = Protobuf::RULE_OPTIONAL; |
||
90 | $descriptor->addField($f); |
||
91 | |||
92 | // OPTIONAL BYTES merchant_data = 7 |
||
93 | $f = new Field(); |
||
94 | $f->number = 7; |
||
95 | $f->name = 'merchant_data'; |
||
96 | $f->type = Protobuf::TYPE_BYTES; |
||
97 | $f->rule = Protobuf::RULE_OPTIONAL; |
||
98 | $descriptor->addField($f); |
||
99 | |||
100 | foreach (self::$__extensions as $cb) { |
||
101 | $descriptor->addField($cb(), true); |
||
102 | } |
||
103 | |||
104 | return $descriptor; |
||
105 | } |
||
106 | |||
107 | /** |
||
108 | * Check if <network> has a value |
||
109 | * |
||
110 | * @return boolean |
||
111 | */ |
||
112 | public function hasNetwork() |
||
116 | |||
117 | /** |
||
118 | * Clear <network> value |
||
119 | * |
||
120 | * @return \BitWasp\Bitcoin\PaymentProtocol\Protobufs\PaymentDetails |
||
121 | */ |
||
122 | public function clearNetwork() |
||
126 | |||
127 | /** |
||
128 | * Get <network> value |
||
129 | * |
||
130 | * @return string |
||
131 | */ |
||
132 | 4 | public function getNetwork() |
|
136 | |||
137 | /** |
||
138 | * Set <network> value |
||
139 | * |
||
140 | * @param string $value |
||
141 | * @return \BitWasp\Bitcoin\PaymentProtocol\Protobufs\PaymentDetails |
||
142 | */ |
||
143 | 8 | public function setNetwork($value) |
|
147 | |||
148 | /** |
||
149 | * Check if <outputs> has a value |
||
150 | * |
||
151 | * @return boolean |
||
152 | */ |
||
153 | public function hasOutputs() |
||
157 | |||
158 | /** |
||
159 | * Clear <outputs> value |
||
160 | * |
||
161 | * @return \BitWasp\Bitcoin\PaymentProtocol\Protobufs\PaymentDetails |
||
162 | */ |
||
163 | public function clearOutputs() |
||
167 | |||
168 | /** |
||
169 | * Get <outputs> value |
||
170 | * |
||
171 | * @param int $idx |
||
172 | * @return \BitWasp\Bitcoin\PaymentProtocol\Protobufs\Output |
||
173 | */ |
||
174 | 8 | public function getOutputs($idx = null) |
|
178 | |||
179 | /** |
||
180 | * Set <outputs> value |
||
181 | * |
||
182 | * @param \BitWasp\Bitcoin\PaymentProtocol\Protobufs\Output $value |
||
183 | * @param int $idx |
||
184 | * @return \BitWasp\Bitcoin\PaymentProtocol\Protobufs\PaymentDetails |
||
185 | */ |
||
186 | 12 | public function setOutputs(\BitWasp\Bitcoin\PaymentProtocol\Protobufs\Output $value, $idx = null) |
|
187 | { |
||
188 | 12 | return $this->_set(2, $value, $idx); |
|
189 | } |
||
190 | |||
191 | /** |
||
192 | * Get all elements of <outputs> |
||
193 | * |
||
194 | * @return \BitWasp\Bitcoin\PaymentProtocol\Protobufs\Output[] |
||
195 | */ |
||
196 | 28 | public function getOutputsList() |
|
200 | |||
201 | /** |
||
202 | * Add a new element to <outputs> |
||
203 | * |
||
204 | * @param \BitWasp\Bitcoin\PaymentProtocol\Protobufs\Output $value |
||
205 | * @return \BitWasp\Bitcoin\PaymentProtocol\Protobufs\PaymentDetails |
||
206 | */ |
||
207 | public function addOutputs(\BitWasp\Bitcoin\PaymentProtocol\Protobufs\Output $value) |
||
208 | { |
||
209 | return $this->_add(2, $value); |
||
210 | } |
||
211 | |||
212 | /** |
||
213 | * Check if <time> has a value |
||
214 | * |
||
215 | * @return boolean |
||
216 | */ |
||
217 | public function hasTime() |
||
221 | |||
222 | /** |
||
223 | * Clear <time> value |
||
224 | * |
||
225 | * @return \BitWasp\Bitcoin\PaymentProtocol\Protobufs\PaymentDetails |
||
226 | */ |
||
227 | public function clearTime() |
||
231 | |||
232 | /** |
||
233 | * Get <time> value |
||
234 | * |
||
235 | * @return int |
||
236 | */ |
||
237 | 4 | public function getTime() |
|
241 | |||
242 | /** |
||
243 | * Set <time> value |
||
244 | * |
||
245 | * @param int $value |
||
246 | * @return \BitWasp\Bitcoin\PaymentProtocol\Protobufs\PaymentDetails |
||
247 | */ |
||
248 | 28 | public function setTime($value) |
|
252 | |||
253 | /** |
||
254 | * Check if <expires> has a value |
||
255 | * |
||
256 | * @return boolean |
||
257 | */ |
||
258 | public function hasExpires() |
||
262 | |||
263 | /** |
||
264 | * Clear <expires> value |
||
265 | * |
||
266 | * @return \BitWasp\Bitcoin\PaymentProtocol\Protobufs\PaymentDetails |
||
267 | */ |
||
268 | public function clearExpires() |
||
272 | |||
273 | /** |
||
274 | * Get <expires> value |
||
275 | * |
||
276 | * @return int |
||
277 | */ |
||
278 | 4 | public function getExpires() |
|
279 | { |
||
280 | 4 | return $this->_get(4); |
|
281 | } |
||
282 | |||
283 | /** |
||
284 | * Set <expires> value |
||
285 | * |
||
286 | * @param int $value |
||
287 | * @return \BitWasp\Bitcoin\PaymentProtocol\Protobufs\PaymentDetails |
||
288 | */ |
||
289 | 8 | public function setExpires($value) |
|
290 | { |
||
291 | 8 | return $this->_set(4, $value); |
|
292 | } |
||
293 | |||
294 | /** |
||
295 | * Check if <memo> has a value |
||
296 | * |
||
297 | * @return boolean |
||
298 | */ |
||
299 | public function hasMemo() |
||
303 | |||
304 | /** |
||
305 | * Clear <memo> value |
||
306 | * |
||
307 | * @return \BitWasp\Bitcoin\PaymentProtocol\Protobufs\PaymentDetails |
||
308 | */ |
||
309 | public function clearMemo() |
||
313 | |||
314 | /** |
||
315 | * Get <memo> value |
||
316 | * |
||
317 | * @return string |
||
318 | */ |
||
319 | 4 | public function getMemo() |
|
320 | { |
||
321 | 4 | return $this->_get(5); |
|
322 | } |
||
323 | |||
324 | /** |
||
325 | * Set <memo> value |
||
326 | * |
||
327 | * @param string $value |
||
328 | * @return \BitWasp\Bitcoin\PaymentProtocol\Protobufs\PaymentDetails |
||
329 | */ |
||
330 | 8 | public function setMemo($value) |
|
331 | { |
||
332 | 8 | return $this->_set(5, $value); |
|
333 | } |
||
334 | |||
335 | /** |
||
336 | * Check if <payment_url> has a value |
||
337 | * |
||
338 | * @return boolean |
||
339 | */ |
||
340 | public function hasPaymentUrl() |
||
344 | |||
345 | /** |
||
346 | * Clear <payment_url> value |
||
347 | * |
||
348 | * @return \BitWasp\Bitcoin\PaymentProtocol\Protobufs\PaymentDetails |
||
349 | */ |
||
350 | public function clearPaymentUrl() |
||
354 | |||
355 | /** |
||
356 | * Get <payment_url> value |
||
357 | * |
||
358 | * @return string |
||
359 | */ |
||
360 | 4 | public function getPaymentUrl() |
|
361 | { |
||
362 | 4 | return $this->_get(6); |
|
363 | } |
||
364 | |||
365 | /** |
||
366 | * Set <payment_url> value |
||
367 | * |
||
368 | * @param string $value |
||
369 | * @return \BitWasp\Bitcoin\PaymentProtocol\Protobufs\PaymentDetails |
||
370 | */ |
||
371 | 8 | public function setPaymentUrl($value) |
|
372 | { |
||
373 | 8 | return $this->_set(6, $value); |
|
374 | } |
||
375 | |||
376 | /** |
||
377 | * Check if <merchant_data> has a value |
||
378 | * |
||
379 | * @return boolean |
||
380 | */ |
||
381 | public function hasMerchantData() |
||
385 | |||
386 | /** |
||
387 | * Clear <merchant_data> value |
||
388 | * |
||
389 | * @return \BitWasp\Bitcoin\PaymentProtocol\Protobufs\PaymentDetails |
||
390 | */ |
||
391 | public function clearMerchantData() |
||
395 | |||
396 | /** |
||
397 | * Get <merchant_data> value |
||
398 | * |
||
399 | * @return string |
||
400 | */ |
||
401 | 8 | public function getMerchantData() |
|
402 | { |
||
403 | 8 | return $this->_get(7); |
|
404 | } |
||
405 | |||
406 | /** |
||
407 | * Set <merchant_data> value |
||
408 | * |
||
409 | * @param string $value |
||
410 | * @return \BitWasp\Bitcoin\PaymentProtocol\Protobufs\PaymentDetails |
||
411 | */ |
||
412 | 8 | public function setMerchantData($value) |
|
416 | } |
||
417 |