-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathRefund.php
390 lines (349 loc) · 7.24 KB
/
Refund.php
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
<?php
namespace Omnipay\Vindicia;
use Omnipay\Common\Helper;
use Symfony\Component\HttpFoundation\ParameterBag;
/**
* Generic representation of a refund object returned by a gateway.
* Hopefully this can be added to omnipay-common one day.
*/
class Refund
{
/**
* @var \Symfony\Component\HttpFoundation\ParameterBag
*/
protected $parameters;
/**
* Create a new refund with the specified parameters
*
* @param array $parameters An array of parameters to set on the new object
*/
public function __construct($parameters = array())
{
$this->initialize($parameters);
}
/**
* Initialize this refund with the specified parameters
*
* @param array $parameters An array of parameters to set on this object
* @return static
*/
public function initialize($parameters = array())
{
$this->parameters = new ParameterBag;
Helper::initialize($this, $parameters);
return $this;
}
/**
* @return array
*/
public function getParameters()
{
return $this->parameters->all();
}
/**
* @return mixed
*/
protected function getParameter($key)
{
return $this->parameters->get($key);
}
/**
* @return Refund
*/
protected function setParameter($key, $value)
{
$this->parameters->set($key, $value);
return $this;
}
/**
* Get the refund id
*
* @return null|string
*/
public function getRefundId()
{
return $this->getParameter('refundId');
}
/**
* Set the refund id
*
* @param string $value
* @return static
*/
public function setRefundId($value)
{
return $this->setParameter('refundId', $value);
}
/**
* Get the refund reference
*
* @return null|string
*/
public function getRefundReference()
{
return $this->getParameter('refundReference');
}
/**
* Set the refund reference
*
* @param string $value
* @return static
*/
public function setRefundReference($value)
{
return $this->setParameter('refundReference', $value);
}
/**
* Get the refund id
*
* @return null|string
* @deprecated see getRefundId
*/
public function getId()
{
return $this->getRefundId();
}
/**
* Set the refund id
*
* @param string $value
* @return static
* @deprecated see setRefundId
*/
public function setId($value)
{
return $this->setRefundId($value);
}
/**
* Get the refund reference
*
* @return null|string
* @deprecated see getRefundReference
*/
public function getReference()
{
return $this->getRefundReference();
}
/**
* Set the refund reference
*
* @param string $value
* @return static
* @deprecated see setRefundReference
*/
public function setReference($value)
{
return $this->setRefundReference($value);
}
/**
* Get the currency
*
* @return null|string
*/
public function getCurrency()
{
return $this->getParameter('currency');
}
/**
* Set the currency
*
* @param string $value
* @return static
*/
public function setCurrency($value)
{
return $this->setParameter('currency', $value);
}
/**
* Get the monetary amount
*
* @return null|string
*/
public function getAmount()
{
return $this->getParameter('amount');
}
/**
* Set the monetary amount
*
* @param string $value
* @return static
*/
public function setAmount($value)
{
return $this->setParameter('amount', $value);
}
/**
* Get the reason
*
* @return null|string
*/
public function getReason()
{
return $this->getParameter('reason');
}
/**
* Set the reason
*
* @param string $value
* @return static
*/
public function setReason($value)
{
return $this->setParameter('reason', $value);
}
/**
* Get the reason
*
* @return null|string
* @deprecated in favor of getReason
*/
public function getNote()
{
return $this->getReason();
}
/**
* Set the reason
*
* @param string $value
* @return static
* @deprecated in favor of setReason
*/
public function setNote($value)
{
return $this->setReason($value);
}
/**
* Get the time
*
* @return null|string
*/
public function getTime()
{
return $this->getParameter('time');
}
/**
* Set the time
*
* @param string $value
* @return static
*/
public function setTime($value)
{
return $this->setParameter('time', $value);
}
/**
* Get the transaction
*
* @return null|Transaction
*/
public function getTransaction()
{
return $this->getParameter('transaction');
}
/**
* Set the transaction
*
* @param Transaction $value
* @return static
*/
public function setTransaction($value)
{
return $this->setParameter('transaction', $value);
}
/**
* Get the transaction id
*
* @return null|string
*/
public function getTransactionId()
{
return $this->getParameter('transactionId');
}
/**
* Set the transaction id
*
* @param string $value
* @return static
*/
public function setTransactionId($value)
{
return $this->setParameter('transactionId', $value);
}
/**
* Get the transaction reference
*
* @return null|string
*/
public function getTransactionReference()
{
return $this->getParameter('transactionReference');
}
/**
* Set the transaction reference
*
* @param string $value
* @return static
*/
public function setTransactionReference($value)
{
return $this->setParameter('transactionReference', $value);
}
/**
* Get the items
*
* @return null|VindiciaRefundItemBag
*/
public function getItems()
{
return $this->getParameter('items');
}
/**
* Set the items
*
* @param array $items
* @return static
*/
public function setItems($items)
{
return $this->setParameter('items', $items);
}
/**
* Get the status
*
* @return null|string
*/
public function getStatus()
{
return $this->getParameter('status');
}
/**
* Set the status
*
* @param string $value
* @return static
*/
public function setStatus($value)
{
return $this->setParameter('status', $value);
}
/**
* A list of attributes
*
* @return AttributeBag|null
*/
public function getAttributes()
{
return $this->getParameter('attributes');
}
/**
* Set the attributes in this order
*
* @param array $attributes
* @return static
*/
public function setAttributes($attributes)
{
return $this->setParameter('attributes', $attributes);
}
}