Completed
Push — master ( 7fa4ba...22bb8d )
by Rigel Kent
01:35
created

PaymentMethod::getBillingDetails()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Luigel\Paymongo\Models;
4
5
class PaymentMethod
6
{
7
    protected $data;
8
    protected $id;
9
    protected $type;
10
    protected $card_details;
11
    protected $payment_method_type;
12
    protected $billing;
13
    protected $created_at;
14
    protected $updated_at;
15
    protected $metadata;
16
17
    public function setData($data)
18
    {
19
        $this->id = $data['id'];
20
        $this->type = $data['type'];
21
        $this->payment_method_type = $data['attributes']['type'];
22
        $this->billing = $data['attributes']['billing'];
23
        $this->card_details = $data['attributes']['details'];
24
        $this->created_at = $data['attributes']['created_at'];
25
        $this->updated_at = $data['attributes']['updated_at'];
26
        $this->metadata = $data['attributes']['metadata'];
27
28
        $this->data = [
29
            'id' => $this->id,
30
            'type' => $this->type,
31
            'payment_method_type' => $this->payment_method_type,
32
            'billing' => $this->billing,
33
            'card_details' => $this->card_details,
34
            'created_at' => $this->created_at,
35
            'updated_at' => $this->updated_at,
36
            'metadata' => $this->metadata,
37
        ];
38
39
        return $this;
40
    }
41
42
    public function getData()
43
    {
44
        return $this->data;
45
    }
46
47
    public function getId()
48
    {
49
        return $this->id;
50
    }
51
52
    public function getType()
53
    {
54
        return $this->type;
55
    }
56
57
    public function getPaymentMethodType()
58
    {
59
        return $this->payment_method_type;
60
    }
61
62
    public function getBillingDetails()
63
    {
64
        return $this->billing;
65
    }
66
67
    public function getCreatedAt()
68
    {
69
        return $this->created_at;
70
    }
71
72
    public function getUpdatedDate()
73
    {
74
        return $this->updated_at;
75
    }
76
77
    public function getMetadata()
78
    {
79
        return $this->metadata;
80
    }
81
82
    public function getCardDetails()
83
    {
84
        return $this->card_details;
85
    }
86
}
87