1: | <?php |
2: | |
3: | |
4: | |
5: | namespace Worldline\Acquiring\Sdk\V1\Domain; |
6: | |
7: | use DateTime; |
8: | use UnexpectedValueException; |
9: | use Worldline\Acquiring\Sdk\Domain\DataObject; |
10: | |
11: | |
12: | |
13: | |
14: | class ApiCaptureRequestForRefund extends DataObject |
15: | { |
16: | |
17: | |
18: | |
19: | public $operationId = null; |
20: | |
21: | |
22: | |
23: | |
24: | public $transactionTimestamp = null; |
25: | |
26: | |
27: | |
28: | |
29: | public function toObject() |
30: | { |
31: | $object = parent::toObject(); |
32: | if (!is_null($this->operationId)) { |
33: | $object->operationId = $this->operationId; |
34: | } |
35: | if (!is_null($this->transactionTimestamp)) { |
36: | $object->transactionTimestamp = $this->transactionTimestamp->format('Y-m-d\\TH:i:s.vP'); |
37: | } |
38: | return $object; |
39: | } |
40: | |
41: | |
42: | |
43: | |
44: | |
45: | |
46: | public function fromObject($object) |
47: | { |
48: | parent::fromObject($object); |
49: | if (property_exists($object, 'operationId')) { |
50: | $this->operationId = $object->operationId; |
51: | } |
52: | if (property_exists($object, 'transactionTimestamp')) { |
53: | $this->transactionTimestamp = new DateTime($object->transactionTimestamp); |
54: | } |
55: | return $this; |
56: | } |
57: | } |
58: | |