Stripe/Order/DeliveryEstimate.pm

filter: Statementstmt 66.6% 8 / 12 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 42.8% 3 / 7 Podpod 100% 4 / 4 totaltotal 65.2% 15 / 23 CC 1 SCAR 4.5
CC
1
Cov
67%
date
2.0
earliest
2.0
latest
2.0
CRAP 1.6
« Stripe/Fraud/Review/Session.pm ↑ Summary Stripe/Order/StatusTransitions.pm »
1 ##----------------------------------------------------------------------------
2 ## Stripe API - ~/lib/Net/API/Stripe/Order/DeliveryEstimate.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::DeliveryEstimate;
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 date { shift->_set_get_datetime( 'date', @_ ); }
Subroutine date: not called CC=1 SCAR=6.9
Pod documented
19  
20 0 ▶sub earliest { shift->_set_get_datetime( 'earliest', @_ ); }
Subroutine earliest: not called CC=1 SCAR=6.9
Pod documented
21  
22 0 ▶sub latest { shift->_set_get_datetime( 'latest', @_ ); }
Subroutine latest: not called CC=1 SCAR=6.9
Pod documented
23  
24 0 ▶sub type { shift->_set_get_scalar( 'type', @_ ); }
Subroutine type: not called CC=1 SCAR=6.9
Pod documented
25  
26 1 1;
27  
28 __END__
29  
30 =encoding utf8
31  
32 =head1 NAME
33  
34 Net::API::Stripe::Order::DeliveryEstimate - A Stripe Order Delivery Estimate Object
35  
36 =head1 SYNOPSIS
37  
38 my $delivery = $stripe->order->delivery_estimate({
39 date => '2020-04-12',
40 earlest => '2020-04-06',
41 latest => '2020^04-30',
42 type => 'range',
43 });
44  
45 =head1 VERSION
46  
47 v0.100.0
48  
49 =head1 DESCRIPTION
50  
51 The estimated delivery date for the given shipping method. Can be either a specific date or a range.
52  
53 This is instantiated by method B<delivery_estimate> in module L<Net::API::Stripe::Order::ShippingMethod>
54  
55 =head1 CONSTRUCTOR
56  
57 =over 4
58  
59 =item B<new>( %ARG )
60  
61 Creates a new L<Net::API::Stripe::Order::DeliveryEstimate> object.
62 It may also take an hash like arguments, that also are method of the same name.
63  
64 =back
65  
66 =head1 METHODS
67  
68 =over 4
69  
70 =item B<date> string
71  
72 If type is "exact", date will be the expected delivery date in the format YYYY-MM-DD.
73  
74 When set, this returns a C<DateTime> object.
75  
76 =item B<earliest> string
77  
78 If type is "range", earliest will be be the earliest delivery date in the format YYYY-MM-DD.
79  
80 When set, this returns a C<DateTime> object.
81  
82 =item B<latest> string
83  
84 If type is "range", latest will be the latest delivery date in the format YYYY-MM-DD.
85  
86 When set, this returns a C<DateTime> object.
87  
88 =item B<type> string
89  
90 The type of estimate. Must be either "range" or "exact".
91  
92 =back
93  
94 =head1 API SAMPLE
95  
96 {
97 "id": "or_fake123456789",
98 "object": "order",
99 "amount": 1500,
100 "amount_returned": null,
101 "application": null,
102 "application_fee": null,
103 "charge": null,
104 "created": 1571480453,
105 "currency": "jpy",
106 "customer": null,
107 "email": null,
108 "items": [
109 {
110 "object": "order_item",
111 "amount": 1500,
112 "currency": "jpy",
113 "description": "T-shirt",
114 "parent": "sk_fake123456789",
115 "quantity": null,
116 "type": "sku"
117 }
118 ],
119 "livemode": false,
120 "metadata": {},
121 "returns": {
122 "object": "list",
123 "data": [],
124 "has_more": false,
125 "url": "/v1/order_returns?order=or_fake123456789"
126 },
127 "selected_shipping_method": null,
128 "shipping": {
129 "address": {
130 "city": "Anytown",
131 "country": "US",
132 "line1": "1234 Main street",
133 "line2": null,
134 "postal_code": "123456",
135 "state": null
136 },
137 "carrier": null,
138 "name": "Jenny Rosen",
139 "phone": null,
140 "tracking_number": null
141 },
142 "shipping_methods": null,
143 "status": "created",
144 "status_transitions": {
145 "canceled": null,
146 "fulfiled": null,
147 "paid": null,
148 "returned": null
149 },
150 "updated": 1571480453
151 }
152  
153 =head1 HISTORY
154  
155 =head2 v0.1
156  
157 Initial version
158  
159 =head1 AUTHOR
160  
161 Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
162  
163 =head1 SEE ALSO
164  
165 Stripe API documentation:
166  
167 L<https://stripe.com/docs/api/orders/object>
168  
169 =head1 COPYRIGHT & LICENSE
170  
171 Copyright (c) 2019-2020 DEGUEST Pte. Ltd.
172  
173 You can use, copy, modify and redistribute this package and associated
174 files under the same terms as Perl itself.
175  
176 =cut
« Stripe/Fraud/Review/Session.pm ↑ Summary Stripe/Order/StatusTransitions.pm »