line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
##---------------------------------------------------------------------------- |
2
|
|
|
|
|
|
|
## Stripe API - ~/lib/Net/API/Stripe/List/Item.pm |
3
|
|
|
|
|
|
|
## Version v0.2.0 |
4
|
|
|
|
|
|
|
## Copyright(c) 2019 DEGUEST Pte. Ltd. |
5
|
|
|
|
|
|
|
## Author: Jacques Deguest <jack@deguest.jp> |
6
|
|
|
|
|
|
|
## Created 2019/11/02 |
7
|
|
|
|
|
|
|
## Modified 2022/10/29 |
8
|
|
|
|
|
|
|
## |
9
|
|
|
|
|
|
|
##---------------------------------------------------------------------------- |
10
|
|
|
|
|
|
|
BEGIN |
11
|
|
|
|
|
|
|
{ |
12
|
|
|
|
|
|
|
use strict; |
13
|
3
|
|
|
3
|
|
24049810
|
use warnings; |
|
3
|
|
|
|
|
16
|
|
|
3
|
|
|
|
|
96
|
|
14
|
3
|
|
|
3
|
|
18
|
use parent qw( Net::API::Stripe::Generic ); |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
90
|
|
15
|
3
|
|
|
3
|
|
16
|
use vars qw( $VERSION ); |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
16
|
|
16
|
3
|
|
|
3
|
|
220
|
our( $VERSION ) = 'v0.2.0'; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
201
|
|
17
|
3
|
|
|
3
|
|
58
|
}; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
use strict; |
20
|
3
|
|
|
3
|
|
22
|
use warnings; |
|
3
|
|
|
|
|
9
|
|
|
3
|
|
|
|
|
59
|
|
21
|
3
|
|
|
3
|
|
18
|
|
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
1062
|
|
22
|
|
|
|
|
|
|
|
23
|
0
|
|
|
0
|
1
|
|
|
24
|
|
|
|
|
|
|
{ |
25
|
0
|
|
|
0
|
1
|
|
enabled => { type => "boolean" }, |
26
|
|
|
|
|
|
|
maximum => { type => "integer" }, |
27
|
0
|
|
|
0
|
0
|
|
minimum => { type => "integer" }, |
28
|
|
|
|
|
|
|
}, @_ ) ); } |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
34
|
0
|
|
|
0
|
1
|
|
|
35
|
|
|
|
|
|
|
|
36
|
0
|
|
|
0
|
1
|
|
|
37
|
|
|
|
|
|
|
{ |
38
|
0
|
|
|
0
|
1
|
|
amount => { type => 'integer' }, |
39
|
|
|
|
|
|
|
discount => { package => 'Net::API::Stripe::Billing::Discount' }, |
40
|
0
|
|
|
0
|
1
|
|
}, @_ ) ); } |
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
0
|
1
|
|
|
43
|
|
|
|
|
|
|
|
44
|
0
|
|
|
0
|
1
|
|
{ |
45
|
|
|
|
|
|
|
amount => { type => 'integer' }, |
46
|
0
|
|
|
0
|
1
|
|
rate => { package => 'Net::API::Stripe::Tax::Rate' }, |
47
|
|
|
|
|
|
|
}, @_ ) ); } |
48
|
0
|
|
|
0
|
1
|
|
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
1; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=encoding utf8 |
54
|
0
|
|
|
0
|
1
|
|
|
55
|
|
|
|
|
|
|
=head1 NAME |
56
|
0
|
|
|
0
|
1
|
|
|
57
|
|
|
|
|
|
|
Net::API::Stripe::List::Item - A Stripe Payment Link Item |
58
|
0
|
|
|
0
|
1
|
|
|
59
|
|
|
|
|
|
|
=head1 SYNOPSIS |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
my $item = $stripe->payment_link->line_items([ |
62
|
|
|
|
|
|
|
{ |
63
|
|
|
|
|
|
|
object => 'list', |
64
|
0
|
|
|
0
|
1
|
|
data => |
65
|
|
|
|
|
|
|
{ |
66
|
|
|
|
|
|
|
amount_subtotal => 2000, |
67
|
|
|
|
|
|
|
amount_total => 2200, |
68
|
|
|
|
|
|
|
currency => 'jpy', |
69
|
|
|
|
|
|
|
description => 'Some item', |
70
|
|
|
|
|
|
|
discounts => 0, |
71
|
|
|
|
|
|
|
price => |
72
|
|
|
|
|
|
|
{ |
73
|
|
|
|
|
|
|
id => $price_id, |
74
|
|
|
|
|
|
|
object => 'price', |
75
|
|
|
|
|
|
|
active => $stripe->true, |
76
|
|
|
|
|
|
|
billing_scheme => 'per_unit', |
77
|
|
|
|
|
|
|
created => $timestamp, |
78
|
|
|
|
|
|
|
currency => 'JPY', |
79
|
|
|
|
|
|
|
livemode => $stripe->true, |
80
|
|
|
|
|
|
|
lookup_key => $key, |
81
|
|
|
|
|
|
|
metadata => { customer => 123 }, |
82
|
|
|
|
|
|
|
nickname => $nickname, |
83
|
|
|
|
|
|
|
product => $product_id, |
84
|
|
|
|
|
|
|
recurring => |
85
|
|
|
|
|
|
|
{ |
86
|
|
|
|
|
|
|
aggregate_usage => 'sum', |
87
|
|
|
|
|
|
|
interval => 'month', |
88
|
|
|
|
|
|
|
interval_count => 'month', |
89
|
|
|
|
|
|
|
usage_type => 'licensed', |
90
|
|
|
|
|
|
|
}, |
91
|
|
|
|
|
|
|
}, |
92
|
|
|
|
|
|
|
tax_behavior => 'recurring', |
93
|
|
|
|
|
|
|
tiers => |
94
|
|
|
|
|
|
|
{ |
95
|
|
|
|
|
|
|
flat_amount => 10000, |
96
|
|
|
|
|
|
|
flat_amount_decimal => 10000, |
97
|
|
|
|
|
|
|
unit_amount => 1000, |
98
|
|
|
|
|
|
|
unit_amount_decimal => 1000, |
99
|
|
|
|
|
|
|
up_to => $value, |
100
|
|
|
|
|
|
|
}, |
101
|
|
|
|
|
|
|
tiers_mode => 'graduated', |
102
|
|
|
|
|
|
|
transform_quantity => |
103
|
|
|
|
|
|
|
{ |
104
|
|
|
|
|
|
|
divide_by => $value, |
105
|
|
|
|
|
|
|
round => 'up', |
106
|
|
|
|
|
|
|
}, |
107
|
|
|
|
|
|
|
type => 'recurring', |
108
|
|
|
|
|
|
|
unit_amount => 10000, |
109
|
|
|
|
|
|
|
unit_amount_decimal => 500, |
110
|
|
|
|
|
|
|
}, |
111
|
|
|
|
|
|
|
quantity => 2, |
112
|
|
|
|
|
|
|
taxes => |
113
|
|
|
|
|
|
|
{ |
114
|
|
|
|
|
|
|
amount => 200, |
115
|
|
|
|
|
|
|
rate => $rate_id, |
116
|
|
|
|
|
|
|
}, |
117
|
|
|
|
|
|
|
}, |
118
|
|
|
|
|
|
|
has_more => $stripe->true, |
119
|
|
|
|
|
|
|
url => 'https://buy.stripe.com/test_1234567890qwertyuiop', |
120
|
|
|
|
|
|
|
}]); |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=head1 VERSION |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
v0.2.0 |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
=head1 DESCRIPTION |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
The line items representing what is being sold. |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
This field is not included by default. To include it in the response, expand the line_items field. |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
This is used by: |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
=over 4 |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
=item L<Net::API::Stripe::Payment::Link> object and called from the method B<line_items> |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
=item L<Net::API::Stripe::Order::Item> |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
=back |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
=head1 CONSTRUCTOR |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
=head2 new |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
Creates a new L<Net::API::Stripe::List::Item> object. |
147
|
|
|
|
|
|
|
It may also take an hash like arguments, that also are method of the same name. |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
=head1 METHODS |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
=head2 id string |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
Unique identifier for the object. |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
=head2 object string, value is "item" |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
String representing the object’s type. Objects of the same type share the same value. |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
=head2 amount integer |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount for the line item. |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
=head2 amount_discount integer |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
=head2 amount_subtotal integer |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
Total before any discounts or taxes are applied. |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
=head2 amount_tax integer |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
=head2 amount_total integer |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
Total after discounts and taxes. |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
=head2 currency currency |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
Three-letter ISO currency code, in lowercase. Must be a supported currency. |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
=head2 description string |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
An arbitrary string attached to the object. Often useful for displaying to users. Defaults to product name. |
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
=head2 discounts array of hashes expandable |
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
The discounts applied to the line item. |
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
This field is not included by default. To include it in the response, expand the discounts field. |
188
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
=over 4 |
190
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
=item amount integer |
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
The amount discounted. |
194
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
=item discount hash, discount object |
196
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
The discount applied. |
198
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
=back |
200
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
=head2 price hash |
202
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
The price used to generate the line item. |
204
|
|
|
|
|
|
|
|
205
|
|
|
|
|
|
|
=head2 quantity positive integer or zero |
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
The quantity of products being purchased. |
208
|
|
|
|
|
|
|
|
209
|
|
|
|
|
|
|
=head2 taxes array of hashes expandable |
210
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
The taxes applied to the line item. |
212
|
|
|
|
|
|
|
|
213
|
|
|
|
|
|
|
This field is not included by default. To include it in the response, expand the taxes field. |
214
|
|
|
|
|
|
|
|
215
|
|
|
|
|
|
|
=over 4 |
216
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
=item amount integer |
218
|
|
|
|
|
|
|
|
219
|
|
|
|
|
|
|
Amount of tax applied for this rate. |
220
|
|
|
|
|
|
|
|
221
|
|
|
|
|
|
|
=item rate hash |
222
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
The tax rate id or hash applied. |
224
|
|
|
|
|
|
|
|
225
|
|
|
|
|
|
|
=back |
226
|
|
|
|
|
|
|
|
227
|
|
|
|
|
|
|
=head2 type string |
228
|
|
|
|
|
|
|
|
229
|
|
|
|
|
|
|
The type of line item. |
230
|
|
|
|
|
|
|
|
231
|
|
|
|
|
|
|
=head1 API SAMPLE |
232
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
{ |
234
|
|
|
|
|
|
|
"id": "li_1234567890qwertyuiop", |
235
|
|
|
|
|
|
|
"object": "item", |
236
|
|
|
|
|
|
|
"amount_subtotal": 0, |
237
|
|
|
|
|
|
|
"amount_total": 0, |
238
|
|
|
|
|
|
|
"currency": "jpy", |
239
|
|
|
|
|
|
|
"description": "テスト5円", |
240
|
|
|
|
|
|
|
"price": { |
241
|
|
|
|
|
|
|
"id": "price_1234567890qwertyuiop", |
242
|
|
|
|
|
|
|
"object": "price", |
243
|
|
|
|
|
|
|
"active": true, |
244
|
|
|
|
|
|
|
"billing_scheme": "per_unit", |
245
|
|
|
|
|
|
|
"created": 1634704866, |
246
|
|
|
|
|
|
|
"currency": "jpy", |
247
|
|
|
|
|
|
|
"livemode": false, |
248
|
|
|
|
|
|
|
"lookup_key": null, |
249
|
|
|
|
|
|
|
"metadata": {}, |
250
|
|
|
|
|
|
|
"nickname": null, |
251
|
|
|
|
|
|
|
"product": "prod_1234567890qwertyuiop", |
252
|
|
|
|
|
|
|
"recurring": null, |
253
|
|
|
|
|
|
|
"tax_behavior": "unspecified", |
254
|
|
|
|
|
|
|
"tiers_mode": null, |
255
|
|
|
|
|
|
|
"transform_quantity": null, |
256
|
|
|
|
|
|
|
"type": "one_time", |
257
|
|
|
|
|
|
|
"unit_amount": 5, |
258
|
|
|
|
|
|
|
"unit_amount_decimal": "5" |
259
|
|
|
|
|
|
|
}, |
260
|
|
|
|
|
|
|
"quantity": 1 |
261
|
|
|
|
|
|
|
} |
262
|
|
|
|
|
|
|
|
263
|
|
|
|
|
|
|
{ |
264
|
|
|
|
|
|
|
"id": "il_1234567890qwertyuiop", |
265
|
|
|
|
|
|
|
"object": "line_item", |
266
|
|
|
|
|
|
|
"amount": 5, |
267
|
|
|
|
|
|
|
"currency": "jpy", |
268
|
|
|
|
|
|
|
"description": "My First Invoice Item (created for API docs)", |
269
|
|
|
|
|
|
|
"discount_amounts": [], |
270
|
|
|
|
|
|
|
"discountable": true, |
271
|
|
|
|
|
|
|
"discounts": [], |
272
|
|
|
|
|
|
|
"invoice_item": "ii_1234567890qwertyuiop", |
273
|
|
|
|
|
|
|
"livemode": false, |
274
|
|
|
|
|
|
|
"metadata": {}, |
275
|
|
|
|
|
|
|
"period": { |
276
|
|
|
|
|
|
|
"end": 1643371794, |
277
|
|
|
|
|
|
|
"start": 1643371794 |
278
|
|
|
|
|
|
|
}, |
279
|
|
|
|
|
|
|
"price": { |
280
|
|
|
|
|
|
|
"id": "price_1234567890qwertyuiop", |
281
|
|
|
|
|
|
|
"object": "price", |
282
|
|
|
|
|
|
|
"active": true, |
283
|
|
|
|
|
|
|
"billing_scheme": "per_unit", |
284
|
|
|
|
|
|
|
"created": 1634704866, |
285
|
|
|
|
|
|
|
"currency": "jpy", |
286
|
|
|
|
|
|
|
"livemode": false, |
287
|
|
|
|
|
|
|
"lookup_key": null, |
288
|
|
|
|
|
|
|
"metadata": {}, |
289
|
|
|
|
|
|
|
"nickname": null, |
290
|
|
|
|
|
|
|
"product": "prod_1234567890qwertyuiop", |
291
|
|
|
|
|
|
|
"recurring": null, |
292
|
|
|
|
|
|
|
"tax_behavior": "unspecified", |
293
|
|
|
|
|
|
|
"tiers_mode": null, |
294
|
|
|
|
|
|
|
"transform_quantity": null, |
295
|
|
|
|
|
|
|
"type": "one_time", |
296
|
|
|
|
|
|
|
"unit_amount": 5, |
297
|
|
|
|
|
|
|
"unit_amount_decimal": "5" |
298
|
|
|
|
|
|
|
}, |
299
|
|
|
|
|
|
|
"proration": false, |
300
|
|
|
|
|
|
|
"quantity": 1, |
301
|
|
|
|
|
|
|
"subscription": null, |
302
|
|
|
|
|
|
|
"tax_amounts": [], |
303
|
|
|
|
|
|
|
"tax_rates": [], |
304
|
|
|
|
|
|
|
"type": "invoiceitem" |
305
|
|
|
|
|
|
|
} |
306
|
|
|
|
|
|
|
|
307
|
|
|
|
|
|
|
=head1 HISTORY |
308
|
|
|
|
|
|
|
|
309
|
|
|
|
|
|
|
=head2 v0.1.0 |
310
|
|
|
|
|
|
|
|
311
|
|
|
|
|
|
|
Initial version |
312
|
|
|
|
|
|
|
|
313
|
|
|
|
|
|
|
=head1 AUTHOR |
314
|
|
|
|
|
|
|
|
315
|
|
|
|
|
|
|
Jacques Deguest E<lt>F<jack@deguest.jp>E<gt> |
316
|
|
|
|
|
|
|
|
317
|
|
|
|
|
|
|
=head1 SEE ALSO |
318
|
|
|
|
|
|
|
|
319
|
|
|
|
|
|
|
Stripe API documentation: |
320
|
|
|
|
|
|
|
|
321
|
|
|
|
|
|
|
L<https://stripe.com/docs/api> |
322
|
|
|
|
|
|
|
|
323
|
|
|
|
|
|
|
L<Invoice line item|https://stripe.com/docs/api/invoices/object#invoice_object-lines> |
324
|
|
|
|
|
|
|
|
325
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
326
|
|
|
|
|
|
|
|
327
|
|
|
|
|
|
|
Copyright (c) 2019-2020 DEGUEST Pte. Ltd. |
328
|
|
|
|
|
|
|
|
329
|
|
|
|
|
|
|
You can use, copy, modify and redistribute this package and associated |
330
|
|
|
|
|
|
|
files under the same terms as Perl itself. |
331
|
|
|
|
|
|
|
|
332
|
|
|
|
|
|
|
=cut |
333
|
|
|
|
|
|
|
|