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
|
|
|
public function getId() |
55
|
|
|
{ |
56
|
|
|
return $this->id; |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
public function getType() |
60
|
|
|
{ |
61
|
|
|
return $this->type; |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
public function getCard() |
65
|
|
|
{ |
66
|
|
|
return $this->card; |
67
|
|
|
} |
68
|
|
|
|
69
|
|
|
public function getBillingAddress() |
70
|
|
|
{ |
71
|
|
|
return $this->billing_address; |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
public function getBillingEmail() |
75
|
|
|
{ |
76
|
|
|
return $this->billing_email; |
77
|
|
|
} |
78
|
|
|
|
79
|
|
|
public function getBillingName() |
80
|
|
|
{ |
81
|
|
|
return $this->billing_name; |
82
|
|
|
} |
83
|
|
|
|
84
|
|
|
public function getBillingPhoneNumber() |
85
|
|
|
{ |
86
|
|
|
return $this->billing_phone_number; |
87
|
|
|
} |
88
|
|
|
|
89
|
|
|
public function getKind() |
90
|
|
|
{ |
91
|
|
|
return $this->kind; |
92
|
|
|
} |
93
|
|
|
|
94
|
|
|
public function getLivemode() |
95
|
|
|
{ |
96
|
|
|
return $this->livemode; |
97
|
|
|
} |
98
|
|
|
|
99
|
|
|
public function getUsed() |
100
|
|
|
{ |
101
|
|
|
return $this->used; |
102
|
|
|
} |
103
|
|
|
|
104
|
|
|
public function getCreatedAt() |
105
|
|
|
{ |
106
|
|
|
return $this->created_at; |
107
|
|
|
} |
108
|
|
|
|
109
|
|
|
public function getUpdatedAt() |
110
|
|
|
{ |
111
|
|
|
return $this->updated_at; |
112
|
|
|
} |
113
|
|
|
|
114
|
|
|
public function getData() |
115
|
|
|
{ |
116
|
|
|
return $this->data; |
117
|
|
|
} |
118
|
|
|
} |
119
|
|
|
|