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