| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
##---------------------------------------------------------------------------- |
|
2
|
|
|
|
|
|
|
## Stripe API - ~/lib/Net/API/Stripe/Order/SKU/Inventory.pm |
|
3
|
|
|
|
|
|
|
## Version v0.100.0 |
|
4
|
|
|
|
|
|
|
## Copyright(c) 2019 DEGUEST Pte. Ltd. |
|
5
|
|
|
|
|
|
|
## Author: Jacques Deguest <jack@deguest.jp> |
|
6
|
|
|
|
|
|
|
## Created 2019/11/02 |
|
7
|
|
|
|
|
|
|
## Modified 2020/05/15 |
|
8
|
|
|
|
|
|
|
## |
|
9
|
|
|
|
|
|
|
##---------------------------------------------------------------------------- |
|
10
|
|
|
|
|
|
|
package Net::API::Stripe::Order::SKU::Inventory; |
|
11
|
|
|
|
|
|
|
BEGIN |
|
12
|
|
|
|
|
|
|
{ |
|
13
|
1
|
|
|
1
|
|
1060
|
use strict; |
|
|
1
|
|
|
|
|
8
|
|
|
|
1
|
|
|
|
|
38
|
|
|
14
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
28
|
|
|
15
|
1
|
|
|
1
|
|
8
|
use parent qw( Net::API::Stripe::Generic ); |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
6
|
|
|
16
|
1
|
|
|
1
|
|
77
|
use vars qw( $VERSION ); |
|
|
1
|
|
|
|
|
4
|
|
|
|
1
|
|
|
|
|
49
|
|
|
17
|
1
|
|
|
1
|
|
51
|
our( $VERSION ) = 'v0.100.0'; |
|
18
|
|
|
|
|
|
|
}; |
|
19
|
|
|
|
|
|
|
|
|
20
|
1
|
|
|
1
|
|
7
|
use strict; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
25
|
|
|
21
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
122
|
|
|
22
|
|
|
|
|
|
|
|
|
23
|
0
|
|
|
0
|
1
|
|
sub quantity { return( shift->_set_get_scalar( 'quantity', @_ ) ); } |
|
24
|
|
|
|
|
|
|
|
|
25
|
0
|
|
|
0
|
1
|
|
sub type { return( shift->_set_get_scalar( 'type', @_ ) ); } |
|
26
|
|
|
|
|
|
|
|
|
27
|
0
|
|
|
0
|
1
|
|
sub value { return( shift->_set_get_scalar( 'value', @_ ) ); } |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
__END__ |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=encoding utf8 |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head1 NAME |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
Net::API::Stripe::Order::SKU::Inventory - A Stripe SKU Inventory Object |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
my $inv = $stripe->sku->inventory({ |
|
42
|
|
|
|
|
|
|
quantity => 2, |
|
43
|
|
|
|
|
|
|
type => 'infinite', |
|
44
|
|
|
|
|
|
|
value => undef, |
|
45
|
|
|
|
|
|
|
}); |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 VERSION |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
v0.100.0 |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
Description of the SKU’s inventory. |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
This is instantiated by method B<inventory> in module L<Net::API::Stripe::Order::SKU> |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 CONSTRUCTOR |
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head2 new( %ARG ) |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
Creates a new L<Net::API::Stripe::Order::SKU::Inventory> object. |
|
62
|
|
|
|
|
|
|
It may also take an hash like arguments, that also are method of the same name. |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 METHODS |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head2 quantity positive integer or zero |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
The count of inventory available. Will be present if and only if type is finite. |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head2 type string |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
Inventory type. Possible values are finite, bucket (not quantified), and infinite. |
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head2 value string |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
An indicator of the inventory available. Possible values are in_stock, limited, and out_of_stock. Will be present if and only if type is bucket. |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head1 API SAMPLE |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
{ |
|
81
|
|
|
|
|
|
|
"id": "sku_fake123456789", |
|
82
|
|
|
|
|
|
|
"object": "sku", |
|
83
|
|
|
|
|
|
|
"active": true, |
|
84
|
|
|
|
|
|
|
"attributes": { |
|
85
|
|
|
|
|
|
|
"size": "Medium", |
|
86
|
|
|
|
|
|
|
"gender": "Unisex" |
|
87
|
|
|
|
|
|
|
}, |
|
88
|
|
|
|
|
|
|
"created": 1571480453, |
|
89
|
|
|
|
|
|
|
"currency": "jpy", |
|
90
|
|
|
|
|
|
|
"image": null, |
|
91
|
|
|
|
|
|
|
"inventory": { |
|
92
|
|
|
|
|
|
|
"quantity": 50, |
|
93
|
|
|
|
|
|
|
"type": "finite", |
|
94
|
|
|
|
|
|
|
"value": null |
|
95
|
|
|
|
|
|
|
}, |
|
96
|
|
|
|
|
|
|
"livemode": false, |
|
97
|
|
|
|
|
|
|
"metadata": {}, |
|
98
|
|
|
|
|
|
|
"package_dimensions": null, |
|
99
|
|
|
|
|
|
|
"price": 1500, |
|
100
|
|
|
|
|
|
|
"product": "prod_fake123456789", |
|
101
|
|
|
|
|
|
|
"updated": 1571480453 |
|
102
|
|
|
|
|
|
|
} |
|
103
|
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=head1 HISTORY |
|
105
|
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=head2 v0.1 |
|
107
|
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
Initial version |
|
109
|
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=head1 AUTHOR |
|
111
|
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
Jacques Deguest E<lt>F<jack@deguest.jp>E<gt> |
|
113
|
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=head1 SEE ALSO |
|
115
|
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
Stripe API documentation: |
|
117
|
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
L<https://stripe.com/docs/api> |
|
119
|
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
|
121
|
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
Copyright (c) 2019-2020 DEGUEST Pte. Ltd. |
|
123
|
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
You can use, copy, modify and redistribute this package and associated |
|
125
|
|
|
|
|
|
|
files under the same terms as Perl itself. |
|
126
|
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
=cut |
|
128
|
|
|
|
|
|
|
|