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