line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::Stripe::Invoice; |
2
|
|
|
|
|
|
|
$Net::Stripe::Invoice::VERSION = '0.42'; |
3
|
2
|
|
|
2
|
|
17
|
use Moose; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
21
|
|
4
|
2
|
|
|
2
|
|
14637
|
use Kavorka; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
19
|
|
5
|
|
|
|
|
|
|
extends 'Net::Stripe::Resource'; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# ABSTRACT: represent an Invoice object from Stripe |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
has 'id' => ( is => 'ro', isa => 'Maybe[Str]' ); |
10
|
|
|
|
|
|
|
has 'created' => ( is => 'ro', isa => 'Maybe[Int]' ); |
11
|
|
|
|
|
|
|
has 'subtotal' => ( is => 'ro', isa => 'Maybe[Int]', required => 1 ); |
12
|
|
|
|
|
|
|
has 'amount_due' => ( is => 'ro', isa => 'Maybe[Int]', required => 1 ); |
13
|
|
|
|
|
|
|
has 'attempt_count' => ( is => 'ro', isa => 'Maybe[Int]', required => 1 ); |
14
|
|
|
|
|
|
|
has 'attempted' => ( is => 'ro', isa => 'Maybe[Bool|Object]', required => 1 ); |
15
|
|
|
|
|
|
|
has 'closed' => ( is => 'ro', isa => 'Maybe[Bool|Object]', trigger => \&_closed_change_detector); |
16
|
|
|
|
|
|
|
has 'auto_advance' => ( is => 'ro', isa => 'Maybe[Bool]'); |
17
|
|
|
|
|
|
|
has 'created' => ( is => 'ro', isa => 'Maybe[Int]' ); |
18
|
|
|
|
|
|
|
has 'customer' => ( is => 'ro', isa => 'Maybe[Str]', required => 1 ); |
19
|
|
|
|
|
|
|
has 'date' => ( is => 'ro', isa => 'Maybe[Str]' ); |
20
|
|
|
|
|
|
|
has 'lines' => ( is => 'ro', isa => 'Net::Stripe::List', required => 1 ); |
21
|
|
|
|
|
|
|
has 'paid' => ( is => 'ro', isa => 'Maybe[Bool|Object]', required => 1 ); |
22
|
|
|
|
|
|
|
has 'period_end' => ( is => 'ro', isa => 'Maybe[Int]' ); |
23
|
|
|
|
|
|
|
has 'period_start' => ( is => 'ro', isa => 'Maybe[Int]' ); |
24
|
|
|
|
|
|
|
has 'starting_balance' => ( is => 'ro', isa => 'Maybe[Int]' ); |
25
|
|
|
|
|
|
|
has 'subtotal' => ( is => 'ro', isa => 'Maybe[Int]' ); |
26
|
|
|
|
|
|
|
has 'total' => ( is => 'ro', isa => 'Maybe[Int]', required => 1 ); |
27
|
|
|
|
|
|
|
has 'charge' => ( is => 'ro', isa => 'Maybe[Str]' ); |
28
|
|
|
|
|
|
|
has 'ending_balance' => ( is => 'ro', isa => 'Maybe[Int]' ); |
29
|
|
|
|
|
|
|
has 'next_payment_attempt' => ( is => 'ro', isa => 'Maybe[Int]' ); |
30
|
|
|
|
|
|
|
has 'metadata' => ( is => 'rw', isa => 'HashRef'); |
31
|
|
|
|
|
|
|
has 'description' => (is => 'rw', isa => 'Maybe[Str]'); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub _closed_change_detector { |
34
|
0
|
|
|
0
|
|
|
my ($instance, $new_value, $orig_value) = @_; |
35
|
|
|
|
|
|
|
# Strip can update invoices but only wants to see the closed flag if it has been changed. |
36
|
|
|
|
|
|
|
# Meaning if you retrieve an invoice then try to update it, and it is already closed |
37
|
|
|
|
|
|
|
# it will reject the update. |
38
|
0
|
0
|
0
|
|
|
|
if (!defined($orig_value) || $new_value ne $orig_value) { |
39
|
0
|
|
|
|
|
|
$instance->{closed_value_changed} = 1; |
40
|
|
|
|
|
|
|
} |
41
|
0
|
|
|
|
|
|
return; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
2
|
0
|
|
2
|
|
5583
|
method form_fields { |
|
2
|
|
|
0
|
|
4
|
|
|
2
|
|
|
|
|
442
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
return $self->form_fields_for( |
46
|
|
|
|
|
|
|
qw/description metadata auto_advance/, |
47
|
0
|
0
|
|
|
|
|
($self->{closed_value_changed} ? qw/closed/ : ()) |
48
|
|
|
|
|
|
|
); |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
52
|
|
|
|
|
|
|
1; |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
__END__ |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=pod |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 NAME |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
Net::Stripe::Invoice - represent an Invoice object from Stripe |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 VERSION |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
version 0.42 |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head2 amount_due |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
Reader: amount_due |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
Type: Maybe[Int] |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
This attribute is required. |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head2 attempt_count |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
Reader: attempt_count |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
Type: Maybe[Int] |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
This attribute is required. |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head2 attempted |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
Reader: attempted |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
Type: Maybe[Bool|Object] |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
This attribute is required. |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=head2 auto_advance |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
Reader: auto_advance |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
Type: Maybe[Bool] |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=head2 boolean_attributes |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
Reader: boolean_attributes |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
Type: ArrayRef[Str] |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=head2 charge |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
Reader: charge |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
Type: Maybe[Str] |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=head2 closed |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
Reader: closed |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
Type: Maybe[Bool|Object] |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=head2 created |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
Reader: created |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
Type: Maybe[Int] |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=head2 customer |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
Reader: customer |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
Type: Maybe[Str] |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
This attribute is required. |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
=head2 date |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
Reader: date |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
Type: Maybe[Str] |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
=head2 description |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
Reader: description |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
Writer: description |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
Type: Maybe[Str] |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
=head2 ending_balance |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
Reader: ending_balance |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
Type: Maybe[Int] |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
=head2 id |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
Reader: id |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
Type: Maybe[Str] |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
=head2 lines |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
Reader: lines |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
Type: Net::Stripe::List |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
This attribute is required. |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
=head2 metadata |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
Reader: metadata |
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
Writer: metadata |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
Type: HashRef |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
=head2 next_payment_attempt |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
Reader: next_payment_attempt |
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
Type: Maybe[Int] |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
=head2 paid |
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
Reader: paid |
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
Type: Maybe[Bool|Object] |
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
This attribute is required. |
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
=head2 period_end |
187
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
Reader: period_end |
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
Type: Maybe[Int] |
191
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
=head2 period_start |
193
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
Reader: period_start |
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
Type: Maybe[Int] |
197
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
=head2 starting_balance |
199
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
Reader: starting_balance |
201
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
Type: Maybe[Int] |
203
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
=head2 subtotal |
205
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
Reader: subtotal |
207
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
Type: Maybe[Int] |
209
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
=head2 total |
211
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
Reader: total |
213
|
|
|
|
|
|
|
|
214
|
|
|
|
|
|
|
Type: Maybe[Int] |
215
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
This attribute is required. |
217
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
=head1 AUTHORS |
219
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
=over 4 |
221
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
=item * |
223
|
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
Luke Closs |
225
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
=item * |
227
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
Rusty Conover |
229
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
=back |
231
|
|
|
|
|
|
|
|
232
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
233
|
|
|
|
|
|
|
|
234
|
|
|
|
|
|
|
This software is copyright (c) 2015 by Prime Radiant, Inc., (c) copyright 2014 Lucky Dinosaur LLC. |
235
|
|
|
|
|
|
|
|
236
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
237
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
238
|
|
|
|
|
|
|
|
239
|
|
|
|
|
|
|
=cut |