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 AbstractMobilePaymentMethodSpecificInput extends AbstractPaymentMethodSpecificInput
14: {
15: /**
16: * @var string|null
17: */
18: public ?string $authorizationMode = null;
19:
20: /**
21: * @var string|null
22: */
23: public ?string $customerReference = null;
24:
25: /**
26: * @var string|null
27: */
28: public ?string $initialSchemeTransactionId = null;
29:
30: /**
31: * @var string|null
32: */
33: public ?string $originalTransactionLinkId = null;
34:
35: /**
36: * @var CardRecurrenceDetails|null
37: */
38: public ?CardRecurrenceDetails $recurring = null;
39:
40: /**
41: * @var bool|null
42: */
43: public ?bool $requiresApproval = null;
44:
45: /**
46: * @var bool|null
47: */
48: public ?bool $skipFraudService = null;
49:
50: /**
51: * @var string|null
52: */
53: public ?string $token = null;
54:
55: /**
56: * @var bool|null
57: */
58: public ?bool $tokenize = null;
59:
60: /**
61: * @var string|null
62: */
63: public ?string $unscheduledCardOnFileRequestor = null;
64:
65: /**
66: * @var string|null
67: */
68: public ?string $unscheduledCardOnFileSequenceIndicator = null;
69:
70: /**
71: * @return object
72: */
73: public function toObject(): object
74: {
75: $object = parent::toObject();
76: if (!is_null($this->authorizationMode)) {
77: $object->authorizationMode = $this->authorizationMode;
78: }
79: if (!is_null($this->customerReference)) {
80: $object->customerReference = $this->customerReference;
81: }
82: if (!is_null($this->initialSchemeTransactionId)) {
83: $object->initialSchemeTransactionId = $this->initialSchemeTransactionId;
84: }
85: if (!is_null($this->originalTransactionLinkId)) {
86: $object->originalTransactionLinkId = $this->originalTransactionLinkId;
87: }
88: if (!is_null($this->recurring)) {
89: $object->recurring = $this->recurring->toObject();
90: }
91: if (!is_null($this->requiresApproval)) {
92: $object->requiresApproval = $this->requiresApproval;
93: }
94: if (!is_null($this->skipFraudService)) {
95: $object->skipFraudService = $this->skipFraudService;
96: }
97: if (!is_null($this->token)) {
98: $object->token = $this->token;
99: }
100: if (!is_null($this->tokenize)) {
101: $object->tokenize = $this->tokenize;
102: }
103: if (!is_null($this->unscheduledCardOnFileRequestor)) {
104: $object->unscheduledCardOnFileRequestor = $this->unscheduledCardOnFileRequestor;
105: }
106: if (!is_null($this->unscheduledCardOnFileSequenceIndicator)) {
107: $object->unscheduledCardOnFileSequenceIndicator = $this->unscheduledCardOnFileSequenceIndicator;
108: }
109: return $object;
110: }
111:
112: /**
113: * @param object $object
114: *
115: * @return $this
116: * @throws UnexpectedValueException
117: */
118: public function fromObject(object $object): AbstractMobilePaymentMethodSpecificInput
119: {
120: parent::fromObject($object);
121: if (property_exists($object, 'authorizationMode')) {
122: $this->authorizationMode = $object->authorizationMode;
123: }
124: if (property_exists($object, 'customerReference')) {
125: $this->customerReference = $object->customerReference;
126: }
127: if (property_exists($object, 'initialSchemeTransactionId')) {
128: $this->initialSchemeTransactionId = $object->initialSchemeTransactionId;
129: }
130: if (property_exists($object, 'originalTransactionLinkId')) {
131: $this->originalTransactionLinkId = $object->originalTransactionLinkId;
132: }
133: if (property_exists($object, 'recurring')) {
134: if (!is_object($object->recurring)) {
135: throw new UnexpectedValueException('value \'' . print_r($object->recurring, true) . '\' is not an object');
136: }
137: $value = new CardRecurrenceDetails();
138: $this->recurring = $value->fromObject($object->recurring);
139: }
140: if (property_exists($object, 'requiresApproval')) {
141: $this->requiresApproval = $object->requiresApproval;
142: }
143: if (property_exists($object, 'skipFraudService')) {
144: $this->skipFraudService = $object->skipFraudService;
145: }
146: if (property_exists($object, 'token')) {
147: $this->token = $object->token;
148: }
149: if (property_exists($object, 'tokenize')) {
150: $this->tokenize = $object->tokenize;
151: }
152: if (property_exists($object, 'unscheduledCardOnFileRequestor')) {
153: $this->unscheduledCardOnFileRequestor = $object->unscheduledCardOnFileRequestor;
154: }
155: if (property_exists($object, 'unscheduledCardOnFileSequenceIndicator')) {
156: $this->unscheduledCardOnFileSequenceIndicator = $object->unscheduledCardOnFileSequenceIndicator;
157: }
158: return $this;
159: }
160: }
161: