| 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 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 14 | 1 | ▶ | use parent qw( Net::API::Stripe::Generic ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 15 | 1 | ▶ | our( $VERSION ) = 'v0.100.0'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 16 | }; | ||
| 17 | |||
| 18 | 0 | ▶ | sub id { shift->_set_get_scalar( 'id', @_ ); } |
|
Subroutine
id: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 19 | |||
| 20 | 0 | ▶ | sub object { shift->_set_get_scalar( 'object', @_ ); } |
|
Subroutine
object: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 21 | |||
| 22 | 0 | ▶ | sub amount { return( shift->_set_get_number( 'amount', @_ ) ); } |
|
Subroutine
amount: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 23 | |||
| 24 | 0 | ▶ | sub description { return( shift->_set_get_scalar( 'description', @_ ) ); } |
|
Subroutine
description: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 25 | |||
| 26 | 0 | ▶ | sub discount_amount { return( shift->_set_get_number( 'discount_amount', @_ ) ); } |
|
Subroutine
discount_amount: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 27 | |||
| 28 | 0 | ▶ | sub invoice_line_item { return( shift->_set_get_scalar( 'invoice_line_item', @_ ) ); } |
|
Subroutine
invoice_line_item: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 29 | |||
| 30 | 0 | ▶ | sub livemode { return( shift->_set_get_boolean( 'livemode', @_ ) ); } |
|
Subroutine
livemode: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 31 | |||
| 32 | 0 | ▶ | sub quantity { return( shift->_set_get_number( 'quantity', @_ ) ); } |
|
Subroutine
quantity: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 33 | |||
| 34 | sub tax_amounts | ||
| 35 | { | ||
| 36 | 0 | ▶ | return( shift->_set_get_class( 'tax_amounts', |
|
Subroutine
tax_amounts: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 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 | ▶ | sub tax_rates { return( shift->_set_get_object_array( 'tax_rates', 'Net::API::Stripe::Tax::Rate', @_ ) ); } |
|
Subroutine
tax_rates: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 45 | |||
| 46 | 0 | ▶ | sub type { return( shift->_set_get_scalar( 'type', @_ ) ); } |
|
Subroutine
type: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 47 | |||
| 48 | 0 | ▶ | sub unit_amount { return( shift->_set_get_number( 'unit_amount', @_ ) ); } |
|
Subroutine
unit_amount: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 49 | |||
| 50 | 0 | ▶ | sub unit_amount_decimal { return( shift->_set_get_number( 'unit_amount_decimal', @_ ) ); } |
|
Subroutine
unit_amount_decimal: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 51 | |||
| 52 | 1 | 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 | |||