Failed Conditions
Push — feature/post-pay ( 4d43ec...e3663d )
by Remco
04:52
created

OrderItem::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 4
dl 0
loc 5
ccs 0
cts 5
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Order item.
4
 *
5
 * @author    Pronamic <[email protected]>
6
 * @copyright 2005-2018 Pronamic
7
 * @license   GPL-3.0-or-later
8
 * @package   Pronamic\WordPress\Pay\Gateways\OmniKassa2
9
 */
10
11
namespace Pronamic\WordPress\Pay\Gateways\OmniKassa2;
12
13
/**
14
 * Order item.
15
 *
16
 * @author  Reüel van der Steege
17
 * @version 2.0.3
18
 * @since   2.0.3
19
 */
20
class OrderItem {
21
	/**
22
	 * Item id.
23
	 *
24
	 * @var string
25
	 */
26
	private $id;
27
28
	/**
29
	 * Item name (required).
30
	 *
31
	 * @var string
32
	 */
33
	private $name;
34
35
	/**
36
	 * Description.
37
	 *
38
	 * @var string
39
	 */
40
	private $description;
41
42
	/**
43
	 * Quantity (required).
44
	 *
45
	 * @var int
46
	 */
47
	private $quantity;
48
49
	/**
50
	 * Amount (required).
51
	 *
52
	 * @var Money
53
	 */
54
	private $amount;
55
56
	/**
57
	 * Tax.
58
	 *
59
	 * @var Money
60
	 */
61
	private $tax;
62
63
	/**
64
	 * Category; physical or digital (required).
65
	 *
66
	 * @var string
67
	 */
68
	private $category;
69
70
	/**
71
	 * VAT category.
72
	 *
73
	 * @var int
74
	 */
75
	private $vat_category;
76
77
	/**
78
	 * Construct order result.
79
	 *
80
	 * @param string $name     Name.
81
	 * @param int    $quantity Quantity.
82
	 * @param Money  $amount   Amount.
83
	 * @param string $category Category.
84
	 */
85
	public function __construct( $name, $quantity, Money $amount, $category ) {
86
		$this->name     = $name;
87
		$this->quantity = $quantity;
88
		$this->amount   = $amount;
89
		$this->category = $category;
90
	}
91
92
	/**
93
	 * Get item ID.
94
	 *
95
	 * @return string
96
	 */
97
	public function get_id() {
98
		return $this->id;
99
	}
100
101
	/**
102
	 * Get item name.
103
	 *
104
	 * @return string
105
	 */
106
	public function get_name() {
107
		return $this->name;
108
	}
109
110
	/**
111
	 * Get item description.
112
	 *
113
	 * @return int|string
114
	 */
115
	public function get_description() {
116
		return $this->description;
117
	}
118
119
	/**
120
	 * Get quantity.
121
	 *
122
	 * @return int
123
	 */
124
	public function get_quantity() {
125
		return $this->quantity;
126
	}
127
128
	/**
129
	 * Get amount.
130
	 *
131
	 * @return Money
132
	 */
133
	public function get_amount() {
134
		return $this->amount;
135
	}
136
137
	/**
138
	 * Get tax.
139
	 *
140
	 * @return Money
141
	 */
142
	public function get_tax() {
143
		return $this->tax;
144
	}
145
146
	/**
147
	 * Get category.
148
	 *
149
	 * @return string
150
	 */
151
	public function get_category() {
152
		return $this->category;
153
	}
154
155
	/**
156
	 * Get VAT category.
157
	 *
158
	 * @return int
159
	 */
160
	public function get_vat_category() {
161
		return $this->vat_category;
162
	}
163
}
164