Stripe/Billing/Invoice/BalanceSettings.pm

filter: Statementstmt 88.8% 8 / 9 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 3 / 4 Podpod 100% 1 / 1 totaltotal 85.7% 12 / 14 CC 1 SCAR 2.2
CC
1
Cov
89%
consume_applied_balance_on_void
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« Stripe/Payment/Source/CodeVerification.pm ↑ Summary Stripe/Payment/Installment.pm »
1 ##----------------------------------------------------------------------------
2 ## Stripe API - ~/lib/Net/API/Stripe/Billing/Invoice/BalanceSettings.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/03
7 ## Modified 2020/05/15
8 ##
9 ##----------------------------------------------------------------------------
10 package Net::API::Stripe::Billing::Invoice::BalanceSettings;
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 consume_applied_balance_on_void { return( shift->_set_get_boolean( 'consume_applied_balance_on_void', @_ ) ); }
Subroutine consume_applied_balance_on_void: not called CC=1 SCAR=6.9
Pod documented
19  
20 1 1;
21  
22 __END__
23  
24 =encoding utf8
25  
26 =head1 NAME
27  
28 Net::API::Stripe::Billing::Invoice::BalanceSettings - A Stripe Customer Invoice Balance Transaction Upon Voiding
29  
30 =head1 SYNOPSIS
31  
32 my $obj = $sub->invoice_customer_balance_settings({
33 # Boolean
34 consume_applied_balance_on_void => 1,
35 });
36  
37 =head1 VERSION
38  
39 v0.100.0
40  
41 =head1 DESCRIPTION
42  
43 This is instantiated by method B<invoice_customer_balance_settings> from L<Net::API::Stripe::Billing::Subscription>
44  
45 =head1 CONSTRUCTOR
46  
47 =over 4
48  
49 =item B<new>( %ARG )
50  
51 Creates a new L<Net::API::Stripe::Billing::Invoice::BalanceSettings> object.
52 It may also take an hash like arguments, that also are method of the same name.
53  
54 =back
55  
56 =head1 METHODS
57  
58 =over 4
59  
60 =item B<consume_applied_balance_on_void>
61  
62 Controls whether a customer balance applied to this invoice should be consumed and not credited or debited back to the customer if voided.
63  
64 Stripe support explained me:
65 "One can void invoices only when they are in either the I<open> or the I<uncollectible> status but never when they are paid status. So voiding an invoice does not result in issuing a credit.
66  
67 When an invoice generated by the subscription is voided, the invoice is treated as zero-value and the customer balance isn't be applied."
68  
69 =back
70  
71 =head1 API SAMPLE
72  
73 {
74 "id": "sub_fake124567890",
75 "object": "subscription",
76 "application_fee_percent": null,
77 "billing_cycle_anchor": 1572739659,
78 "billing_thresholds": null,
79 "cancel_at_period_end": false,
80 "canceled_at": null,
81 "collection_method": "charge_automatically",
82 "created": 1572739659,
83 "current_period_end": 1575331659,
84 "current_period_start": 1572739659,
85 "customer": "cus_fake124567890",
86 "days_until_due": null,
87 "default_payment_method": null,
88 "default_source": null,
89 "default_tax_rates": [
90  
91 ],
92 "discount": null,
93 "ended_at": null,
94 "invoice_customer_balance_settings": {
95 "consume_applied_balance_on_void": true
96 },
97 "items": {
98 "object": "list",
99 "data": [
100 {
101 "id": "si_fake124567890",
102 "object": "subscription_item",
103 "billing_thresholds": null,
104 "created": 1572739659,
105 "metadata": {
106 },
107 "plan": {
108 "id": "plan_fake124567890",
109 "object": "plan",
110 "active": true,
111 "aggregate_usage": null,
112 "amount": 999,
113 "amount_decimal": "999",
114 "billing_scheme": "per_unit",
115 "created": 1572736765,
116 "currency": "usd",
117 "interval": "month",
118 "interval_count": 1,
119 "livemode": false,
120 "metadata": {
121 },
122 "nickname": null,
123 "product": "prod_fake124567890",
124 "tiers": null,
125 "tiers_mode": null,
126 "transform_usage": null,
127 "trial_period_days": null,
128 "usage_type": "licensed"
129 },
130 "quantity": 1,
131 "subscription": "sub_fake124567890",
132 "tax_rates": [
133  
134 ]
135 }
136 ],
137 "has_more": false,
138 "url": "/v1/subscription_items?subscription=sub_fake124567890"
139 },
140 "latest_invoice": null,
141 "livemode": false,
142 "metadata": {
143 },
144 "next_pending_invoice_item_invoice": null,
145 "pending_invoice_item_interval": null,
146 "pending_setup_intent": null,
147 "plan": {
148 "id": "plan_fake124567890",
149 "object": "plan",
150 "active": true,
151 "aggregate_usage": null,
152 "amount": 999,
153 "amount_decimal": "999",
154 "billing_scheme": "per_unit",
155 "created": 1572736765,
156 "currency": "usd",
157 "interval": "month",
158 "interval_count": 1,
159 "livemode": false,
160 "metadata": {
161 },
162 "nickname": null,
163 "product": "prod_fake124567890",
164 "tiers": null,
165 "tiers_mode": null,
166 "transform_usage": null,
167 "trial_period_days": null,
168 "usage_type": "licensed"
169 },
170 "quantity": 1,
171 "start_date": 1572739659,
172 "status": "active",
173 "tax_percent": null,
174 "trial_end": null,
175 "trial_start": null
176 }
177  
178 =head1 HISTORY
179  
180 =head2 v0.1
181  
182 Initial version
183  
184 =head1 AUTHOR
185  
186 Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
187  
188 =head1 SEE ALSO
189  
190 Stripe API documentation:
191  
192 L<https://stripe.com/docs/api/subscriptions/object?lang=node#subscription_object-invoice_customer_balance_settings>, L<https://stripe.com/docs/billing/invoices/workflow#void>, L<https://stripe.com/docs/billing/customer/balance#customer-balance>
193  
194 =head1 COPYRIGHT & LICENSE
195  
196 Copyright (c) 2019-2020 DEGUEST Pte. Ltd.
197  
198 You can use, copy, modify and redistribute this package and associated
199 files under the same terms as Perl itself.
200  
201 =cut
« Stripe/Payment/Source/CodeVerification.pm ↑ Summary Stripe/Payment/Installment.pm »