File Coverage

lib/Net/API/Stripe/Shipping.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.pm
3             ## Version v0.101.0
4             ## Copyright(c) 2020 DEGUEST Pte. Ltd.
5             ## Author: Jacques Deguest <jack@deguest.jp>
6             ## Created 2019/11/02
7             ## Modified 2022/10/29
8             ##
9             ##----------------------------------------------------------------------------
10             package Net::API::Stripe::Shipping;
11             BEGIN
12             {
13 2     2   21356552 use strict;
  2         14  
  2         64  
14 2     2   11 use warnings;
  2         14  
  2         63  
15 2     2   10 use parent qw( Net::API::Stripe::Generic );
  2         11  
  2         12  
16 2     2   149 use vars qw( $VERSION );
  2         5  
  2         119  
17 2     2   68 our( $VERSION ) = 'v0.101.0';
18             };
19              
20 2     2   15 use strict;
  2         3  
  2         45  
21 2     2   10 use warnings;
  2         4  
  2         640  
22              
23 0     0 1   sub address { return( shift->_set_get_object( 'address', 'Net::API::Stripe::Address', @_ ) ); }
24              
25 0     0 1   sub carrier { return( shift->_set_get_scalar( 'carrier', @_ ) ); }
26              
27 0     0 1   sub customs { return( shift->_set_get_class( 'customs',
28             { eori_number => { type => "scalar" } }, @_ ) ); }
29              
30 0     0 1   sub eta { return( shift->_set_get_datetime( 'eta', @_ ) ); }
31              
32 0     0 1   sub name { return( shift->_set_get_scalar( 'name', @_ ) ); }
33              
34 0     0 1   sub phone { return( shift->_set_get_scalar( 'phone', @_ ) ); }
35              
36 0     0 1   sub phone_number { return( shift->_set_get_scalar( 'phone_number', @_ ) ); }
37              
38 0     0 1   sub service { return( shift->_set_get_scalar( 'service', @_ ) ); }
39              
40 0     0 1   sub status { return( shift->_set_get_scalar( 'status', @_ ) ); }
41              
42 0     0 1   sub tracking_number { return( shift->_set_get_scalar( 'tracking_number', @_ ) ); }
43              
44 0     0 1   sub tracking_url { return( shift->_set_get_uri( 'tracking_url', @_ ) ); }
45              
46 0     0 1   sub type { return( shift->_set_get_scalar( 'type', @_ ) ); }
47              
48             1;
49             # NOTE: POD
50             __END__
51              
52             =encoding utf8
53              
54             =head1 NAME
55              
56             Net::API::Stripe::Shipping - A Stripe Shipping Object
57              
58             =head1 SYNOPSIS
59              
60             my $shipping = $stripe->shipping({
61             address => $address_object,
62             carrier => 'DHL',
63             eta => '2020-04-12T08:00:00',
64             name => 'John Doe',
65             phone => '+81-(0)90-1234-5678',
66             service => 'express',
67             status => 'pending',
68             tracking_number => 1234567890,
69             tracking_url => 'https://track.example.com/1234567890',
70             type => 'individual',
71             });
72              
73             =head1 VERSION
74              
75             v0.101.0
76              
77             =head1 DESCRIPTION
78              
79             Where and how things will be shipped.
80              
81             This is inherited by: L<Net::API::Stripe::Charge::Shipping>, L<Net::API::Stripe::Customer::Shipping>, L<Net::API::Stripe::Issuing::Card::Shipping>, L<Net::API::Stripe::Order::Shipping>, C<Net::API::Stripe::>, C<Net::API::Stripe::>
82              
83             =head1 CONSTRUCTOR
84              
85             =head2 new( %ARG )
86              
87             Creates a new L<Net::API::Stripe::Shipping> object.
88             It may also take an hash like arguments, that also are method of the same name.
89              
90             =head1 METHODS
91              
92             =head2 address hash
93              
94             Shipping address.
95              
96             This is a L<Net::API::Stripe::Address> object, if any.
97              
98             =head2 carrier string
99              
100             The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.
101              
102             =head2 customs hash
103              
104             Additional information that may be required for clearing customs.
105              
106             It has the following properties:
107              
108             =over 4
109              
110             =item C<eori_number> string
111              
112             A registration number used for customs in Europe. See https://www.gov.uk/eori and https://ec.europa.eu/taxationI<customs/business/customs-procedures-import-and-export/customs-procedures/economic-operators-registration-and-identification-number-eori>en.
113              
114             =back
115              
116             =head2 eta timestamp
117              
118             A unix timestamp representing a best estimate of when the card will be delivered.
119              
120             =head2 name string
121              
122             Recipient name.
123              
124             =head2 phone string
125              
126             Recipient phone (including extension).
127              
128             =head2 phone_number string
129              
130             The phone number of the receiver of the bulk shipment. This phone number will be provided to the shipping company, who might use it to contact the receiver in case of delivery issues.
131              
132             =head2 service string
133              
134             Shipment service, such as standard or express. Possible enum values
135              
136             =over 4
137              
138             =item I<standard>
139              
140             Cards arrive in 2-6 business days.
141              
142             =item I<express>
143              
144             Cards arrive in 2 business days.
145              
146             =item I<priority>
147              
148             Cards arrive in 1 business day.
149              
150             =back
151              
152             =head2 status string
153              
154             The delivery status of the card. One of pending, shipped, delivered, returned, failure, or canceled.
155              
156             =head2 tracking_number string
157              
158             A tracking number for a card shipment. This is a C<URI> object.
159              
160             =head2 tracking_url string
161              
162             A link to the shipping carrier’s site where you can view detailed information about a card shipment.
163              
164             This returns a L<URI> object.
165              
166             =head2 type string
167              
168             One of bulk or individual. Bulk shipments will be grouped and mailed together, while individual ones will not.
169              
170             =head1 API SAMPLE
171              
172             {
173             "id": "ic_fake123456789",
174             "object": "issuing.card",
175             "authorization_controls": {
176             "allowed_categories": null,
177             "blocked_categories": null,
178             "currency": "usd",
179             "max_amount": 10000,
180             "max_approvals": 1,
181             "spending_limits": [],
182             "spending_limits_currency": null
183             },
184             "brand": "Visa",
185             "cardholder": {
186             "id": "ich_fake123456789",
187             "object": "issuing.cardholder",
188             "authorization_controls": {
189             "allowed_categories": [],
190             "blocked_categories": [],
191             "spending_limits": [],
192             "spending_limits_currency": null
193             },
194             "billing": {
195             "address": {
196             "city": "Beverly Hills",
197             "country": "US",
198             "line1": "123 Fake St",
199             "line2": "Apt 3",
200             "postal_code": "90210",
201             "state": "CA"
202             },
203             "name": "Jenny Rosen"
204             },
205             "company": null,
206             "created": 1540111055,
207             "email": "jenny@example.com",
208             "individual": null,
209             "is_default": false,
210             "livemode": false,
211             "metadata": {},
212             "name": "Jenny Rosen",
213             "phone_number": "+18008675309",
214             "requirements": {
215             "disabled_reason": null,
216             "past_due": []
217             },
218             "status": "active",
219             "type": "individual"
220             },
221             "created": 1571652525,
222             "currency": "usd",
223             "exp_month": 8,
224             "exp_year": 2020,
225             "last4": "4242",
226             "livemode": false,
227             "metadata": {},
228             "name": "Jenny Rosen",
229             "pin": null,
230             "replacement_for": null,
231             "replacement_reason": null,
232             "shipping": null,
233             "status": "active",
234             "type": "physical"
235             }
236              
237             =head1 HISTORY
238              
239             =head2 v0.100.0
240              
241             Initial version
242              
243             =head1 AUTHOR
244              
245             Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
246              
247             =head1 SEE ALSO
248              
249             Stripe API documentation:
250              
251             L<https://stripe.com/docs/api/issuing/cards/object>
252              
253             =head1 COPYRIGHT & LICENSE
254              
255             Copyright (c) 2020-2020 DEGUEST Pte. Ltd.
256              
257             You can use, copy, modify and redistribute this package and associated
258             files under the same terms as Perl itself.
259              
260             =cut