File Coverage

lib/Net/API/Stripe/Tax/Rate.pm
Criterion Covered Total %
statement 19 33 57.5
branch n/a
condition n/a
subroutine 7 21 33.3
pod 14 14 100.0
total 40 68 58.8


line stmt bran cond sub pod time code
1             ##----------------------------------------------------------------------------
2             ## Stripe API - ~/lib/Net/API/Stripe/Tax/Rate.pm
3             ## Version v0.102.0
4             ## Copyright(c) 2019 DEGUEST Pte. Ltd.
5             ## Author: Jacques Deguest <jack@deguest.jp>
6             ## Created 2019/11/02
7             ## Modified 2022/10/29
8             ##
9             ##----------------------------------------------------------------------------
10             BEGIN
11             {
12             use strict;
13 2     2   23820270 use warnings;
  2         13  
  2         64  
14 2     2   11 use parent qw( Net::API::Stripe::Generic );
  2         4  
  2         64  
15 2     2   10 use vars qw( $VERSION );
  2         4  
  2         9  
16 2     2   153 our( $VERSION ) = 'v0.102.0';
  2         4  
  2         112  
17 2     2   57 };
18              
19             use strict;
20 2     2   11 use warnings;
  2         5  
  2         52  
21 2     2   12  
  2         4  
  2         703  
22              
23 0     0 1    
24              
25 0     0 1    
26              
27 0     0 1    
28              
29 0     0 1    
30              
31 0     0 1    
32              
33 0     0 1    
34              
35 0     0 1    
36             1;
37 0     0 1   # NOTE: POD
38              
39 0     0 1   =encoding utf8
40              
41 0     0 1   =head1 NAME
42              
43 0     0 1   Net::API::Stripe::Tax::Rate - A Stripe Tax Rate Object
44              
45 0     0 1   =head1 SYNOPSIS
46              
47 0     0 1   my $rate = $stripe->tax_rate({
48             active => $stripe->true,
49 0     0 1   created => '2020-04-12T17:12:10',
50             description => 'Japan VAT applicable to customers',
51             display_name => 'Japan VAT',
52             inclusive => $stripe->false,
53             jurisdiction => 'jp',
54             livemode => $stripe->false,
55             metadata => { tax_id => 123, customer_id => 456 },
56             percentage => 10,
57             });
58              
59             See documentation in L<Net::API::Stripe> for example to make api calls to Stripe to create those objects.
60              
61             =head1 VERSION
62              
63             v0.102.0
64              
65             =head1 DESCRIPTION
66              
67             This is used in L<Net::API::Stripe::Billing::Invoice> to describe a list of tax rates, and also in L<Net::API::Stripe::Billing::Subscription::Schedule> in B<phases>->I<default_tax_rates>.
68              
69             =head1 CONSTRUCTOR
70              
71             =head2 new( %ARG )
72              
73             Creates a new L<Net::API::Stripe::Tax::Rate> object.
74             It may also take an hash like arguments, that also are method of the same name.
75              
76             =head1 METHODS
77              
78             =head2 id string
79              
80             Unique identifier for the object.
81              
82             =head2 object string, value is "tax_rate"
83              
84             String representing the object’s type. Objects of the same type share the same value.
85              
86             =head2 active boolean
87              
88             Defaults to true. When set to false, this tax rate cannot be applied to objects in the API, but will still be applied to subscriptions and invoices that already have it set.
89              
90             =head2 country string
91              
92             Two-letter country code (L<ISO 3166-1 alpha-2|https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)>.
93              
94             =head2 created timestamp
95              
96             Time at which the object was created. Measured in seconds since the Unix epoch.
97              
98             =head2 description string
99              
100             An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers.
101              
102             =head2 display_name string
103              
104             The display name of the tax rates as it will appear to your customer on their receipt email, PDF, and the hosted invoice page.
105              
106             =head2 inclusive boolean
107              
108             This specifies if the tax rate is inclusive or exclusive.
109              
110             =head2 jurisdiction string
111              
112             The jurisdiction for the tax rate.
113              
114             =head2 livemode boolean
115              
116             Has the value true if the object exists in live mode or the value false if the object exists in test mode.
117              
118             =head2 metadata hash
119              
120             Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
121              
122             =head2 percentage decimal
123              
124             This represents the tax rate percent out of 100.
125              
126             =head2 state string
127              
128             L<ISO 3166-2 subdivision code|https://en.wikipedia.org/wiki/ISO_3166-2:US>, without country prefix. For example, "NY" for New York, United States.
129              
130             =head2 tax_type string
131              
132             The high-level tax type, such as C<vat> or C<sales_tax>.
133              
134             =head1 API SAMPLE
135              
136             {
137             "id": "txr_1GWkAHCeyNCl6fY2QtB0BbzC",
138             "object": "tax_rate",
139             "active": true,
140             "created": 1586614713,
141             "description": "VAT Germany",
142             "display_name": "VAT",
143             "inclusive": false,
144             "jurisdiction": "DE",
145             "livemode": false,
146             "metadata": {},
147             "percentage": 19.0
148             }
149              
150             =head1 HISTORY
151              
152             =head2 v0.1
153              
154             Initial version
155              
156             =head1 AUTHOR
157              
158             Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
159              
160             =head1 SEE ALSO
161              
162             Stripe API documentation:
163              
164             L<https://stripe.com/docs/api/tax_rates>
165              
166             =head1 COPYRIGHT & LICENSE
167              
168             Copyright (c) 2019-2020 DEGUEST Pte. Ltd.
169              
170             You can use, copy, modify and redistribute this package and associated
171             files under the same terms as Perl itself.
172              
173             =cut