1: <?php
2: /*
3: * This file was automatically generated.
4: */
5: namespace Worldline\Acquiring\Sdk\V1\Domain;
6:
7: use UnexpectedValueException;
8: use Worldline\Acquiring\Sdk\Domain\DataObject;
9:
10: /**
11: * @package Worldline\Acquiring\Sdk\V1\Domain
12: */
13: class OriginalTransactionSummaryData extends DataObject
14: {
15: /**
16: * @var string|null
17: */
18: public ?string $cardholderVerificationMethod = null;
19:
20: /**
21: * @var string|null
22: */
23: public ?string $paymentCategory = null;
24:
25: /**
26: * @var PaymentMethodDataBase|null
27: */
28: public ?PaymentMethodDataBase $paymentMethodData = null;
29:
30: /**
31: * @var string|null
32: */
33: public ?string $pointOfSaleEntryMode = null;
34:
35: /**
36: * @var TransactionReferencesBase|null
37: */
38: public ?TransactionReferencesBase $transactionReferences = null;
39:
40: /**
41: * @return object
42: */
43: public function toObject(): object
44: {
45: $object = parent::toObject();
46: if (!is_null($this->cardholderVerificationMethod)) {
47: $object->cardholderVerificationMethod = $this->cardholderVerificationMethod;
48: }
49: if (!is_null($this->paymentCategory)) {
50: $object->paymentCategory = $this->paymentCategory;
51: }
52: if (!is_null($this->paymentMethodData)) {
53: $object->paymentMethodData = $this->paymentMethodData->toObject();
54: }
55: if (!is_null($this->pointOfSaleEntryMode)) {
56: $object->pointOfSaleEntryMode = $this->pointOfSaleEntryMode;
57: }
58: if (!is_null($this->transactionReferences)) {
59: $object->transactionReferences = $this->transactionReferences->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): OriginalTransactionSummaryData
71: {
72: parent::fromObject($object);
73: if (property_exists($object, 'cardholderVerificationMethod')) {
74: $this->cardholderVerificationMethod = $object->cardholderVerificationMethod;
75: }
76: if (property_exists($object, 'paymentCategory')) {
77: $this->paymentCategory = $object->paymentCategory;
78: }
79: if (property_exists($object, 'paymentMethodData')) {
80: if (!is_object($object->paymentMethodData)) {
81: throw new UnexpectedValueException('value \'' . print_r($object->paymentMethodData, true) . '\' is not an object');
82: }
83: $value = new PaymentMethodDataBase();
84: $this->paymentMethodData = $value->fromObject($object->paymentMethodData);
85: }
86: if (property_exists($object, 'pointOfSaleEntryMode')) {
87: $this->pointOfSaleEntryMode = $object->pointOfSaleEntryMode;
88: }
89: if (property_exists($object, 'transactionReferences')) {
90: if (!is_object($object->transactionReferences)) {
91: throw new UnexpectedValueException('value \'' . print_r($object->transactionReferences, true) . '\' is not an object');
92: }
93: $value = new TransactionReferencesBase();
94: $this->transactionReferences = $value->fromObject($object->transactionReferences);
95: }
96: return $this;
97: }
98: }
99: