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