Stripe/Order/SKU/Inventory.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%
quantity
2.0
type
2.0
value
2.0
CRAP 1.5
« Stripe/Issuing/Card/AuthorizationsControl/SpendingLimit.pm ↑ Summary Stripe/Payment/Intent/NextAction.pm »
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 <@sitael.tokyo.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 ▶ 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 quantity { shift->_set_get_scalar( 'quantity', @_ ); }
Subroutine quantity: not called CC=1 SCAR=6.9
Pod documented
19  
20 0 ▶sub type { shift->_set_get_scalar( 'type', @_ ); }
Subroutine type: not called CC=1 SCAR=6.9
Pod documented
21  
22 0 ▶sub value { shift->_set_get_scalar( 'value', @_ ); }
Subroutine value: 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::Order::SKU::Inventory - A Stripe SKU Inventory Object
33  
34 =head1 SYNOPSIS
35  
36 my $inv = $stripe->sku->inventory({
37 quantity => 2,
38 type => 'infinite',
39 value => undef,
40 });
41  
42 =head1 VERSION
43  
44 v0.100.0
45  
46 =head1 DESCRIPTION
47  
48 Description of the SKU’s inventory.
49  
50 This is instantiated by method B<inventory> in module L<Net::API::Stripe::Order::SKU>
51  
52 =head1 CONSTRUCTOR
53  
54 =over 4
55  
56 =item B<new>( %ARG )
57  
58 Creates a new L<Net::API::Stripe::Order::SKU::Inventory> object.
59 It may also take an hash like arguments, that also are method of the same name.
60  
61 =back
62  
63 =head1 METHODS
64  
65 =over 4
66  
67 =item B<quantity> positive integer or zero
68  
69 The count of inventory available. Will be present if and only if type is finite.
70  
71 =item B<type> string
72  
73 Inventory type. Possible values are finite, bucket (not quantified), and infinite.
74  
75 =item B<value> string
76  
77 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.
78  
79 =back
80  
81 =head1 API SAMPLE
82  
83 {
84 "id": "sku_fake123456789",
85 "object": "sku",
86 "active": true,
87 "attributes": {
88 "size": "Medium",
89 "gender": "Unisex"
90 },
91 "created": 1571480453,
92 "currency": "jpy",
93 "image": null,
94 "inventory": {
95 "quantity": 50,
96 "type": "finite",
97 "value": null
98 },
99 "livemode": false,
100 "metadata": {},
101 "package_dimensions": null,
102 "price": 1500,
103 "product": "prod_fake123456789",
104 "updated": 1571480453
105 }
106  
107 =head1 HISTORY
108  
109 =head2 v0.1
110  
111 Initial version
112  
113 =head1 AUTHOR
114  
115 Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
116  
117 =head1 SEE ALSO
118  
119 Stripe API documentation:
120  
121 L<https://stripe.com/docs/api>
122  
123 =head1 COPYRIGHT & LICENSE
124  
125 Copyright (c) 2019-2020 DEGUEST Pte. Ltd.
126  
127 You can use, copy, modify and redistribute this package and associated
128 files under the same terms as Perl itself.
129  
130 =cut
131  
« Stripe/Issuing/Card/AuthorizationsControl/SpendingLimit.pm ↑ Summary Stripe/Payment/Intent/NextAction.pm »