1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Luigel\Paymongo\Models; |
4
|
|
|
|
5
|
|
|
class Token |
6
|
|
|
{ |
7
|
|
|
protected $data; |
8
|
|
|
protected $id; |
9
|
|
|
protected $type; |
10
|
|
|
protected $card; |
11
|
|
|
protected $kind; |
12
|
|
|
protected $livemode; |
13
|
|
|
protected $used; |
14
|
|
|
protected $created_at; |
15
|
|
|
protected $updated_at; |
16
|
|
|
protected $billing_address; |
17
|
|
|
protected $billing_email; |
18
|
|
|
protected $billing_name; |
19
|
|
|
protected $billing_phone_number; |
20
|
|
|
|
21
|
|
|
public function setData($data) |
22
|
|
|
{ |
23
|
|
|
$this->id = $data['id']; |
24
|
|
|
$this->type = $data['type']; |
25
|
|
|
$this->card = $data['attributes']['card']; |
26
|
|
|
$this->kind =$data['attributes']['kind']; |
27
|
|
|
$this->livemode = $data['attributes']['livemode']; |
28
|
|
|
$this->used = $data['attributes']['used']; |
29
|
|
|
$this->created_at = $data['attributes']['created_at']; |
30
|
|
|
$this->updated_at = $data['attributes']['updated_at']; |
31
|
|
|
$this->billing_address = $data['attributes']['billing']['address']; |
32
|
|
|
$this->billing_email = $data['attributes']['billing']['email']; |
33
|
|
|
$this->billing_name = $data['attributes']['billing']['name']; |
34
|
|
|
$this->billing_phone_number = $data['attributes']['billing']['phone']; |
35
|
|
|
|
36
|
|
|
$this->data = [ |
37
|
|
|
'id' => $this->id, |
38
|
|
|
'type' => $this->type, |
39
|
|
|
'card' => $this->card, |
40
|
|
|
'kind' => $this->kind, |
41
|
|
|
'livemode' => $this->livemode, |
42
|
|
|
'used' => $this->used, |
43
|
|
|
'created_at' => $this->created_at, |
44
|
|
|
'updated_at' => $this->updated_at, |
45
|
|
|
'billing_address' => $this->billing_address, |
46
|
|
|
'billing_email' => $this->billing_email, |
47
|
|
|
'billing_name' => $this->billing_name, |
48
|
|
|
'billing_phone_number' => $this->billing_phone_number, |
49
|
|
|
]; |
50
|
|
|
|
51
|
|
|
return $this; |
52
|
|
|
|
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
public function getId() |
56
|
|
|
{ |
57
|
|
|
return $this->id; |
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
public function getType() |
61
|
|
|
{ |
62
|
|
|
return $this->type; |
63
|
|
|
} |
64
|
|
|
|
65
|
|
|
public function getCard() |
66
|
|
|
{ |
67
|
|
|
return $this->card; |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
public function getBillingAddress() |
71
|
|
|
{ |
72
|
|
|
return $this->billing_address; |
73
|
|
|
} |
74
|
|
|
|
75
|
|
|
public function getBillingEmail() |
76
|
|
|
{ |
77
|
|
|
return $this->billing_email; |
78
|
|
|
} |
79
|
|
|
|
80
|
|
|
public function getBillingName() |
81
|
|
|
{ |
82
|
|
|
return $this->billing_name; |
83
|
|
|
} |
84
|
|
|
|
85
|
|
|
public function getBillingPhoneNumber() |
86
|
|
|
{ |
87
|
|
|
return $this->billing_phone_number; |
88
|
|
|
} |
89
|
|
|
|
90
|
|
|
public function getKind() |
91
|
|
|
{ |
92
|
|
|
return $this->kind; |
93
|
|
|
} |
94
|
|
|
|
95
|
|
|
public function getLivemode() |
96
|
|
|
{ |
97
|
|
|
return $this->livemode; |
98
|
|
|
} |
99
|
|
|
|
100
|
|
|
public function getUsed() |
101
|
|
|
{ |
102
|
|
|
return $this->used; |
103
|
|
|
} |
104
|
|
|
|
105
|
|
|
public function getCreatedAt() |
106
|
|
|
{ |
107
|
|
|
return $this->created_at; |
108
|
|
|
} |
109
|
|
|
|
110
|
|
|
public function getUpdatedAt() |
111
|
|
|
{ |
112
|
|
|
return $this->updated_at; |
113
|
|
|
} |
114
|
|
|
|
115
|
|
|
public function getData() |
116
|
|
|
{ |
117
|
|
|
return $this->data; |
118
|
|
|
} |
119
|
|
|
} |