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