1: <?php
2: /*
3: * This class was auto-generated from the API references found at
4: * https://apireference.connect.worldline-solutions.com/
5: */
6: namespace Worldline\Connect\Sdk\V1\Domain;
7:
8: use UnexpectedValueException;
9:
10: /**
11: * @package Worldline\Connect\Sdk\V1\Domain
12: */
13: class MobilePaymentMethodSpecificInput extends AbstractMobilePaymentMethodSpecificInput
14: {
15: /**
16: * @var DecryptedPaymentData|null
17: */
18: public ?DecryptedPaymentData $decryptedPaymentData = null;
19:
20: /**
21: * @var string|null
22: */
23: public ?string $encryptedPaymentData = null;
24:
25: /**
26: * @var bool|null
27: */
28: public ?bool $isRecurring = null;
29:
30: /**
31: * @var string|null
32: */
33: public ?string $merchantInitiatedReasonIndicator = null;
34:
35: /**
36: * @var MobilePaymentProduct320SpecificInput|null
37: */
38: public ?MobilePaymentProduct320SpecificInput $paymentProduct320SpecificInput = null;
39:
40: /**
41: * @return object
42: */
43: public function toObject(): object
44: {
45: $object = parent::toObject();
46: if (!is_null($this->decryptedPaymentData)) {
47: $object->decryptedPaymentData = $this->decryptedPaymentData->toObject();
48: }
49: if (!is_null($this->encryptedPaymentData)) {
50: $object->encryptedPaymentData = $this->encryptedPaymentData;
51: }
52: if (!is_null($this->isRecurring)) {
53: $object->isRecurring = $this->isRecurring;
54: }
55: if (!is_null($this->merchantInitiatedReasonIndicator)) {
56: $object->merchantInitiatedReasonIndicator = $this->merchantInitiatedReasonIndicator;
57: }
58: if (!is_null($this->paymentProduct320SpecificInput)) {
59: $object->paymentProduct320SpecificInput = $this->paymentProduct320SpecificInput->toObject();
60: }
61: return $object;
62: }
63:
64: /**
65: * @param object $object
66: *
67: * @return $this
68: * @throws UnexpectedValueException
69: */
70: public function fromObject(object $object): MobilePaymentMethodSpecificInput
71: {
72: parent::fromObject($object);
73: if (property_exists($object, 'decryptedPaymentData')) {
74: if (!is_object($object->decryptedPaymentData)) {
75: throw new UnexpectedValueException('value \'' . print_r($object->decryptedPaymentData, true) . '\' is not an object');
76: }
77: $value = new DecryptedPaymentData();
78: $this->decryptedPaymentData = $value->fromObject($object->decryptedPaymentData);
79: }
80: if (property_exists($object, 'encryptedPaymentData')) {
81: $this->encryptedPaymentData = $object->encryptedPaymentData;
82: }
83: if (property_exists($object, 'isRecurring')) {
84: $this->isRecurring = $object->isRecurring;
85: }
86: if (property_exists($object, 'merchantInitiatedReasonIndicator')) {
87: $this->merchantInitiatedReasonIndicator = $object->merchantInitiatedReasonIndicator;
88: }
89: if (property_exists($object, 'paymentProduct320SpecificInput')) {
90: if (!is_object($object->paymentProduct320SpecificInput)) {
91: throw new UnexpectedValueException('value \'' . print_r($object->paymentProduct320SpecificInput, true) . '\' is not an object');
92: }
93: $value = new MobilePaymentProduct320SpecificInput();
94: $this->paymentProduct320SpecificInput = $value->fromObject($object->paymentProduct320SpecificInput);
95: }
96: return $this;
97: }
98: }
99: