1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Pagantis\OrdersApiClient\Model\Order; |
4
|
|
|
|
5
|
|
|
use Pagantis\OrdersApiClient\Model\AbstractModel; |
6
|
|
|
use Pagantis\OrdersApiClient\Model\Order\ShoppingCart\Details; |
7
|
|
|
|
8
|
|
|
/** |
9
|
|
|
* Class ShoppingCart |
10
|
|
|
* @package Pagantis\OrdersApiClient\Model\Order |
11
|
|
|
*/ |
12
|
|
|
class ShoppingCart extends AbstractModel |
13
|
|
|
{ |
14
|
|
|
/** |
15
|
|
|
* @var Details $details |
16
|
|
|
*/ |
17
|
|
|
protected $details; |
18
|
|
|
|
19
|
|
|
/** |
20
|
|
|
* @var string $order_reference Order reference in merchant side |
21
|
|
|
*/ |
22
|
|
|
protected $orderReference; |
23
|
|
|
|
24
|
|
|
/** |
25
|
|
|
* @var int $promotedAmount The part in cents from the totalAmount that is promoted |
26
|
|
|
*/ |
27
|
|
|
protected $promotedAmount; |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* @var int $totalAmount The total amount of the order in cents that will be charged to the user |
31
|
|
|
*/ |
32
|
|
|
protected $totalAmount; |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* Not adding setters nor getters |
36
|
|
|
* |
37
|
|
|
* @deprecated |
38
|
|
|
*/ |
39
|
|
|
protected $deprecatedOrderDescription; |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* ShoppingCart constructor. |
43
|
|
|
*/ |
44
|
|
|
public function __construct() |
45
|
|
|
{ |
46
|
|
|
$this->details = new Details(); |
47
|
|
|
} |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* @return Details |
51
|
|
|
*/ |
52
|
|
|
public function getDetails() |
53
|
|
|
{ |
54
|
|
|
return $this->details; |
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* @param Details $details |
59
|
|
|
* |
60
|
|
|
* @return ShoppingCart |
61
|
|
|
*/ |
62
|
|
|
public function setDetails($details) |
63
|
|
|
{ |
64
|
|
|
$this->details = $details; |
65
|
|
|
|
66
|
|
|
return $this; |
67
|
|
|
} |
68
|
|
|
|
69
|
|
|
/** |
70
|
|
|
* @return string |
71
|
|
|
*/ |
72
|
|
|
public function getOrderReference() |
73
|
|
|
{ |
74
|
|
|
return $this->orderReference; |
75
|
|
|
} |
76
|
|
|
|
77
|
|
|
/** |
78
|
|
|
* @param string $orderReference |
79
|
|
|
* |
80
|
|
|
* @return ShoppingCart |
81
|
|
|
*/ |
82
|
|
|
public function setOrderReference($orderReference) |
83
|
|
|
{ |
84
|
|
|
$this->orderReference = $orderReference; |
85
|
|
|
|
86
|
|
|
return $this; |
87
|
|
|
} |
88
|
|
|
|
89
|
|
|
/** |
90
|
|
|
* @return int |
91
|
|
|
*/ |
92
|
|
|
public function getPromotedAmount() |
93
|
|
|
{ |
94
|
|
|
return $this->promotedAmount; |
95
|
|
|
} |
96
|
|
|
|
97
|
|
|
/** |
98
|
|
|
* @param $promotedAmount |
99
|
|
|
* |
100
|
|
|
* @return $this |
101
|
|
|
*/ |
102
|
|
|
public function setPromotedAmount($promotedAmount) |
103
|
|
|
{ |
104
|
|
|
$this->promotedAmount = $promotedAmount; |
105
|
|
|
|
106
|
|
|
return $this; |
107
|
|
|
} |
108
|
|
|
|
109
|
|
|
/** |
110
|
|
|
* @return int |
111
|
|
|
*/ |
112
|
|
|
public function getTotalAmount() |
113
|
|
|
{ |
114
|
|
|
return $this->totalAmount; |
115
|
|
|
} |
116
|
|
|
|
117
|
|
|
/** |
118
|
|
|
* @param $totalAmount |
119
|
|
|
* |
120
|
|
|
* @return $this |
121
|
|
|
*/ |
122
|
|
|
public function setTotalAmount($totalAmount) |
123
|
|
|
{ |
124
|
|
|
$this->totalAmount = $totalAmount; |
125
|
|
|
|
126
|
|
|
return $this; |
127
|
|
|
} |
128
|
|
|
} |
129
|
|
|
|