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: * @deprecated Use ShoppingCart.amountBreakdown instead
14: */
15: class Level3SummaryData extends DataObject
16: {
17: /**
18: * @var int
19: * @deprecated Use ShoppingCart.amountBreakdown with type DISCOUNT instead
20: */
21: public $discountAmount = null;
22:
23: /**
24: * @var int
25: * @deprecated Use ShoppingCart.amountBreakdown with type DUTY instead
26: */
27: public $dutyAmount = null;
28:
29: /**
30: * @var int
31: * @deprecated Use ShoppingCart.amountBreakdown with type SHIPPING instead
32: */
33: public $shippingAmount = null;
34:
35: /**
36: * @return object
37: */
38: public function toObject()
39: {
40: $object = parent::toObject();
41: if (!is_null($this->discountAmount)) {
42: $object->discountAmount = $this->discountAmount;
43: }
44: if (!is_null($this->dutyAmount)) {
45: $object->dutyAmount = $this->dutyAmount;
46: }
47: if (!is_null($this->shippingAmount)) {
48: $object->shippingAmount = $this->shippingAmount;
49: }
50: return $object;
51: }
52:
53: /**
54: * @param object $object
55: * @return $this
56: * @throws UnexpectedValueException
57: */
58: public function fromObject($object)
59: {
60: parent::fromObject($object);
61: if (property_exists($object, 'discountAmount')) {
62: $this->discountAmount = $object->discountAmount;
63: }
64: if (property_exists($object, 'dutyAmount')) {
65: $this->dutyAmount = $object->dutyAmount;
66: }
67: if (property_exists($object, 'shippingAmount')) {
68: $this->shippingAmount = $object->shippingAmount;
69: }
70: return $this;
71: }
72: }
73: