1: | <?php |
2: | |
3: | |
4: | |
5: | |
6: | namespace Worldline\Connect\Sdk\V1\Domain; |
7: | |
8: | use UnexpectedValueException; |
9: | |
10: | |
11: | |
12: | |
13: | class CaptureOutput extends OrderOutput |
14: | { |
15: | |
16: | |
17: | |
18: | public $amountPaid = null; |
19: | |
20: | |
21: | |
22: | |
23: | public $amountReversed = null; |
24: | |
25: | |
26: | |
27: | |
28: | public $bankTransferPaymentMethodSpecificOutput = null; |
29: | |
30: | |
31: | |
32: | |
33: | public $cardPaymentMethodSpecificOutput = null; |
34: | |
35: | |
36: | |
37: | |
38: | public $cashPaymentMethodSpecificOutput = null; |
39: | |
40: | |
41: | |
42: | |
43: | public $paymentMethod = null; |
44: | |
45: | |
46: | |
47: | |
48: | public $redirectPaymentMethodSpecificOutput = null; |
49: | |
50: | |
51: | |
52: | |
53: | public $reversalReason = null; |
54: | |
55: | |
56: | |
57: | |
58: | public $sepaDirectDebitPaymentMethodSpecificOutput = null; |
59: | |
60: | |
61: | |
62: | |
63: | public function toObject() |
64: | { |
65: | $object = parent::toObject(); |
66: | if (!is_null($this->amountPaid)) { |
67: | $object->amountPaid = $this->amountPaid; |
68: | } |
69: | if (!is_null($this->amountReversed)) { |
70: | $object->amountReversed = $this->amountReversed; |
71: | } |
72: | if (!is_null($this->bankTransferPaymentMethodSpecificOutput)) { |
73: | $object->bankTransferPaymentMethodSpecificOutput = $this->bankTransferPaymentMethodSpecificOutput->toObject(); |
74: | } |
75: | if (!is_null($this->cardPaymentMethodSpecificOutput)) { |
76: | $object->cardPaymentMethodSpecificOutput = $this->cardPaymentMethodSpecificOutput->toObject(); |
77: | } |
78: | if (!is_null($this->cashPaymentMethodSpecificOutput)) { |
79: | $object->cashPaymentMethodSpecificOutput = $this->cashPaymentMethodSpecificOutput->toObject(); |
80: | } |
81: | if (!is_null($this->paymentMethod)) { |
82: | $object->paymentMethod = $this->paymentMethod; |
83: | } |
84: | if (!is_null($this->redirectPaymentMethodSpecificOutput)) { |
85: | $object->redirectPaymentMethodSpecificOutput = $this->redirectPaymentMethodSpecificOutput->toObject(); |
86: | } |
87: | if (!is_null($this->reversalReason)) { |
88: | $object->reversalReason = $this->reversalReason; |
89: | } |
90: | if (!is_null($this->sepaDirectDebitPaymentMethodSpecificOutput)) { |
91: | $object->sepaDirectDebitPaymentMethodSpecificOutput = $this->sepaDirectDebitPaymentMethodSpecificOutput->toObject(); |
92: | } |
93: | return $object; |
94: | } |
95: | |
96: | |
97: | |
98: | |
99: | |
100: | |
101: | public function fromObject($object) |
102: | { |
103: | parent::fromObject($object); |
104: | if (property_exists($object, 'amountPaid')) { |
105: | $this->amountPaid = $object->amountPaid; |
106: | } |
107: | if (property_exists($object, 'amountReversed')) { |
108: | $this->amountReversed = $object->amountReversed; |
109: | } |
110: | if (property_exists($object, 'bankTransferPaymentMethodSpecificOutput')) { |
111: | if (!is_object($object->bankTransferPaymentMethodSpecificOutput)) { |
112: | throw new UnexpectedValueException('value \'' . print_r($object->bankTransferPaymentMethodSpecificOutput, true) . '\' is not an object'); |
113: | } |
114: | $value = new BankTransferPaymentMethodSpecificOutput(); |
115: | $this->bankTransferPaymentMethodSpecificOutput = $value->fromObject($object->bankTransferPaymentMethodSpecificOutput); |
116: | } |
117: | if (property_exists($object, 'cardPaymentMethodSpecificOutput')) { |
118: | if (!is_object($object->cardPaymentMethodSpecificOutput)) { |
119: | throw new UnexpectedValueException('value \'' . print_r($object->cardPaymentMethodSpecificOutput, true) . '\' is not an object'); |
120: | } |
121: | $value = new CardPaymentMethodSpecificOutput(); |
122: | $this->cardPaymentMethodSpecificOutput = $value->fromObject($object->cardPaymentMethodSpecificOutput); |
123: | } |
124: | if (property_exists($object, 'cashPaymentMethodSpecificOutput')) { |
125: | if (!is_object($object->cashPaymentMethodSpecificOutput)) { |
126: | throw new UnexpectedValueException('value \'' . print_r($object->cashPaymentMethodSpecificOutput, true) . '\' is not an object'); |
127: | } |
128: | $value = new CashPaymentMethodSpecificOutput(); |
129: | $this->cashPaymentMethodSpecificOutput = $value->fromObject($object->cashPaymentMethodSpecificOutput); |
130: | } |
131: | if (property_exists($object, 'paymentMethod')) { |
132: | $this->paymentMethod = $object->paymentMethod; |
133: | } |
134: | if (property_exists($object, 'redirectPaymentMethodSpecificOutput')) { |
135: | if (!is_object($object->redirectPaymentMethodSpecificOutput)) { |
136: | throw new UnexpectedValueException('value \'' . print_r($object->redirectPaymentMethodSpecificOutput, true) . '\' is not an object'); |
137: | } |
138: | $value = new RedirectPaymentMethodSpecificOutput(); |
139: | $this->redirectPaymentMethodSpecificOutput = $value->fromObject($object->redirectPaymentMethodSpecificOutput); |
140: | } |
141: | if (property_exists($object, 'reversalReason')) { |
142: | $this->reversalReason = $object->reversalReason; |
143: | } |
144: | if (property_exists($object, 'sepaDirectDebitPaymentMethodSpecificOutput')) { |
145: | if (!is_object($object->sepaDirectDebitPaymentMethodSpecificOutput)) { |
146: | throw new UnexpectedValueException('value \'' . print_r($object->sepaDirectDebitPaymentMethodSpecificOutput, true) . '\' is not an object'); |
147: | } |
148: | $value = new SepaDirectDebitPaymentMethodSpecificOutput(); |
149: | $this->sepaDirectDebitPaymentMethodSpecificOutput = $value->fromObject($object->sepaDirectDebitPaymentMethodSpecificOutput); |
150: | } |
151: | return $this; |
152: | } |
153: | } |
154: | |