File Coverage

blib/lib/Net/API/Stripe/Billing/CreditNote/LineItem.pm
Criterion Covered Total %
statement 7 20 35.0
branch n/a
condition n/a
subroutine 3 16 18.7
pod 13 13 100.0
total 23 49 46.9


line stmt bran cond sub pod time code
1             ##----------------------------------------------------------------------------
2             ## Stripe API - ~/lib/Net/API/Stripe/Billing/CreditNote/LineItem.pm
3             ## Version v0.100.0
4             ## Copyright(c) 2020 DEGUEST Pte. Ltd.
5             ## Author: Jacques Deguest <@sitael.tokyo.deguest.jp>
6             ## Created 2020/01/25
7             ## Modified 2020/05/15
8             ##
9             ##----------------------------------------------------------------------------
10             package Net::API::Stripe::Billing::CreditNote::LineItem;
11             BEGIN
12             {
13 1     1   863 use strict;
  1         2  
  1         29  
14 1     1   4 use parent qw( Net::API::Stripe::Generic );
  1         2  
  1         4  
15 1     1   289 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 amount { return( shift->_set_get_number( 'amount', @_ ) ); }
23              
24 0     0 1   sub description { return( shift->_set_get_scalar( 'description', @_ ) ); }
25              
26 0     0 1   sub discount_amount { return( shift->_set_get_number( 'discount_amount', @_ ) ); }
27              
28 0     0 1   sub invoice_line_item { return( shift->_set_get_scalar( 'invoice_line_item', @_ ) ); }
29              
30 0     0 1   sub livemode { return( shift->_set_get_boolean( 'livemode', @_ ) ); }
31              
32 0     0 1   sub quantity { return( shift->_set_get_number( 'quantity', @_ ) ); }
33              
34             sub tax_amounts
35             {
36 0     0 1   return( shift->_set_get_class( 'tax_amounts',
37             {
38             amount => { type => 'number' },
39             inclusive => { type => 'boolean' },
40             tax_rate => { type => 'scalar_or_object', class => 'Net::API::Stripe::Tax::Rate' },
41             }, @_ ) );
42             }
43              
44 0     0 1   sub tax_rates { return( shift->_set_get_object_array( 'tax_rates', 'Net::API::Stripe::Tax::Rate', @_ ) ); }
45              
46 0     0 1   sub type { return( shift->_set_get_scalar( 'type', @_ ) ); }
47              
48 0     0 1   sub unit_amount { return( shift->_set_get_number( 'unit_amount', @_ ) ); }
49              
50 0     0 1   sub unit_amount_decimal { return( shift->_set_get_number( 'unit_amount_decimal', @_ ) ); }
51              
52             1;
53              
54             __END__
55              
56             =encoding utf8
57              
58             =head1 NAME
59              
60             Net::API::Stripe::Billing::CreditNote::LineItem - Stripe API Credit note Line Item Object
61              
62             =head1 SYNOPSIS
63              
64             =head1 VERSION
65              
66             v0.100.0
67              
68             =head1 DESCRIPTION
69              
70             my $credit_line = $stripe->credit_note_line_item({
71             amount => 2000,
72             description => 'Credit note line text',
73             discount_amount => 500,
74             quantity => 2,
75             type => 'invoice_line_item',
76             });
77              
78             =head1 CONSTRUCTOR
79              
80             =over 4
81              
82             =item B<new>( %arg )
83              
84             Creates a new L<Net::API::Stripe::Billing::CreditNote::LineItem> object
85              
86             =back
87              
88             =head1 METHODS
89              
90             =over 4
91              
92             =item B<id>() string
93              
94             Unique identifier for the object.
95              
96             =item B<object>() string, value is "credit_note_line_item"
97              
98             String representing the object’s type. Objects of the same type share the same value.
99              
100             =item B<amount>() integer
101              
102             The integer amount in JPY representing the gross amount being credited for this line item, excluding (exclusive) tax and discounts.
103              
104             =item B<description>() string
105              
106             Description of the item being credited.
107              
108             =item B<discount_amount>() integer
109              
110             The integer amount in JPY representing the discount being credited for this line item.
111              
112             =item B<invoice_line_item>() string
113              
114             ID of the invoice line item being credited
115              
116             =item B<livemode>() boolean
117              
118             Has the value true if the object exists in live mode or the value false if the object exists in test mode.
119              
120             =item B<quantity>() integer
121              
122             The number of units of product being credited.
123              
124             =item B<tax_amounts>() array of objects
125              
126             The amount of tax calculated per tax rate for this line item.
127              
128             This is a dynamic class with the following properties:
129              
130             =over 8
131              
132             =item I<amount> integer
133              
134             The amount, in JPY, of the tax.
135              
136             =item I<inclusive> boolean
137              
138             Whether this tax amount is inclusive or exclusive.
139              
140             =item I<tax_rate> string expandable
141              
142             The tax rate that was applied to get this tax amount.
143              
144             When expanded, this is a L<Net::API::Stripe::Tax::Rate> object.
145              
146             =back
147              
148             =item B<tax_rates>() array of L<Net::API::Stripe::Tax::Rate> objects
149              
150             The tax rates which apply to the line item.
151              
152             =item B<type>() string
153              
154             The type of the credit note line item, one of custom_line_item or invoice_line_item. When the type is invoice_line_item there is an additional invoice_line_item property on the resource the value of which is the id of the credited line item on the invoice.
155              
156             =item B<unit_amount>() integer
157              
158             The cost of each unit of product being credited.
159              
160             =item B<unit_amount_decimal>() decimal string
161              
162             Same as unit_amount, but contains a decimal value with at most 12 decimal places.
163              
164             =back
165              
166             =head1 API SAMPLE
167              
168             {
169             "id": "cnli_fake124567890",
170             "object": "credit_note_line_item",
171             "amount": 1000,
172             "description": "My First Invoice Item (created for API docs)",
173             "discount_amount": 0,
174             "invoice_line_item": "il_fake124567890",
175             "livemode": false,
176             "quantity": 1,
177             "tax_amounts": [],
178             "tax_rates": [],
179             "type": "invoice_line_item",
180             "unit_amount": null,
181             "unit_amount_decimal": null
182             }
183              
184             =head1 HISTORY
185              
186             =head2 v0.1
187              
188             Initial version
189              
190             =head1 STRIPE HISTORY
191              
192             =head2 2019-12-03
193              
194             The id field of all invoice line items have changed and are now prefixed with il_. The new id has consistent prefixes across all line items, is globally unique, and can be used for pagination.
195              
196             =over 4
197              
198             =item * You can no longer use the prefix of the id to determine the source of the line item. Instead use the type field for this purpose.
199              
200             =item * For lines with type=invoiceitem, use the invoice_item field to reference or update the originating Invoice Item object.
201              
202             =item * The Invoice Line Item object on earlier API versions also have a unique_id field to be used for migrating internal references before upgrading to this version.
203              
204             =item * When setting a tax rate to individual line items, use the new id. Users on earlier API versions can pass in either a line item id or unique_id.
205              
206             =back
207              
208             =head1 AUTHOR
209              
210             Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
211              
212             =head1 SEE ALSO
213              
214             L<https://stripe.com/docs/api/credit_notes/line_item>
215              
216             =head1 COPYRIGHT & LICENSE
217              
218             Copyright (c) 2020-2020 DEGUEST Pte. Ltd.
219              
220             All rights reserved
221              
222             This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
223              
224             =cut
225              
226