1 <?php
2
3 namespace PayPal\Api;
4
5 use PayPal\Common\PayPalModel;
6 use PayPal\Converter\FormatConverter;
7 use PayPal\Validation\NumericValidator;
8
9 /**
10 * Class Tax
11 *
12 * Tax information.
13 *
14 * @package PayPal\Api
15 *
16 * @property string id
17 * @property string name
18 * @property \PayPal\Api\number percent
19 * @property \PayPal\Api\Currency amount
20 */
21 class Tax extends PayPalModel
22 {
23 /**
24 * The resource ID.
25 *
26 * @param string $id
27 *
28 * @return $this
29 */
30 public function setId($id)
31 {
32 $this->id = $id;
33 return $this;
34 }
35
36 /**
37 * The resource ID.
38 *
39 * @return string
40 */
41 public function getId()
42 {
43 return $this->id;
44 }
45
46 /**
47 * The tax name. Maximum length is 20 characters.
48 *
49 * @param string $name
50 *
51 * @return $this
52 */
53 public function setName($name)
54 {
55 $this->name = $name;
56 return $this;
57 }
58
59 /**
60 * The tax name. Maximum length is 20 characters.
61 *
62 * @return string
63 */
64 public function getName()
65 {
66 return $this->name;
67 }
68
69 /**
70 * The rate of the specified tax. Valid range is from 0.001 to 99.999.
71 *
72 * @param string|double $percent
73 *
74 * @return $this
75 */
76 public function setPercent($percent)
77 {
78 NumericValidator::validate($percent, "Percent");
79 $percent = FormatConverter::formatToPrice($percent);
80 $this->percent = $percent;
81 return $this;
82 }
83
84 /**
85 * The rate of the specified tax. Valid range is from 0.001 to 99.999.
86 *
87 * @return string
88 */
89 public function getPercent()
90 {
91 return $this->percent;
92 }
93
94 /**
95 * The tax as a monetary amount. Cannot be specified in a request.
96 *
97 * @param \PayPal\Api\Currency $amount
98 *
99 * @return $this
100 */
101 public function setAmount($amount)
102 {
103 $this->amount = $amount;
104 return $this;
105 }
106
107 /**
108 * The tax as a monetary amount. Cannot be specified in a request.
109 *
110 * @return \PayPal\Api\Currency
111 */
112 public function getAmount()
113 {
114 return $this->amount;
115 }
116
117 }
118