line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::Stripe::Card; |
2
|
|
|
|
|
|
|
$Net::Stripe::Card::VERSION = '0.41'; |
3
|
2
|
|
|
2
|
|
16
|
use Moose; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
19
|
|
4
|
2
|
|
|
2
|
|
10609
|
use Kavorka; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
24
|
|
5
|
2
|
|
|
2
|
|
1702
|
use Net::Stripe::Token; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
417
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# ABSTRACT: represent a Card object from Stripe |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# Input fields |
10
|
|
|
|
|
|
|
has 'number' => (is => 'ro', isa => 'Maybe[Str]'); |
11
|
|
|
|
|
|
|
has 'cvc' => (is => 'ro', isa => 'Maybe[Int]'); |
12
|
|
|
|
|
|
|
has 'name' => (is => 'ro', isa => 'Maybe[Str]'); |
13
|
|
|
|
|
|
|
has 'address_line1' => (is => 'ro', isa => 'Maybe[Str]'); |
14
|
|
|
|
|
|
|
has 'address_line2' => (is => 'ro', isa => 'Maybe[Str]'); |
15
|
|
|
|
|
|
|
has 'address_zip' => (is => 'ro', isa => 'Maybe[Str]'); |
16
|
|
|
|
|
|
|
has 'address_city' => (is => 'ro', isa => 'Maybe[Str]'); |
17
|
|
|
|
|
|
|
has 'address_state' => (is => 'ro', isa => 'Maybe[Str]'); |
18
|
|
|
|
|
|
|
has 'address_country' => (is => 'ro', isa => 'Maybe[Str]'); |
19
|
|
|
|
|
|
|
has 'metadata' => (is => 'ro', isa => 'Maybe[HashRef]'); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
# Both input and output |
22
|
|
|
|
|
|
|
has 'exp_month' => (is => 'ro', isa => 'Maybe[Int]', required => 1); |
23
|
|
|
|
|
|
|
has 'exp_year' => (is => 'ro', isa => 'Maybe[Int]', required => 1); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
# Output fields |
26
|
|
|
|
|
|
|
has 'id' => (is => 'ro', isa => 'Maybe[Str]'); |
27
|
|
|
|
|
|
|
has 'address_line1_check' => (is => 'ro', isa => 'Maybe[Str]'); |
28
|
|
|
|
|
|
|
has 'address_zip_check' => (is => 'ro', isa => 'Maybe[Str]'); |
29
|
|
|
|
|
|
|
has 'country' => (is => 'ro', isa => 'Maybe[Str]'); |
30
|
|
|
|
|
|
|
has 'cvc_check' => (is => 'ro', isa => 'Maybe[Str]'); |
31
|
|
|
|
|
|
|
has 'fingerprint' => (is => 'ro', isa => 'Maybe[Str]'); |
32
|
|
|
|
|
|
|
has 'last4' => (is => 'ro', isa => 'Maybe[Str]'); |
33
|
|
|
|
|
|
|
has 'brand' => (is => 'ro', isa => 'Maybe[Str]'); # formerly 'type' |
34
|
|
|
|
|
|
|
|
35
|
2
|
50
|
|
2
|
|
3353
|
method form_fields_for_card_metadata { |
|
2
|
|
|
2
|
|
4
|
|
|
2
|
|
|
|
|
415
|
|
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
3
|
|
36
|
2
|
|
|
|
|
61
|
my $metadata = $self->metadata(); |
37
|
2
|
|
|
|
|
5
|
my @metadata = (); |
38
|
2
|
|
|
|
|
10
|
while( my($k,$v) = each(%$metadata) ) { |
39
|
0
|
|
|
|
|
0
|
push @metadata, 'card[metadata]['.$k.']'; |
40
|
0
|
|
|
|
|
0
|
push @metadata, $v; |
41
|
|
|
|
|
|
|
} |
42
|
2
|
|
|
|
|
9
|
return @metadata; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
2
|
50
|
|
2
|
|
2516
|
method form_fields { |
|
2
|
|
|
2
|
|
7
|
|
|
2
|
|
|
|
|
480
|
|
|
2
|
|
|
|
|
26
|
|
|
2
|
|
|
|
|
4
|
|
46
|
|
|
|
|
|
|
return ( |
47
|
|
|
|
|
|
|
$self->form_fields_for_card_metadata(), |
48
|
8
|
|
|
|
|
209
|
map { ("card[$_]" => $self->$_) } |
49
|
2
|
|
|
|
|
8
|
grep { defined $self->$_ } |
|
22
|
|
|
|
|
589
|
|
50
|
|
|
|
|
|
|
qw/number cvc name address_line1 address_line2 address_zip |
51
|
|
|
|
|
|
|
address_city address_state address_country exp_month exp_year/ |
52
|
|
|
|
|
|
|
); |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
56
|
|
|
|
|
|
|
1; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
__END__ |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=pod |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 NAME |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
Net::Stripe::Card - represent a Card object from Stripe |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 VERSION |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
version 0.41 |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=head2 address_city |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
Reader: address_city |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
Type: Maybe[Str] |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head2 address_country |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
Reader: address_country |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
Type: Maybe[Str] |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head2 address_line1 |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
Reader: address_line1 |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
Type: Maybe[Str] |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head2 address_line1_check |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
Reader: address_line1_check |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
Type: Maybe[Str] |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=head2 address_line2 |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
Reader: address_line2 |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
Type: Maybe[Str] |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=head2 address_state |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
Reader: address_state |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
Type: Maybe[Str] |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=head2 address_zip |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
Reader: address_zip |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
Type: Maybe[Str] |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=head2 address_zip_check |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
Reader: address_zip_check |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
Type: Maybe[Str] |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=head2 brand |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
Reader: brand |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
Type: Maybe[Str] |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
=head2 country |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
Reader: country |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
Type: Maybe[Str] |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=head2 cvc |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
Reader: cvc |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
Type: Maybe[Int] |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
=head2 cvc_check |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
Reader: cvc_check |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
Type: Maybe[Str] |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
=head2 exp_month |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
Reader: exp_month |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
Type: Maybe[Int] |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
This attribute is required. |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
=head2 exp_year |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
Reader: exp_year |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
Type: Maybe[Int] |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
This attribute is required. |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
=head2 fingerprint |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
Reader: fingerprint |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
Type: Maybe[Str] |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
=head2 id |
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
Reader: id |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
Type: Maybe[Str] |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
=head2 last4 |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
Reader: last4 |
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
Type: Maybe[Str] |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
=head2 metadata |
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
Reader: metadata |
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
Type: Maybe[HashRef] |
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
=head2 name |
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
Reader: name |
187
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
Type: Maybe[Str] |
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
=head2 number |
191
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
Reader: number |
193
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
Type: Maybe[Str] |
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
=head1 AUTHORS |
197
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
=over 4 |
199
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
=item * |
201
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
Luke Closs |
203
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
=item * |
205
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
Rusty Conover |
207
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
=back |
209
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
211
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
This software is copyright (c) 2015 by Prime Radiant, Inc., (c) copyright 2014 Lucky Dinosaur LLC. |
213
|
|
|
|
|
|
|
|
214
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
215
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
216
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
=cut |