File Coverage

lib/Net/API/Stripe/Billing/CreditNote/LineItem.pm
Criterion Covered Total %
statement 19 35 54.2
branch n/a
condition n/a
subroutine 7 23 30.4
pod 16 16 100.0
total 42 74 56.7


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