Stripe/Billing/Invoice/TaxAmount.pm

filter: Statementstmt 72.7% 8 / 11 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 3 / 6 Podpod 100% 3 / 3 totaltotal 70.0% 14 / 20 CC 1 SCAR 4.1
CC
1
Cov
73%
amount
2.0
inclusive
2.0
tax_rate
2.0
CRAP 1.5
« Stripe/Billing/Invoice/Settings.pm ↑ Summary Stripe/Connect/Account/Branding.pm »
1 ##----------------------------------------------------------------------------
2 ## Stripe API - ~/lib/Net/API/Stripe/Billing/Invoice/TaxAmount.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::Billing::Invoice::TaxAmount;
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 amount { return( shift->_set_get_number( 'amount', @_ ) ); }
Subroutine amount: not called CC=1 SCAR=6.9
Pod documented
19  
20 0 ▶sub inclusive { return( shift->_set_get_boolean( 'inclusive', @_ ) ); }
Subroutine inclusive: not called CC=1 SCAR=6.9
Pod documented
21  
22 0 ▶sub tax_rate { return( shift->_set_get_scalar_or_object( 'tax_rate', 'Net::API::Stripe::Tax::Rate', @_ ) ); }
Subroutine tax_rate: not called CC=1 SCAR=6.9
Pod documented
23  
24 1 1;
25  
26 __END__
27  
28 =encoding utf8
29  
30 =head1 NAME
31  
32 Net::API::Stripe::Billing::Invoice::TaxAmount - A Stripe Invoice Tax Amount
33  
34 =head1 SYNOPSIS
35  
36 my $tax_amount_obj = $inv_line->tax_amounts({
37 amount => 2000,
38 inclusive => 1,
39 });
40  
41 =head1 VERSION
42  
43 v0.100.0
44  
45 =head1 DESCRIPTION
46  
47 This is use in L<Net::API::Stripe::Billing::Invoice> to calculate all the tax amounts. More particularly this is called from B<tax_amounts> in L<Net::API::Stripe::Billing::Invoice::LineItems>
48  
49 =head1 CONSTRUCTOR
50  
51 =over 4
52  
53 =item B<new>( %ARG )
54  
55 Creates a new L<Net::API::Stripe::Billing::Invoice::TaxAmount> object.
56 It may also take an hash like arguments, that also are method of the same name.
57  
58 =back
59  
60 =head1 METHODS
61  
62 =over 4
63  
64 =item B<amount> integer
65  
66 The amount, in JPY, of the tax.
67  
68 =item B<inclusive> boolean
69  
70 Whether this tax amount is inclusive or exclusive.
71  
72 =item B<tax_rate> string (expandable)
73  
74 The tax rate that was applied to get this tax amount.
75  
76 When expanded, this is a L<Net::API::Stripe::Tax::Rate> object.
77  
78 =back
79  
80 =head1 API SAMPLE
81  
82 {
83 "id": "in_fake123456789",
84 "object": "invoice",
85 "account_country": "JP",
86 "account_name": "Provider, Inc",
87 "amount_due": 8000,
88 "amount_paid": 8000,
89 "amount_remaining": 0,
90 "application_fee_amount": null,
91 "attempt_count": 1,
92 "attempted": true,
93 "auto_advance": false,
94 "billing": "charge_automatically",
95 "billing_reason": "subscription",
96 "charge": "ch_fake123456789",
97 "collection_method": "charge_automatically",
98 "created": 1507273919,
99 "currency": "jpy",
100 "custom_fields": null,
101 "customer": "cus_fake123456789",
102 "customer_address": null,
103 "customer_email": "john.doe@example.com",
104 "customer_name": null,
105 "customer_phone": null,
106 "customer_shipping": null,
107 "customer_tax_exempt": "none",
108 "customer_tax_ids": [],
109 "default_payment_method": null,
110 "default_source": null,
111 "default_tax_rates": [],
112 "description": null,
113 "discount": null,
114 "due_date": null,
115 "ending_balance": 0,
116 "footer": null,
117 "hosted_invoice_url": "https://pay.stripe.com/invoice/invst_fake123456789",
118 "invoice_pdf": "https://pay.stripe.com/invoice/invst_fake123456789/pdf",
119 "lines": {
120 "data": [
121 {
122 "id": "sli_fake123456789",
123 "object": "line_item",
124 "amount": 8000,
125 "currency": "jpy",
126 "description": "1 × Provider, Inc professional monthly membership (at ¥8,000 / month)",
127 "discountable": true,
128 "livemode": false,
129 "metadata": {},
130 "period": {
131 "end": 1559441759,
132 "start": 1556763359
133 },
134 "plan": {
135 "id": "professional-monthly-jpy",
136 "object": "plan",
137 "active": true,
138 "aggregate_usage": null,
139 "amount": 8000,
140 "amount_decimal": "8000",
141 "billing_scheme": "per_unit",
142 "created": 1541833564,
143 "currency": "jpy",
144 "interval": "month",
145 "interval_count": 1,
146 "livemode": false,
147 "metadata": {},
148 "nickname": null,
149 "product": "prod_fake123456789",
150 "tiers": null,
151 "tiers_mode": null,
152 "transform_usage": null,
153 "trial_period_days": null,
154 "usage_type": "licensed"
155 },
156 "proration": false,
157 "quantity": 1,
158 "subscription": "sub_fake123456789",
159 "subscription_item": "si_fake123456789",
160 "tax_amounts": [],
161 "tax_rates": [],
162 "type": "subscription"
163 }
164 ],
165 "has_more": false,
166 "object": "list",
167 "url": "/v1/invoices/in_fake123456789/lines"
168 },
169 "livemode": false,
170 "metadata": {},
171 "next_payment_attempt": null,
172 "number": "53DB91F-0001",
173 "paid": true,
174 "payment_intent": null,
175 "period_end": 1507273919,
176 "period_start": 1507273919,
177 "post_payment_credit_notes_amount": 0,
178 "pre_payment_credit_notes_amount": 0,
179 "receipt_number": "2066-1929",
180 "starting_balance": 0,
181 "statement_descriptor": null,
182 "status": "paid",
183 "status_transitions": {
184 "finalized_at": 1507273919,
185 "marked_uncollectible_at": null,
186 "paid_at": 1507273919,
187 "voided_at": null
188 },
189 "subscription": "sub_fake123456789",
190 "subtotal": 8000,
191 "tax": null,
192 "tax_percent": null,
193 "total": 8000,
194 "total_tax_amounts": [],
195 "webhooks_delivered_at": 1507273920
196 }
197  
198 =head1 HISTORY
199  
200 =head2 v0.1
201  
202 Initial version
203  
204 =head1 AUTHOR
205  
206 Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
207  
208 =head1 SEE ALSO
209  
210 Stripe API documentation:
211  
212 L<https://stripe.com/docs/api/invoices>
213  
214 =head1 COPYRIGHT & LICENSE
215  
216 Copyright (c) 2019-2020 DEGUEST Pte. Ltd.
217  
218 You can use, copy, modify and redistribute this package and associated
219 files under the same terms as Perl itself.
220  
221 =cut
« Stripe/Billing/Invoice/Settings.pm ↑ Summary Stripe/Connect/Account/Branding.pm »