File Coverage

blib/lib/Net/API/Stripe/Issuing/Card/Holder.pm
Criterion Covered Total %
statement 7 24 29.1
branch n/a
condition n/a
subroutine 3 20 15.0
pod 17 17 100.0
total 27 61 44.2


line stmt bran cond sub pod time code
1             ##----------------------------------------------------------------------------
2             ## Stripe API - ~/lib/Net/API/Stripe/Issuing/Card/Holder.pm
3             ## Version v0.200.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             ## https://stripe.com/docs/api/issuing/cardholders/object
11             package Net::API::Stripe::Issuing::Card::Holder;
12             BEGIN
13             {
14 1     1   830 use strict;
  1         1  
  1         29  
15 1     1   4 use parent qw( Net::API::Stripe::Generic );
  1         3  
  1         4  
16 1     1   350 our( $VERSION ) = 'v0.200.0';
17             };
18              
19 0     0 1   sub id { shift->_set_get_scalar( 'id', @_ ); }
20              
21 0     0 1   sub object { shift->_set_get_scalar( 'object', @_ ); }
22              
23 0     0 1   sub authorization_controls { return( shift->_set_get_object( 'authorization_controls', 'Net::API::Stripe::Issuing::Card::AuthorizationsControl', @_ ) ); }
24              
25 0     0 1   sub billing { shift->_set_get_object( 'billing', 'Net::API::Stripe::Billing::Details', @_ ); }
26              
27 0     0 1   sub company { return( shift->_set_get_object( 'company', 'Net::API::Stripe::Connect::Account::Company', @_ ) ); }
28              
29 0     0 1   sub created { shift->_set_get_datetime( 'created', @_ ); }
30              
31 0     0 1   sub email { shift->_set_get_scalar( 'email', @_ ); }
32              
33 0     0 1   sub individual { return( shift->_set_get_object( 'individual', 'Net::API::Stripe::Connect::Person', @_ ) ); }
34              
35 0     0 1   sub is_default { return( shift->_set_get_boolean( 'is_default', @_ ) ); }
36              
37 0     0 1   sub livemode { shift->_set_get_boolean( 'livemode', @_ ); }
38              
39 0     0 1   sub metadata { shift->_set_get_hash( 'metadata', @_ ); }
40              
41 0     0 1   sub name { shift->_set_get_scalar( 'name', @_ ); }
42              
43 0     0 1   sub phone_number { shift->_set_get_scalar( 'phone_number', @_ ); }
44              
45 0     0 1   sub requirements { return( shift->_set_get_object( 'requirements', 'Net::API::Stripe::Connect::Account::Requirements', @_ ) ); }
46              
47             sub spending_controls
48             {
49 0     0 1   return( shift->_set_get_class( 'spending_controls',
50             {
51             allowed_categories => { type => 'array' },
52             blocked_categories => { type => 'array' },
53             spending_limits =>
54             {
55             type => 'class', definition =>
56             {
57             amount => { type => 'number' },
58             categories => { type => 'array' },
59             interval => { type => 'scalar' },
60             }
61             },
62             spending_limits_currency => { type => 'scalar' },
63             }, @_ ) );
64             }
65              
66 0     0 1   sub status { shift->_set_get_scalar( 'status', @_ ); }
67              
68 0     0 1   sub type { shift->_set_get_scalar( 'type', @_ ); }
69              
70             1;
71              
72             __END__
73              
74             =encoding utf8
75              
76             =head1 NAME
77              
78             Net::API::Stripe::Issuing::Card::Holder - A Stripe Card Holder Object
79              
80             =head1 SYNOPSIS
81              
82             my $holder = $stripe->card_holder({
83             authorization_controls =>
84             {
85             allowed_categories => [],
86             blocked_categories => [],
87             spending_limits =>
88             [
89             {
90             amount => 2000000,
91             categories => '',
92             interval => 'monthly',
93             },
94             {
95             amount => 200000,
96             categories => '',
97             interval => 'weekly',
98             },
99             ],
100             spending_limits_currency => 'jpy',
101             },
102             billing => $billing_details_object,
103             company => $account_company_object,
104             created => '2020-04-12T07:30:10',
105             email => 'john.doe@example.com',
106             individual => $account_individual_object,
107             is_default => $stripe->true,
108             livemode => $stripe->false,
109             name => 'John Doe',
110             phone_number => '+81-(0)90-1234-5678',
111             requirements => $account_requirements_object,
112             status => 'active',
113             type => 'individual',
114             });
115              
116             See documentation in L<Net::API::Stripe> for example to make api calls to Stripe to create those objects.
117              
118             =head1 VERSION
119              
120             v0.200.0
121              
122             =head1 DESCRIPTION
123              
124             An Issuing Cardholder object represents an individual or business entity who is issued (L<https://stripe.com/docs/issuing>) cards.
125              
126             =head1 CONSTRUCTOR
127              
128             =over 4
129              
130             =item B<new>( %ARG )
131              
132             Creates a new L<Net::API::Stripe::Issuing::Card::Holder> object.
133             It may also take an hash like arguments, that also are method of the same name.
134              
135             =back
136              
137             =head1 METHODS
138              
139             =over 4
140              
141             =item B<id> string
142              
143             Unique identifier for the object.
144              
145             =item B<object> string, value is "issuing.cardholder"
146              
147             String representing the object’s type. Objects of the same type share the same value.
148              
149             =item B<authorization_controls> hash
150              
151             This is a L<Net::API::Stripe::Issuing::Card::AuthorizationsControl> object.
152              
153             =item B<billing> hash
154              
155             The cardholder’s billing address.
156              
157             This is a L<Net::API::Stripe::Billing::Details> object.
158              
159             =item B<company> hash preview feature
160              
161             Additional information about a business_entity cardholder.
162              
163             This is a L<Net::API::Stripe::Connect::Account::Company> object.
164              
165             =item B<created> timestamp
166              
167             Time at which the object was created. Measured in seconds since the Unix epoch.
168              
169             This is a C<DateTime> object.
170              
171             =item B<email> string
172              
173             The cardholder’s email address.
174              
175             =item B<individual> hash preview feature
176              
177             Additional information about an individual cardholder.
178              
179             This is a L<Net::API::Stripe::Connect::Person> object.
180              
181             =item B<is_default> boolean
182              
183             Whether or not this cardholder is the default cardholder.
184              
185             =item B<livemode> boolean
186              
187             Has the value true if the object exists in live mode or the value false if the object exists in test mode.
188              
189             =item B<metadata> hash
190              
191             Set of 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.
192              
193             =item B<name> string
194              
195             The cardholder’s name. This will be printed on cards issued to them.
196              
197             =item B<phone_number> string
198              
199             The cardholder’s phone number.
200              
201             =item B<requirements> hash
202              
203             Information about verification requirements for the cardholder, including what information needs to be collected.
204              
205             This is a L<Net::API::Stripe::Connect::Account::Requirements> object.
206              
207             =item B<spending_controls> hash
208              
209             This is a hash whose properties are accessible as a dynamic class methods
210              
211             =over 8
212              
213             =item I<amount> positive integer
214              
215             Maximum amount allowed to spend per time interval.
216              
217             =item I<categories> array
218              
219             Array of strings containing categories on which to apply the spending limit. Leave this blank to limit all charges.
220              
221             =item I<interval> enum
222              
223             The time interval or event with which to apply this spending limit towards.
224              
225             =over 12
226              
227             =item I<per_authorization>
228              
229             A maximum amount for each authorization.
230              
231             =item I<daily>
232              
233             A maximum within a day. A day start at midnight UTC.
234              
235             =item I<weekly>
236              
237             A maximum within a week. The first day of a week is Monday.
238              
239             =item I<monthly>
240              
241             A maximum within a month. Starts on the first of that month.
242              
243             =item I<yearly>
244              
245             A maximum amount within a year. Starts January 1st.
246              
247             =item I<all_time>
248              
249             A maximum amount for all transactions.
250              
251             =back
252              
253             =item I<spending_limits_currency> currency
254              
255             Currency for the amounts within spending_limits. Locked to the currency of the card.
256              
257             =back
258              
259             =item B<status> string
260              
261             One of active, inactive, or blocked.
262              
263             =item B<type> string
264              
265             One of individual or business_entity.
266              
267             =back
268              
269             =head1 API SAMPLE
270              
271             {
272             "id": "ich_fake123456789",
273             "object": "issuing.cardholder",
274             "authorization_controls": {
275             "allowed_categories": [],
276             "blocked_categories": [],
277             "spending_limits": [],
278             "spending_limits_currency": null
279             },
280             "billing": {
281             "address": {
282             "city": "Beverly Hills",
283             "country": "US",
284             "line1": "123 Fake St",
285             "line2": "Apt 3",
286             "postal_code": "90210",
287             "state": "CA"
288             },
289             "name": "Jenny Rosen"
290             },
291             "company": null,
292             "created": 1540111055,
293             "email": "jenny@example.com",
294             "individual": null,
295             "is_default": false,
296             "livemode": false,
297             "metadata": {},
298             "name": "Jenny Rosen",
299             "phone_number": "+18008675309",
300             "requirements": {
301             "disabled_reason": null,
302             "past_due": []
303             },
304             "status": "active",
305             "type": "individual"
306             }
307              
308             =head1 HISTORY
309              
310             =head2 v0.1
311              
312             Initial version
313              
314             =head2 v0.2
315              
316             Added method L</"spending_controls"> that was added on Stripe api.
317              
318             =head1 AUTHOR
319              
320             Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
321              
322             =head1 SEE ALSO
323              
324             Stripe API documentation:
325              
326             L<https://stripe.com/docs/api/issuing/cardholders>, L<https://stripe.com/docs/issuing/cards#create-cardholder>
327              
328             =head1 COPYRIGHT & LICENSE
329              
330             Copyright (c) 2019-2020 DEGUEST Pte. Ltd.
331              
332             You can use, copy, modify and redistribute this package and associated
333             files under the same terms as Perl itself.
334              
335             =cut