File Coverage

blib/lib/Net/API/Stripe/Tax/Rate.pm
Criterion Covered Total %
statement 7 18 38.8
branch n/a
condition n/a
subroutine 3 14 21.4
pod 11 11 100.0
total 21 43 48.8


line stmt bran cond sub pod time code
1             ##----------------------------------------------------------------------------
2             ## Stripe API - ~/lib/Net/API/Stripe/Tax/Rate.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::Tax::Rate;
11             BEGIN
12             {
13 1     1   850 use strict;
  1         2  
  1         29  
14 1     1   4 use parent qw( Net::API::Stripe::Generic );
  1         2  
  1         4  
15 1     1   273 our( $VERSION ) = 'v0.100.0';
16             };
17              
18 0     0 1   sub id { shift->_set_get_scalar( 'id', @_ ); }
19              
20 0     0 1   sub object { shift->_set_get_scalar( 'object', @_ ); }
21              
22 0     0 1   sub active { shift->_set_get_boolean( 'active', @_ ); }
23              
24 0     0 1   sub created { shift->_set_get_datetime( 'created', @_ ); }
25              
26 0     0 1   sub description { shift->_set_get_scalar( 'description', @_ ); }
27              
28 0     0 1   sub display_name { shift->_set_get_scalar( 'display_name', @_ ); }
29              
30 0     0 1   sub inclusive { shift->_set_get_boolean( 'inclusive', @_ ); }
31              
32 0     0 1   sub jurisdiction { shift->_set_get_scalar( 'jurisdiction', @_ ); }
33              
34 0     0 1   sub livemode { shift->_set_get_boolean( 'livemode', @_ ); }
35              
36 0     0 1   sub metadata { shift->_set_get_hash( 'metadata', @_ ); }
37              
38 0     0 1   sub percentage { return( shift->_set_get_number( 'percentage', @_ ) ); }
39              
40             1;
41              
42             __END__
43              
44             =encoding utf8
45              
46             =head1 NAME
47              
48             Net::API::Stripe::Tax::Rate - A Stripe Tax Rate Object
49              
50             =head1 SYNOPSIS
51              
52             my $rate = $stripe->tax_rate({
53             active => $stripe->true,
54             created => '2020-04-12T17:12:10',
55             description => 'Japan VAT applicable to customers',
56             display_name => 'Japan VAT',
57             inclusive => $stripe->false,
58             jurisdiction => 'jp',
59             livemode => $stripe->false,
60             metadata => { tax_id => 123, customer_id => 456 },
61             percentage => 10,
62             });
63              
64             See documentation in L<Net::API::Stripe> for example to make api calls to Stripe to create those objects.
65              
66             =head1 VERSION
67              
68             v0.100.0
69              
70             =head1 DESCRIPTION
71              
72             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>.
73              
74             =head1 CONSTRUCTOR
75              
76             =over 4
77              
78             =item B<new>( %ARG )
79              
80             Creates a new L<Net::API::Stripe::Tax::Rate> object.
81             It may also take an hash like arguments, that also are method of the same name.
82              
83             =back
84              
85             =head1 METHODS
86              
87             =over 4
88              
89             =item B<id> string
90              
91             Unique identifier for the object.
92              
93             =item B<object> string, value is "tax_rate"
94              
95             String representing the object’s type. Objects of the same type share the same value.
96              
97             =item B<active> boolean
98              
99             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.
100              
101             =item B<created> timestamp
102              
103             Time at which the object was created. Measured in seconds since the Unix epoch.
104              
105             =item B<description> string
106              
107             An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers.
108              
109             =item B<display_name> string
110              
111             The display name of the tax rates as it will appear to your customer on their receipt email, PDF, and the hosted invoice page.
112              
113             =item B<inclusive> boolean
114              
115             This specifies if the tax rate is inclusive or exclusive.
116              
117             =item B<jurisdiction> string
118              
119             The jurisdiction for the tax rate.
120              
121             =item B<livemode> boolean
122              
123             Has the value true if the object exists in live mode or the value false if the object exists in test mode.
124              
125             =item B<metadata> hash
126              
127             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.
128              
129             =item B<percentage> decimal
130              
131             This represents the tax rate percent out of 100.
132              
133             =back
134              
135             =head1 API SAMPLE
136              
137             {
138             "id": "txr_1GWkAHCeyNCl6fY2QtB0BbzC",
139             "object": "tax_rate",
140             "active": true,
141             "created": 1586614713,
142             "description": "VAT Germany",
143             "display_name": "VAT",
144             "inclusive": false,
145             "jurisdiction": "DE",
146             "livemode": false,
147             "metadata": {},
148             "percentage": 19.0
149             }
150              
151             =head1 HISTORY
152              
153             =head2 v0.1
154              
155             Initial version
156              
157             =head1 AUTHOR
158              
159             Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
160              
161             =head1 SEE ALSO
162              
163             Stripe API documentation:
164              
165             L<https://stripe.com/docs/api/tax_rates>
166              
167             =head1 COPYRIGHT & LICENSE
168              
169             Copyright (c) 2019-2020 DEGUEST Pte. Ltd.
170              
171             You can use, copy, modify and redistribute this package and associated
172             files under the same terms as Perl itself.
173              
174             =cut