File Coverage

lib/Net/API/Stripe/Billing/Invoice/TaxAmount.pm
Criterion Covered Total %
statement 19 22 86.3
branch n/a
condition n/a
subroutine 7 10 70.0
pod 3 3 100.0
total 29 35 82.8


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