Completed
Push — master ( 50beb4...e5dc16 )
by
unknown
03:58
created

Transaction::createInstance()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 7
nc 2
nop 0
1
<?php
2
3
namespace Padosoft\AffiliateNetwork;
4
5
/**
6
 * Class Transaction
7
 * @package Padosoft\AffiliateNetwork
8
 */
9
class Transaction
10
{
11
    /**
12
     * @var string
13
     */
14
    public $currency = '';
15
16
    /**
17
     * @var string
18
     */
19
    public $status = '';
20
21
    /**
22
     * @var float
23
     */
24
    public $amount = 0.00;
25
26
    /**
27
     * @var string
28
     */
29
    public $custom_ID = '';
30
31
    /**
32
     * @var string
33
     */
34
    public $title = '';
35
36
    /**
37
     * @var string
38
     */
39
    public $unique_ID = '';
40
41
    /**
42
     * @var double
43
     */
44
    public $commission = 0.00;
45
46
    /**
47
     * @var string
48
     */
49
    public $date = '';
50
51
    /**
52
     * @var int
53
     */
54
    public $merchant_ID = 0;
55
56
    /**
57
     * @var boolean
58
     */
59
    public $approved = false;
60
61
    /**
62
     * @method createInstance
63
     * @return obj istance
64
     */
65
    public static function createInstance()
66
    {
67
        $obj = null;
68
        try {
69
            $obj = new Transaction();
70
        } catch (\Exception $e) {
71
            throw new \Exception('Error creating instance Transaction - ' . $e->getMessage());
72
        }
73
        return $obj;
74
    }
75
76
}
77