line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
##---------------------------------------------------------------------------- |
2
|
|
|
|
|
|
|
## Stripe API - ~/lib/Net/API/Stripe/Billing/Invoice/Period.pm |
3
|
|
|
|
|
|
|
## Version v0.100.0 |
4
|
|
|
|
|
|
|
## Copyright(c) 2019 DEGUEST Pte. Ltd. |
5
|
|
|
|
|
|
|
## Author: Jacques Deguest <jack@deguest.jp> |
6
|
|
|
|
|
|
|
## Created 2019/11/02 |
7
|
|
|
|
|
|
|
## Modified 2020/05/15 |
8
|
|
|
|
|
|
|
## |
9
|
|
|
|
|
|
|
##---------------------------------------------------------------------------- |
10
|
|
|
|
|
|
|
BEGIN |
11
|
|
|
|
|
|
|
{ |
12
|
|
|
|
|
|
|
use strict; |
13
|
2
|
|
|
2
|
|
24351284
|
use warnings; |
|
2
|
|
|
|
|
13
|
|
|
2
|
|
|
|
|
62
|
|
14
|
2
|
|
|
2
|
|
10
|
use parent qw( Net::API::Stripe::Generic ); |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
58
|
|
15
|
2
|
|
|
2
|
|
10
|
use vars qw( $VERSION ); |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
10
|
|
16
|
2
|
|
|
2
|
|
161
|
our( $VERSION ) = 'v0.100.0'; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
123
|
|
17
|
2
|
|
|
2
|
|
40
|
}; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
use strict; |
20
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
41
|
|
21
|
2
|
|
|
2
|
|
10
|
|
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
186
|
|
22
|
|
|
|
|
|
|
|
23
|
0
|
|
|
0
|
1
|
|
|
24
|
|
|
|
|
|
|
1; |
25
|
0
|
|
|
0
|
1
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=encoding utf8 |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 NAME |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
Net::API::Stripe::Billing::Invoice::Period - A Stripe Invoice Period Object |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 SYNOPSIS |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
my $period = $invoice_line_item->period({ |
36
|
|
|
|
|
|
|
end => '2020-12-31', |
37
|
|
|
|
|
|
|
start => '2020-01-01', |
38
|
|
|
|
|
|
|
}); |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 VERSION |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
v0.100.0 |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 DESCRIPTION |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
The timespan covered by an invoice item. |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
This is instantiated from method B<period> in L<Net::API::Stripe::Billing::Invoice::Item> or method B<period> from L<Net::API::Stripe::Billing::Invoice::LineItem>. |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head1 CONSTRUCTOR |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head2 new( %ARG ) |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
Creates a new L<Net::API::Stripe::Billing::Invoice::Period> object. |
55
|
|
|
|
|
|
|
It may also take an hash like arguments, that also are method of the same name. |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 METHODS |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head2 end integer |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
End of the line item’s billing period |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head2 start integer |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
Start of the line item’s billing period |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 API SAMPLE |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
{ |
70
|
|
|
|
|
|
|
"id": "in_fake123456789", |
71
|
|
|
|
|
|
|
"object": "invoice", |
72
|
|
|
|
|
|
|
"account_country": "JP", |
73
|
|
|
|
|
|
|
"account_name": "Provider, Inc", |
74
|
|
|
|
|
|
|
"amount_due": 8000, |
75
|
|
|
|
|
|
|
"amount_paid": 8000, |
76
|
|
|
|
|
|
|
"amount_remaining": 0, |
77
|
|
|
|
|
|
|
"application_fee_amount": null, |
78
|
|
|
|
|
|
|
"attempt_count": 1, |
79
|
|
|
|
|
|
|
"attempted": true, |
80
|
|
|
|
|
|
|
"auto_advance": false, |
81
|
|
|
|
|
|
|
"billing": "charge_automatically", |
82
|
|
|
|
|
|
|
"billing_reason": "subscription", |
83
|
|
|
|
|
|
|
"charge": "ch_fake123456789", |
84
|
|
|
|
|
|
|
"collection_method": "charge_automatically", |
85
|
|
|
|
|
|
|
"created": 1507273919, |
86
|
|
|
|
|
|
|
"currency": "jpy", |
87
|
|
|
|
|
|
|
"custom_fields": null, |
88
|
|
|
|
|
|
|
"customer": "cus_fake123456789", |
89
|
|
|
|
|
|
|
"customer_address": null, |
90
|
|
|
|
|
|
|
"customer_email": "john.doe@example.com", |
91
|
|
|
|
|
|
|
"customer_name": null, |
92
|
|
|
|
|
|
|
"customer_phone": null, |
93
|
|
|
|
|
|
|
"customer_shipping": null, |
94
|
|
|
|
|
|
|
"customer_tax_exempt": "none", |
95
|
|
|
|
|
|
|
"customer_tax_ids": [], |
96
|
|
|
|
|
|
|
"default_payment_method": null, |
97
|
|
|
|
|
|
|
"default_source": null, |
98
|
|
|
|
|
|
|
"default_tax_rates": [], |
99
|
|
|
|
|
|
|
"description": null, |
100
|
|
|
|
|
|
|
"discount": null, |
101
|
|
|
|
|
|
|
"due_date": null, |
102
|
|
|
|
|
|
|
"ending_balance": 0, |
103
|
|
|
|
|
|
|
"footer": null, |
104
|
|
|
|
|
|
|
"hosted_invoice_url": "https://pay.stripe.com/invoice/invst_fake123456789", |
105
|
|
|
|
|
|
|
"invoice_pdf": "https://pay.stripe.com/invoice/invst_fake123456789/pdf", |
106
|
|
|
|
|
|
|
"lines": { |
107
|
|
|
|
|
|
|
"data": [ |
108
|
|
|
|
|
|
|
{ |
109
|
|
|
|
|
|
|
"id": "sli_fake123456789", |
110
|
|
|
|
|
|
|
"object": "line_item", |
111
|
|
|
|
|
|
|
"amount": 8000, |
112
|
|
|
|
|
|
|
"currency": "jpy", |
113
|
|
|
|
|
|
|
"description": "1 × Provider, Inc professional monthly membership (at ¥8,000 / month)", |
114
|
|
|
|
|
|
|
"discountable": true, |
115
|
|
|
|
|
|
|
"livemode": false, |
116
|
|
|
|
|
|
|
"metadata": {}, |
117
|
|
|
|
|
|
|
"period": { |
118
|
|
|
|
|
|
|
"end": 1559441759, |
119
|
|
|
|
|
|
|
"start": 1556763359 |
120
|
|
|
|
|
|
|
}, |
121
|
|
|
|
|
|
|
"plan": { |
122
|
|
|
|
|
|
|
"id": "professional-monthly-jpy", |
123
|
|
|
|
|
|
|
"object": "plan", |
124
|
|
|
|
|
|
|
"active": true, |
125
|
|
|
|
|
|
|
"aggregate_usage": null, |
126
|
|
|
|
|
|
|
"amount": 8000, |
127
|
|
|
|
|
|
|
"amount_decimal": "8000", |
128
|
|
|
|
|
|
|
"billing_scheme": "per_unit", |
129
|
|
|
|
|
|
|
"created": 1541833564, |
130
|
|
|
|
|
|
|
"currency": "jpy", |
131
|
|
|
|
|
|
|
"interval": "month", |
132
|
|
|
|
|
|
|
"interval_count": 1, |
133
|
|
|
|
|
|
|
"livemode": false, |
134
|
|
|
|
|
|
|
"metadata": {}, |
135
|
|
|
|
|
|
|
"nickname": null, |
136
|
|
|
|
|
|
|
"product": "prod_fake123456789", |
137
|
|
|
|
|
|
|
"tiers": null, |
138
|
|
|
|
|
|
|
"tiers_mode": null, |
139
|
|
|
|
|
|
|
"transform_usage": null, |
140
|
|
|
|
|
|
|
"trial_period_days": null, |
141
|
|
|
|
|
|
|
"usage_type": "licensed" |
142
|
|
|
|
|
|
|
}, |
143
|
|
|
|
|
|
|
"proration": false, |
144
|
|
|
|
|
|
|
"quantity": 1, |
145
|
|
|
|
|
|
|
"subscription": "sub_fake123456789", |
146
|
|
|
|
|
|
|
"subscription_item": "si_fake123456789", |
147
|
|
|
|
|
|
|
"tax_amounts": [], |
148
|
|
|
|
|
|
|
"tax_rates": [], |
149
|
|
|
|
|
|
|
"type": "subscription" |
150
|
|
|
|
|
|
|
} |
151
|
|
|
|
|
|
|
], |
152
|
|
|
|
|
|
|
"has_more": false, |
153
|
|
|
|
|
|
|
"object": "list", |
154
|
|
|
|
|
|
|
"url": "/v1/invoices/in_fake123456789/lines" |
155
|
|
|
|
|
|
|
}, |
156
|
|
|
|
|
|
|
"livemode": false, |
157
|
|
|
|
|
|
|
"metadata": {}, |
158
|
|
|
|
|
|
|
"next_payment_attempt": null, |
159
|
|
|
|
|
|
|
"number": "53DB91F-0001", |
160
|
|
|
|
|
|
|
"paid": true, |
161
|
|
|
|
|
|
|
"payment_intent": null, |
162
|
|
|
|
|
|
|
"period_end": 1507273919, |
163
|
|
|
|
|
|
|
"period_start": 1507273919, |
164
|
|
|
|
|
|
|
"post_payment_credit_notes_amount": 0, |
165
|
|
|
|
|
|
|
"pre_payment_credit_notes_amount": 0, |
166
|
|
|
|
|
|
|
"receipt_number": "2066-1929", |
167
|
|
|
|
|
|
|
"starting_balance": 0, |
168
|
|
|
|
|
|
|
"statement_descriptor": null, |
169
|
|
|
|
|
|
|
"status": "paid", |
170
|
|
|
|
|
|
|
"status_transitions": { |
171
|
|
|
|
|
|
|
"finalized_at": 1507273919, |
172
|
|
|
|
|
|
|
"marked_uncollectible_at": null, |
173
|
|
|
|
|
|
|
"paid_at": 1507273919, |
174
|
|
|
|
|
|
|
"voided_at": null |
175
|
|
|
|
|
|
|
}, |
176
|
|
|
|
|
|
|
"subscription": "sub_fake123456789", |
177
|
|
|
|
|
|
|
"subtotal": 8000, |
178
|
|
|
|
|
|
|
"tax": null, |
179
|
|
|
|
|
|
|
"tax_percent": null, |
180
|
|
|
|
|
|
|
"total": 8000, |
181
|
|
|
|
|
|
|
"total_tax_amounts": [], |
182
|
|
|
|
|
|
|
"webhooks_delivered_at": 1507273920 |
183
|
|
|
|
|
|
|
} |
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
=head1 HISTORY |
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
=head2 v0.1 |
188
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
Initial version |
190
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
=head1 AUTHOR |
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
Jacques Deguest E<lt>F<jack@deguest.jp>E<gt> |
194
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
=head1 SEE ALSO |
196
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
Stripe API documentation: |
198
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
L<https://stripe.com/docs/api/invoices/line_item> |
200
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
202
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
Copyright (c) 2019-2020 DEGUEST Pte. Ltd. |
204
|
|
|
|
|
|
|
|
205
|
|
|
|
|
|
|
You can use, copy, modify and redistribute this package and associated |
206
|
|
|
|
|
|
|
files under the same terms as Perl itself. |
207
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
=cut |