Order::setSalesTax()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Getnet\API;
4
5
/**
6
 * Class Order
7
 *
8
 * @package Getnet\API
9
 */
10
class Order implements \JsonSerializable
11
{
12
    const PRODUCT_TYPE_CASH_CARRY       = "cash_carry";
13
    const PRODUCT_TYPE_DIGITAL_CONTENT  = "digital_content";
14
    const PRODUCT_TYPE_DIGITAL_GOODS    = "digital_goods";
15
    const PRODUCT_TYPE_DIGITAL_PHYSICAL = "digital_physical";
16
    const PRODUCT_TYPE_GIFT_CARD        = "gift_card";
17
    const PRODUCT_TYPE_PHISICAL_GOODS   = "phisical_goods";
18
    const PRODUCT_TYPE_RENEW_SUBS       = "renew_subs";
19
    const PRODUCT_TYPE_SHAREWARE        = "shareware";
20
    const PRODUCT_TYPE_SERVICE          = "service";
21
22
    /** @var */
23
    private $order_id;
24
25
    /** @var */
26
    private $product_type;
27
28
    /** @var int */
29
    private $sales_tax = 0;
30
31
    /**
32
     * Order constructor.
33
     * @param $order_id
34
     */
35
    public function __construct($order_id)
36
    {
37
        $this->order_id = $order_id;
38
    }
39
40
    /**
41
     * @return array|mixed
42
     */
43
    public function jsonSerialize()
44
    {
45
        return get_object_vars($this);
46
    }
47
48
    /**
49
     * @return mixed
50
     */
51
    public function getOrderId()
52
    {
53
        return $this->order_id;
54
    }
55
56
    /**
57
     * @param $order_id
58
     * @return $this
59
     */
60
    public function setOrderId($order_id)
61
    {
62
        $this->order_id = (string)$order_id;
63
64
        return $this;
65
    }
66
67
    /**
68
     * @return mixed
69
     */
70
    public function getProductType()
71
    {
72
        return $this->product_type;
73
    }
74
75
    /**
76
     * @param $product_type
77
     * @return $this
78
     */
79
    public function setProductType($product_type)
80
    {
81
        $this->product_type = (string)$product_type;
82
83
        return $this;
84
    }
85
86
    /**
87
     * @return mixed
88
     */
89
    public function getSalesTax()
90
    {
91
        return $this->sales_tax;
92
    }
93
94
    /**
95
     * @param $sales_tax
96
     * @return $this
97
     */
98
    public function setSalesTax($sales_tax)
99
    {
100
        $this->sales_tax = (int)($sales_tax * 100);
101
102
        return $this;
103
    }
104
}
105