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 AbstractRedirectPaymentMethodSpecificInput extends AbstractPaymentMethodSpecificInput
14: {
15: /**
16: * @var int|null
17: */
18: public ?int $expirationPeriod = null;
19:
20: /**
21: * @var string|null
22: */
23: public ?string $recurringPaymentSequenceIndicator = null;
24:
25: /**
26: * @var bool|null
27: */
28: public ?bool $requiresApproval = null;
29:
30: /**
31: * @var string|null
32: */
33: public ?string $token = null;
34:
35: /**
36: * @var bool|null
37: */
38: public ?bool $tokenize = null;
39:
40: /**
41: * @return object
42: */
43: public function toObject(): object
44: {
45: $object = parent::toObject();
46: if (!is_null($this->expirationPeriod)) {
47: $object->expirationPeriod = $this->expirationPeriod;
48: }
49: if (!is_null($this->recurringPaymentSequenceIndicator)) {
50: $object->recurringPaymentSequenceIndicator = $this->recurringPaymentSequenceIndicator;
51: }
52: if (!is_null($this->requiresApproval)) {
53: $object->requiresApproval = $this->requiresApproval;
54: }
55: if (!is_null($this->token)) {
56: $object->token = $this->token;
57: }
58: if (!is_null($this->tokenize)) {
59: $object->tokenize = $this->tokenize;
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): AbstractRedirectPaymentMethodSpecificInput
71: {
72: parent::fromObject($object);
73: if (property_exists($object, 'expirationPeriod')) {
74: $this->expirationPeriod = $object->expirationPeriod;
75: }
76: if (property_exists($object, 'recurringPaymentSequenceIndicator')) {
77: $this->recurringPaymentSequenceIndicator = $object->recurringPaymentSequenceIndicator;
78: }
79: if (property_exists($object, 'requiresApproval')) {
80: $this->requiresApproval = $object->requiresApproval;
81: }
82: if (property_exists($object, 'token')) {
83: $this->token = $object->token;
84: }
85: if (property_exists($object, 'tokenize')) {
86: $this->tokenize = $object->tokenize;
87: }
88: return $this;
89: }
90: }
91: