File Coverage

lib/Net/API/Stripe/Shipping/Rate.pm
Criterion Covered Total %
statement 19 31 61.2
branch n/a
condition n/a
subroutine 7 19 36.8
pod 12 12 100.0
total 38 62 61.2


line stmt bran cond sub pod time code
1             ##----------------------------------------------------------------------------
2             ## Stripe API - ~/lib/Net/API/Stripe/Shipping/Rate
3             ## Version v0.1.0
4             ## Copyright(c) 2022 DEGUEST Pte. Ltd.
5             ## Author: Jacques Deguest <jack@deguest.jp>
6             ## Created 2022/01/24
7             ## Modified 2022/01/24
8             ##
9             ##----------------------------------------------------------------------------
10             BEGIN
11             {
12             use strict;
13 2     2   23925531 use warnings;
  2         13  
  2         67  
14 2     2   13 use parent qw( Net::API::Stripe::Generic );
  2         5  
  2         62  
15 2     2   11 use vars qw( $VERSION );
  2         5  
  2         10  
16 2     2   162 our( $VERSION ) = 'v0.1.0';
  2         4  
  2         117  
17 2     2   38 };
18              
19             use strict;
20 2     2   12 use warnings;
  2         6  
  2         55  
21 2     2   12  
  2         6  
  2         681  
22              
23 0     0 1    
24              
25 0     0 1    
26             {
27 0     0 1   maximum => {
28             definition => { unit => { type => "scalar" }, value => { type => "number" } },
29 0     0 1   type => "class",
30             },
31 0     0 1   minimum => {
32             definition => { unit => { type => "scalar" }, value => { type => "number" } },
33             type => "class",
34             },
35             }, @_ ) ); }
36              
37              
38              
39              
40              
41              
42              
43 0     0 1    
44             1;
45 0     0 1   # NOTE: POD
46              
47 0     0 1   =encoding utf8
48              
49 0     0 1   =head1 NAME
50              
51 0     0 1   Net::API::Stripe::Shipping::Rate - The shipping rate object
52              
53 0     0 1   =head1 SYNOPSIS
54              
55 0     0 1   =head1 VERSION
56              
57             v0.1.0
58              
59             =head1 DESCRIPTION
60              
61             Shipping rates describe the price of shipping presented to your customers and can be applied to L<Checkout Sessions|Checkout Sessions> to collect shipping costs.
62              
63             =head1 METHODS
64              
65             =head2 id string
66              
67             Unique identifier for the object.
68              
69             =head2 object string
70              
71             String representing the object's type. Objects of the same type share the same value.
72              
73             =head2 active boolean
74              
75             Whether the shipping rate can be used for new purchases. Defaults to C<true>.
76              
77             =head2 created timestamp
78              
79             Time at which the object was created. Measured in seconds since the Unix epoch.
80              
81             =head2 delivery_estimate hash
82              
83             The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions.
84              
85             It has the following properties:
86              
87             =over 4
88              
89             =item I<maximum> hash
90              
91             The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite.
92              
93             =over 8
94              
95             =item I<unit> string
96              
97             A unit of time.
98              
99             =item I<value> integer
100              
101             Must be greater than 0.
102              
103             =back
104              
105             =item I<minimum> hash
106              
107             The lower bound of the estimated range. If empty, represents no lower bound.
108              
109             =over 8
110              
111             =item I<unit> string
112              
113             A unit of time.
114              
115             =item I<value> integer
116              
117             Must be greater than 0.
118              
119             =back
120              
121              
122             =back
123              
124             =head2 display_name string
125              
126             The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions.
127              
128             =head2 fixed_amount object
129              
130             Describes a fixed amount to charge for shipping. Must be present if type is C<fixed_amount>.
131              
132             This is a L<Net::API::Stripe::Balance::ConnectReserved> object.
133              
134             =head2 livemode boolean
135              
136             Has the value C<true> if the object exists in live mode or the value C<false> if the object exists in test mode.
137              
138             =head2 metadata hash
139              
140             Set of L<key-value pairs|key-value pairs> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
141              
142             =head2 tax_behavior string
143              
144             Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of C<inclusive>, C<exclusive>, or C<unspecified>.
145              
146             =head2 tax_code expandable
147              
148             A L<tax code|tax code> ID. The Shipping tax code is C<txcd_92010001>.
149              
150             When expanded this is an L<Net::API::Stripe::Product::TaxCode> object.
151              
152             =head2 type string
153              
154             The type of calculation to use on the shipping rate. Can only be C<fixed_amount> for now.
155              
156             =head1 API SAMPLE
157              
158             {
159             "id": "shr_1KJGon2eZvKYlo2C3Hc5P110",
160             "object": "shipping_rate",
161             "active": true,
162             "created": 1642508985,
163             "delivery_estimate": null,
164             "display_name": "Ground shipping",
165             "fixed_amount": {
166             "amount": 500,
167             "currency": "usd"
168             },
169             "livemode": false,
170             "metadata": {
171             },
172             "tax_behavior": "unspecified",
173             "tax_code": null,
174             "type": "fixed_amount"
175             }
176              
177             =head1 HISTORY
178              
179             =head2 v0.1.0
180              
181             Initial version
182              
183             =head1 AUTHOR
184              
185             Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
186              
187             =head1 SEE ALSO
188              
189             L<Stripe API documentation|https://stripe.com/docs/api#shipping_rate_object>
190              
191             =head1 COPYRIGHT & LICENSE
192              
193             Copyright (c) 2019-2022 DEGUEST Pte. Ltd.
194              
195             You can use, copy, modify and redistribute this package and associated
196             files under the same terms as Perl itself.
197              
198             =cut