File Coverage

lib/Net/API/Stripe/Customer/TaxId.pm
Criterion Covered Total %
statement 19 28 67.8
branch n/a
condition n/a
subroutine 7 16 43.7
pod 9 9 100.0
total 35 53 66.0


line stmt bran cond sub pod time code
1             ##----------------------------------------------------------------------------
2             ## Stripe API - ~/lib/Net/API/Stripe/Customer/TaxId.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             package Net::API::Stripe::Customer::TaxId;
11             BEGIN
12             {
13 2     2   21055307 use strict;
  2         13  
  2         67  
14 2     2   11 use warnings;
  2         9  
  2         60  
15 2     2   16 use parent qw( Net::API::Stripe::Generic );
  2         4  
  2         10  
16 2     2   153 use vars qw( $VERSION );
  2         3  
  2         126  
17 2     2   37 our( $VERSION ) = 'v0.100.0';
18             };
19              
20 2     2   15 use strict;
  2         4  
  2         36  
21 2     2   9 use warnings;
  2         6  
  2         444  
22              
23 0     0 1   sub id { return( shift->_set_get_scalar( 'id', @_ ) ); }
24              
25 0     0 1   sub object { return( shift->_set_get_scalar( 'object', @_ ) ); }
26              
27 0     0 1   sub country { return( shift->_set_get_scalar( 'country', @_ ) ); }
28              
29 0     0 1   sub created { return( shift->_set_get_datetime( 'created', @_ ) ); }
30              
31             ## Customer id
32 0     0 1   sub customer { return( shift->_set_get_scalar_or_object( 'customer', 'Net::API::Stripe::Customer', @_ ) ); }
33              
34 0     0 1   sub livemode { return( shift->_set_get_boolean( 'livemode', @_ ) ); }
35              
36             ## au_abn, ch_vat, eu_vat, in_gst, no_vat, nz_gst, unknown, or za_vat
37 0     0 1   sub type { return( shift->_set_get_scalar( 'type', @_ ) ); }
38              
39 0     0 1   sub value { return( shift->_set_get_scalar( 'value', @_ ) ); }
40              
41             # sub verification { return( shift->_set_get_object( 'verification', 'Net::API::Stripe::Customer::TaxInfoVerification', @_ ) ); }
42 0     0 1   sub verification { return( shift->_set_get_object( 'verification', 'Net::API::Stripe::Connect::Account::Verification', @_ ) ); }
43              
44             1;
45              
46             __END__
47              
48             =encoding utf8
49              
50             =head1 NAME
51              
52             Net::API::Stripe::Customer::TaxId - A Customer Tax ID object
53              
54             =head1 SYNOPSIS
55              
56             my $tax_id = $stripe->tax_id({
57             country => 'jp',
58             customer => $customer_object,
59             type => 'eu_vat',
60             value => 'EU123456789',
61             });
62              
63             See documentation in L<Net::API::Stripe> for example to make api calls to Stripe to create those objects.
64              
65             =head1 VERSION
66              
67             v0.100.0
68              
69             =head1 DESCRIPTION
70              
71             You can add one or multiple tax IDs to a customer (L<Net::API::Stripe::Customer> / L<https://stripe.com/docs/api/customers>). A customer's tax IDs are displayed on invoices and credit notes issued for the customer.
72              
73             =head1 CONSTRUCTOR
74              
75             =head2 new( %ARG )
76              
77             Creates a new L<Net::API::Stripe::Customer::TaxId> object.
78             It may also take an hash like arguments, that also are method of the same name.
79              
80             =head1 METHODS
81              
82             =head2 id string
83              
84             Unique identifier for the object.
85              
86             =head2 object string, value is "tax_id"
87              
88             String representing the object’s type. Objects of the same type share the same value.
89              
90             =head2 country string
91              
92             Two-letter ISO code representing the country of the tax ID.
93              
94             =head2 created timestamp
95              
96             Time at which the object was created. Measured in seconds since the Unix epoch.
97              
98             =head2 customer string (expandable)
99              
100             ID of the customer. When expanded, this is a L<Net::API::Stripe::Customer> object.
101              
102             =head2 livemode boolean
103              
104             Has the value true if the object exists in live mode or the value false if the object exists in test mode.
105              
106             =head2 type string
107              
108             Type of the tax ID, one of au_abn, ch_vat, eu_vat, in_gst, no_vat, nz_gst, unknown, or za_vat
109              
110             =head2 value string
111              
112             Value of the tax ID.
113              
114             =head2 verification object
115              
116             Tax ID verification information. This is a L<Net::API::Stripe::Customer::TaxInfoVerification> object.
117              
118             =head1 API SAMPLE
119              
120             {
121             "id": "txi_fake123456789",
122             "object": "tax_id",
123             "country": "DE",
124             "created": 123456789,
125             "customer": "cus_fake123456789",
126             "livemode": false,
127             "type": "eu_vat",
128             "value": "DE123456789",
129             "verification": {
130             "status": "pending",
131             "verified_address": null,
132             "verified_name": null
133             }
134             }
135              
136             =head1 HISTORY
137              
138             =head2 v0.1
139              
140             Initial version
141              
142             =head1 AUTHOR
143              
144             Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
145              
146             =head1 SEE ALSO
147              
148             Stripe API documentation:
149              
150             L<https://stripe.com/docs/api/customer_tax_ids>, L<https://stripe.com/docs/billing/taxes/tax-ids>, L<https://en.wikipedia.org/wiki/VAT_identification_number>
151              
152             =head1 COPYRIGHT & LICENSE
153              
154             Copyright (c) 2019-2020 DEGUEST Pte. Ltd.
155              
156             You can use, copy, modify and redistribute this package and associated
157             files under the same terms as Perl itself.
158              
159             =cut