| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
##---------------------------------------------------------------------------- |
|
2
|
|
|
|
|
|
|
## Stripe API - ~/lib/Net/API/Stripe/Billing/Thresholds.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::Thresholds; |
|
11
|
|
|
|
|
|
|
BEGIN |
|
12
|
|
|
|
|
|
|
{ |
|
13
|
1
|
|
|
1
|
|
859
|
use strict; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
30
|
|
|
14
|
1
|
|
|
1
|
|
4
|
use parent qw( Net::API::Stripe::Generic ); |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
4
|
|
|
15
|
1
|
|
|
1
|
|
138
|
our( $VERSION ) = 'v0.100.0'; |
|
16
|
|
|
|
|
|
|
}; |
|
17
|
|
|
|
|
|
|
|
|
18
|
0
|
|
|
0
|
1
|
|
sub amount_gte { return( shift->_set_get_number( 'amount_gte', @_ ) ); } |
|
19
|
|
|
|
|
|
|
|
|
20
|
0
|
|
|
0
|
1
|
|
sub item_reasons { return( shift->_set_get_hash_as_object( 'item_reasons', 'Net::API::Stripe::Billing::Thresholds::ItemReasons', @_ ) ); } |
|
21
|
|
|
|
|
|
|
|
|
22
|
0
|
|
|
0
|
1
|
|
sub reset_billing_cycle_anchor { return( shift->_set_get_scalar( 'reset_billing_cycle_anchor', @_ ) ); } |
|
23
|
|
|
|
|
|
|
|
|
24
|
0
|
|
|
0
|
1
|
|
sub usage_gte { return( shift->_set_get_scalar( 'usage_gte', @_ ) ); } |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
__END__ |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=encoding utf8 |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head1 NAME |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
Net::API::Stripe::Billing::Thresholds - A Stripe Billing Thresholds Object |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
my $obj = $subscription->billing_thresholds({ |
|
39
|
|
|
|
|
|
|
amount_gte => 1000, |
|
40
|
|
|
|
|
|
|
reset_billing_cycle_anchor => $stripe->true, |
|
41
|
|
|
|
|
|
|
}); |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 VERSION |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
v0.100.0 |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 CONSTRUCTOR |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=over 4 |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=item B<new>( %ARG ) |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
Creates a new L<Net::API::Stripe::Billing::Thresholds> object. |
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=back |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 METHODS |
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=over 4 |
|
64
|
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=item B<amount_gte> integer |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
Monetary threshold that triggers the subscription to create an invoice |
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=item B<item_reasons> array of hashes |
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
Indicates which line items triggered a threshold invoice. |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
This is an array of L<Net::API::Stripe::Billing::Thresholds::ItemReasons> objects. |
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=item B<reset_billing_cycle_anchor> boolean |
|
76
|
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
Indicates if the billing_cycle_anchor should be reset when a threshold is reached. If true, billing_cycle_anchor will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. This value may not be true if the subscription contains items with plans that have aggregate_usage=last_ever. |
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=item B<usage_gte> integer |
|
80
|
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
The quantity threshold boundary that applied to the given line item. |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=back |
|
84
|
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=head1 API SAMPLE |
|
86
|
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
{ |
|
88
|
|
|
|
|
|
|
"id": "sub_fake123456789", |
|
89
|
|
|
|
|
|
|
"object": "subscription", |
|
90
|
|
|
|
|
|
|
"application_fee_percent": null, |
|
91
|
|
|
|
|
|
|
"billing_cycle_anchor": 1551492959, |
|
92
|
|
|
|
|
|
|
"billing_thresholds": null, |
|
93
|
|
|
|
|
|
|
"cancel_at_period_end": false, |
|
94
|
|
|
|
|
|
|
"canceled_at": 1555726796, |
|
95
|
|
|
|
|
|
|
"collection_method": "charge_automatically", |
|
96
|
|
|
|
|
|
|
"created": 1551492959, |
|
97
|
|
|
|
|
|
|
"current_period_end": 1556763359, |
|
98
|
|
|
|
|
|
|
"current_period_start": 1554171359, |
|
99
|
|
|
|
|
|
|
"customer": "cus_fake123456789", |
|
100
|
|
|
|
|
|
|
"days_until_due": null, |
|
101
|
|
|
|
|
|
|
"default_payment_method": null, |
|
102
|
|
|
|
|
|
|
"default_source": null, |
|
103
|
|
|
|
|
|
|
"default_tax_rates": [], |
|
104
|
|
|
|
|
|
|
"discount": null, |
|
105
|
|
|
|
|
|
|
"ended_at": 1555726796, |
|
106
|
|
|
|
|
|
|
"items": { |
|
107
|
|
|
|
|
|
|
"object": "list", |
|
108
|
|
|
|
|
|
|
"data": [ |
|
109
|
|
|
|
|
|
|
{ |
|
110
|
|
|
|
|
|
|
"id": "si_fake123456789", |
|
111
|
|
|
|
|
|
|
"object": "subscription_item", |
|
112
|
|
|
|
|
|
|
"billing_thresholds": null, |
|
113
|
|
|
|
|
|
|
"created": 1551492959, |
|
114
|
|
|
|
|
|
|
"metadata": {}, |
|
115
|
|
|
|
|
|
|
"plan": { |
|
116
|
|
|
|
|
|
|
"id": "professional-monthly-jpy", |
|
117
|
|
|
|
|
|
|
"object": "plan", |
|
118
|
|
|
|
|
|
|
"active": true, |
|
119
|
|
|
|
|
|
|
"aggregate_usage": null, |
|
120
|
|
|
|
|
|
|
"amount": 8000, |
|
121
|
|
|
|
|
|
|
"amount_decimal": "8000", |
|
122
|
|
|
|
|
|
|
"billing_scheme": "per_unit", |
|
123
|
|
|
|
|
|
|
"created": 1541833564, |
|
124
|
|
|
|
|
|
|
"currency": "jpy", |
|
125
|
|
|
|
|
|
|
"interval": "month", |
|
126
|
|
|
|
|
|
|
"interval_count": 1, |
|
127
|
|
|
|
|
|
|
"livemode": false, |
|
128
|
|
|
|
|
|
|
"metadata": {}, |
|
129
|
|
|
|
|
|
|
"nickname": null, |
|
130
|
|
|
|
|
|
|
"product": "prod_fake123456789", |
|
131
|
|
|
|
|
|
|
"tiers": null, |
|
132
|
|
|
|
|
|
|
"tiers_mode": null, |
|
133
|
|
|
|
|
|
|
"transform_usage": null, |
|
134
|
|
|
|
|
|
|
"trial_period_days": null, |
|
135
|
|
|
|
|
|
|
"usage_type": "licensed" |
|
136
|
|
|
|
|
|
|
}, |
|
137
|
|
|
|
|
|
|
"quantity": 1, |
|
138
|
|
|
|
|
|
|
"subscription": "sub_fake123456789", |
|
139
|
|
|
|
|
|
|
"tax_rates": [] |
|
140
|
|
|
|
|
|
|
} |
|
141
|
|
|
|
|
|
|
], |
|
142
|
|
|
|
|
|
|
"has_more": false, |
|
143
|
|
|
|
|
|
|
"url": "/v1/subscription_items?subscription=sub_fake123456789" |
|
144
|
|
|
|
|
|
|
}, |
|
145
|
|
|
|
|
|
|
"latest_invoice": "in_fake123456789", |
|
146
|
|
|
|
|
|
|
"livemode": false, |
|
147
|
|
|
|
|
|
|
"metadata": {}, |
|
148
|
|
|
|
|
|
|
"next_pending_invoice_item_invoice": null, |
|
149
|
|
|
|
|
|
|
"pending_invoice_item_interval": null, |
|
150
|
|
|
|
|
|
|
"pending_setup_intent": null, |
|
151
|
|
|
|
|
|
|
"plan": { |
|
152
|
|
|
|
|
|
|
"id": "professional-monthly-jpy", |
|
153
|
|
|
|
|
|
|
"object": "plan", |
|
154
|
|
|
|
|
|
|
"active": true, |
|
155
|
|
|
|
|
|
|
"aggregate_usage": null, |
|
156
|
|
|
|
|
|
|
"amount": 8000, |
|
157
|
|
|
|
|
|
|
"amount_decimal": "8000", |
|
158
|
|
|
|
|
|
|
"billing_scheme": "per_unit", |
|
159
|
|
|
|
|
|
|
"created": 1541833564, |
|
160
|
|
|
|
|
|
|
"currency": "jpy", |
|
161
|
|
|
|
|
|
|
"interval": "month", |
|
162
|
|
|
|
|
|
|
"interval_count": 1, |
|
163
|
|
|
|
|
|
|
"livemode": false, |
|
164
|
|
|
|
|
|
|
"metadata": {}, |
|
165
|
|
|
|
|
|
|
"nickname": null, |
|
166
|
|
|
|
|
|
|
"product": "prod_fake123456789", |
|
167
|
|
|
|
|
|
|
"tiers": null, |
|
168
|
|
|
|
|
|
|
"tiers_mode": null, |
|
169
|
|
|
|
|
|
|
"transform_usage": null, |
|
170
|
|
|
|
|
|
|
"trial_period_days": null, |
|
171
|
|
|
|
|
|
|
"usage_type": "licensed" |
|
172
|
|
|
|
|
|
|
}, |
|
173
|
|
|
|
|
|
|
"quantity": 1, |
|
174
|
|
|
|
|
|
|
"start_date": 1551492959, |
|
175
|
|
|
|
|
|
|
"status": "canceled", |
|
176
|
|
|
|
|
|
|
"tax_percent": null, |
|
177
|
|
|
|
|
|
|
"trial_end": null, |
|
178
|
|
|
|
|
|
|
"trial_start": null |
|
179
|
|
|
|
|
|
|
} |
|
180
|
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
=head1 HISTORY |
|
182
|
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
=head2 v0.1 |
|
184
|
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
Initial version |
|
186
|
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
=head1 AUTHOR |
|
188
|
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
Jacques Deguest E<lt>F<jack@deguest.jp>E<gt> |
|
190
|
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
=head1 SEE ALSO |
|
192
|
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
Stripe API documentation: |
|
194
|
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
L<https://stripe.com/docs/api/subscriptions/object> |
|
196
|
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
|
198
|
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
Copyright (c) 2019-2020 DEGUEST Pte. Ltd. |
|
200
|
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
You can use, copy, modify and redistribute this package and associated |
|
202
|
|
|
|
|
|
|
files under the same terms as Perl itself. |
|
203
|
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
=cut |