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: use Worldline\Connect\Sdk\Domain\DataObject;
10:
11: /**
12: * @package Worldline\Connect\Sdk\V1\Domain
13: */
14: class MobilePaymentProduct320SpecificInputHostedCheckout extends DataObject
15: {
16: /**
17: * @var string|null
18: */
19: public ?string $merchantName = null;
20:
21: /**
22: * @var string|null
23: */
24: public ?string $merchantOrigin = null;
25:
26: /**
27: * @var GPayThreeDSecure|null
28: */
29: public ?GPayThreeDSecure $threeDSecure = null;
30:
31: /**
32: * @return object
33: */
34: public function toObject(): object
35: {
36: $object = parent::toObject();
37: if (!is_null($this->merchantName)) {
38: $object->merchantName = $this->merchantName;
39: }
40: if (!is_null($this->merchantOrigin)) {
41: $object->merchantOrigin = $this->merchantOrigin;
42: }
43: if (!is_null($this->threeDSecure)) {
44: $object->threeDSecure = $this->threeDSecure->toObject();
45: }
46: return $object;
47: }
48:
49: /**
50: * @param object $object
51: *
52: * @return $this
53: * @throws UnexpectedValueException
54: */
55: public function fromObject(object $object): MobilePaymentProduct320SpecificInputHostedCheckout
56: {
57: parent::fromObject($object);
58: if (property_exists($object, 'merchantName')) {
59: $this->merchantName = $object->merchantName;
60: }
61: if (property_exists($object, 'merchantOrigin')) {
62: $this->merchantOrigin = $object->merchantOrigin;
63: }
64: if (property_exists($object, 'threeDSecure')) {
65: if (!is_object($object->threeDSecure)) {
66: throw new UnexpectedValueException('value \'' . print_r($object->threeDSecure, true) . '\' is not an object');
67: }
68: $value = new GPayThreeDSecure();
69: $this->threeDSecure = $value->fromObject($object->threeDSecure);
70: }
71: return $this;
72: }
73: }
74: