Stripe/Billing/Invoice/Period.pm

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