1: | <?php |
2: | |
3: | |
4: | |
5: | |
6: | namespace Worldline\Connect\Sdk\V1\Domain; |
7: | |
8: | use UnexpectedValueException; |
9: | |
10: | |
11: | |
12: | |
13: | class MobilePaymentMethodSpecificInput extends AbstractPaymentMethodSpecificInput |
14: | { |
15: | |
16: | |
17: | |
18: | public $authorizationMode = null; |
19: | |
20: | |
21: | |
22: | |
23: | public $customerReference = null; |
24: | |
25: | |
26: | |
27: | |
28: | public $decryptedPaymentData = null; |
29: | |
30: | |
31: | |
32: | |
33: | public $encryptedPaymentData = null; |
34: | |
35: | |
36: | |
37: | |
38: | public $paymentProduct320SpecificInput = null; |
39: | |
40: | |
41: | |
42: | |
43: | public $requiresApproval = null; |
44: | |
45: | |
46: | |
47: | |
48: | public $skipFraudService = null; |
49: | |
50: | |
51: | |
52: | |
53: | public function toObject() |
54: | { |
55: | $object = parent::toObject(); |
56: | if (!is_null($this->authorizationMode)) { |
57: | $object->authorizationMode = $this->authorizationMode; |
58: | } |
59: | if (!is_null($this->customerReference)) { |
60: | $object->customerReference = $this->customerReference; |
61: | } |
62: | if (!is_null($this->decryptedPaymentData)) { |
63: | $object->decryptedPaymentData = $this->decryptedPaymentData->toObject(); |
64: | } |
65: | if (!is_null($this->encryptedPaymentData)) { |
66: | $object->encryptedPaymentData = $this->encryptedPaymentData; |
67: | } |
68: | if (!is_null($this->paymentProduct320SpecificInput)) { |
69: | $object->paymentProduct320SpecificInput = $this->paymentProduct320SpecificInput->toObject(); |
70: | } |
71: | if (!is_null($this->requiresApproval)) { |
72: | $object->requiresApproval = $this->requiresApproval; |
73: | } |
74: | if (!is_null($this->skipFraudService)) { |
75: | $object->skipFraudService = $this->skipFraudService; |
76: | } |
77: | return $object; |
78: | } |
79: | |
80: | |
81: | |
82: | |
83: | |
84: | |
85: | public function fromObject($object) |
86: | { |
87: | parent::fromObject($object); |
88: | if (property_exists($object, 'authorizationMode')) { |
89: | $this->authorizationMode = $object->authorizationMode; |
90: | } |
91: | if (property_exists($object, 'customerReference')) { |
92: | $this->customerReference = $object->customerReference; |
93: | } |
94: | if (property_exists($object, 'decryptedPaymentData')) { |
95: | if (!is_object($object->decryptedPaymentData)) { |
96: | throw new UnexpectedValueException('value \'' . print_r($object->decryptedPaymentData, true) . '\' is not an object'); |
97: | } |
98: | $value = new DecryptedPaymentData(); |
99: | $this->decryptedPaymentData = $value->fromObject($object->decryptedPaymentData); |
100: | } |
101: | if (property_exists($object, 'encryptedPaymentData')) { |
102: | $this->encryptedPaymentData = $object->encryptedPaymentData; |
103: | } |
104: | if (property_exists($object, 'paymentProduct320SpecificInput')) { |
105: | if (!is_object($object->paymentProduct320SpecificInput)) { |
106: | throw new UnexpectedValueException('value \'' . print_r($object->paymentProduct320SpecificInput, true) . '\' is not an object'); |
107: | } |
108: | $value = new MobilePaymentProduct320SpecificInput(); |
109: | $this->paymentProduct320SpecificInput = $value->fromObject($object->paymentProduct320SpecificInput); |
110: | } |
111: | if (property_exists($object, 'requiresApproval')) { |
112: | $this->requiresApproval = $object->requiresApproval; |
113: | } |
114: | if (property_exists($object, 'skipFraudService')) { |
115: | $this->skipFraudService = $object->skipFraudService; |
116: | } |
117: | return $this; |
118: | } |
119: | } |
120: | |