File Coverage

lib/Net/API/Stripe/Treasury/FinancialAccount.pm
Criterion Covered Total %
statement 7 23 30.4
branch n/a
condition n/a
subroutine 3 19 15.7
pod 16 16 100.0
total 26 58 44.8


line stmt bran cond sub pod time code
1             ##----------------------------------------------------------------------------
2             ## Stripe API - ~/lib/Net/API/Stripe/Treasury/FinancialAccount.pm
3             ## Version v0.1.0
4             ## Copyright(c) 2022 DEGUEST Pte. Ltd.
5             ## Author: Jacques Deguest <jack@deguest.jp>
6             ## Created 2022/10/29
7             ## Modified 2022/10/29
8             ##
9             ##----------------------------------------------------------------------------
10             package Net::API::Stripe::Treasury::FinancialAccount;
11             BEGIN
12             {
13 2     2   21193234 use strict;
  2         15  
  2         73  
14 2     2   16 use parent qw( Net::API::Stripe::Generic );
  2         3  
  2         14  
15 2     2   1291 our( $VERSION ) = 'v0.1.0';
16             };
17              
18 0     0 1   sub id { return( shift->_set_get_scalar( 'id', @_ ) ); }
19              
20 0     0 1   sub object { return( shift->_set_get_scalar( 'object', @_ ) ); }
21              
22 0     0 1   sub active_features { return( shift->_set_get_array( 'active_features', @_ ) ); }
23              
24 0     0 1   sub balance { return( shift->_set_get_class( 'balance',
25             {
26             cash => { type => "hash" },
27             inbound_pending => { type => "hash" },
28             outbound_pending => { type => "hash" },
29             }, @_ ) ); }
30              
31 0     0 1   sub country { return( shift->_set_get_scalar( 'country', @_ ) ); }
32              
33 0     0 1   sub created { return( shift->_set_get_datetime( 'created', @_ ) ); }
34              
35 0     0 1   sub features { return( shift->_set_get_class( 'features',
36             {
37             card_issuing => {
38             package => "Net::API::Stripe::Connect::Account::Capability",
39             type => "object",
40             },
41             deposit_insurance => {
42             package => "Net::API::Stripe::Connect::Account::Capability",
43             type => "object",
44             },
45             financial_addresses => {
46             definition => {
47             aba => {
48             package => "Net::API::Stripe::Connect::Account::Capability",
49             type => "object",
50             },
51             },
52             type => "class",
53             },
54             inbound_transfers => {
55             definition => {
56             ach => {
57             package => "Net::API::Stripe::Connect::Account::Capability",
58             type => "object",
59             },
60             },
61             type => "class",
62             },
63             intra_stripe_flows => {
64             package => "Net::API::Stripe::Connect::Account::Capability",
65             type => "object",
66             },
67             object => { type => "scalar" },
68             outbound_payments => {
69             definition => {
70             ach => {
71             package => "Net::API::Stripe::Connect::Account::Capability",
72             type => "object",
73             },
74             us_domestic_wire => {
75             package => "Net::API::Stripe::Connect::Account::Capability",
76             type => "object",
77             },
78             },
79             type => "class",
80             },
81             outbound_transfers => {
82             definition => {
83             ach => {
84             package => "Net::API::Stripe::Connect::Account::Capability",
85             type => "object",
86             },
87             us_domestic_wire => {
88             package => "Net::API::Stripe::Connect::Account::Capability",
89             type => "object",
90             },
91             },
92             type => "class",
93             },
94             }, @_ ) ); }
95              
96 0     0 1   sub financial_addresses { return( shift->_set_get_class_array( 'financial_addresses',
97             {
98             aba => {
99             package => "Net::API::Stripe::Connect::ExternalAccount::Bank",
100             type => "object",
101             },
102             supported_networks => { type => "array" },
103             type => { type => "scalar" },
104             }, @_ ) ); }
105              
106 0     0 1   sub livemode { return( shift->_set_get_boolean( 'livemode', @_ ) ); }
107              
108 0     0 1   sub metadata { return( shift->_set_get_hash( 'metadata', @_ ) ); }
109              
110 0     0 1   sub pending_features { return( shift->_set_get_array( 'pending_features', @_ ) ); }
111              
112 0     0 1   sub platform_restrictions { return( shift->_set_get_class( 'platform_restrictions',
113             {
114             inbound_flows => { type => "scalar" },
115             outbound_flows => { type => "scalar" },
116             }, @_ ) ); }
117              
118 0     0 1   sub restricted_features { return( shift->_set_get_array( 'restricted_features', @_ ) ); }
119              
120 0     0 1   sub status { return( shift->_set_get_scalar( 'status', @_ ) ); }
121              
122 0     0 1   sub status_details { return( shift->_set_get_object( 'status_details', 'Net::API::Stripe::Billing::Invoice', @_ ) ); }
123              
124 0     0 1   sub supported_currencies { return( shift->_set_get_array( 'supported_currencies', @_ ) ); }
125              
126             1;
127             # NOTE: POD
128             __END__
129              
130             =encoding utf8
131              
132             =head1 NAME
133              
134             Net::API::Stripe::Treasury::FinancialAccount - The FinancialAccount object
135              
136             =head1 SYNOPSIS
137              
138             =head1 VERSION
139              
140             v0.1.0
141              
142             =head1 DESCRIPTION
143              
144             Stripe Treasury provides users with a container for money called a FinancialAccount that is separate from their Payments balance. FinancialAccounts serve as the source and destination of Treasury’s money movement APIs.
145              
146             =head1 METHODS
147              
148             =head2 id string
149              
150             Unique identifier for the object.
151              
152             =head2 object string
153              
154             String representing the object's type. Objects of the same type share the same value.
155              
156             =head2 active_features array
157              
158             The array of paths to active Features in the Features hash.
159              
160             =head2 balance hash
161              
162             The single multi-currency balance of the FinancialAccount. Positive values represent money that belongs to the user while negative values represent funds the user owes. Currently, FinancialAccounts can only carry balances in USD.
163              
164             It has the following properties:
165              
166             =over 4
167              
168             =item C<cash> hash
169              
170             Funds the user can spend right now.
171              
172             =item C<inbound_pending> hash
173              
174             Funds not spendable yet, but will become available at a later time.
175              
176             =item C<outbound_pending> hash
177              
178             Funds in the account, but not spendable because they are being held for pending outbound flows.
179              
180             =back
181              
182             =head2 country string
183              
184             Two-letter country code (L<ISO 3166-1 alpha-2|https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)>.
185              
186             =head2 created timestamp
187              
188             Time at which the object was created. Measured in seconds since the Unix epoch.
189              
190             =head2 features hash
191              
192             The features and their statuses for this FinancialAccount.
193              
194             It has the following properties:
195              
196             =over 4
197              
198             =item C<card_issuing> hash
199              
200             Contains a Feature encoding the FinancialAccount's ability to be used with the Issuing product, including attaching cards to and drawing funds from.
201              
202             When expanded, this is a L<Net::API::Stripe::Connect::Account::Capability> object.
203              
204             =item C<deposit_insurance> hash
205              
206             Represents whether this FinancialAccount is eligible for deposit insurance. Various factors determine the insurance amount.
207              
208             When expanded, this is a L<Net::API::Stripe::Connect::Account::Capability> object.
209              
210             =item C<financial_addresses> hash
211              
212             Contains Features that add FinancialAddresses to the FinancialAccount.
213              
214             =over 8
215              
216             =item C<aba> hash
217              
218             Adds an ABA FinancialAddress to the FinancialAccount.
219              
220             When expanded, this is a L<Net::API::Stripe::Connect::Account::Capability> object.
221              
222              
223             =back
224              
225             =item C<inbound_transfers> hash
226              
227             Contains settings related to adding funds to a FinancialAccount from another Account with the same owner.
228              
229             =over 8
230              
231             =item C<ach> hash
232              
233             Enables ACH Debits via the InboundTransfers API.
234              
235             When expanded, this is a L<Net::API::Stripe::Connect::Account::Capability> object.
236              
237              
238             =back
239              
240             =item C<intra_stripe_flows> hash
241              
242             Represents the ability for this FinancialAccount to send money to, or receive money from other FinancialAccounts (for example, via OutboundPayment).
243              
244             When expanded, this is a L<Net::API::Stripe::Connect::Account::Capability> object.
245              
246             =item C<object> string
247              
248             String representing the object's type. Objects of the same type share the same value.
249              
250             =item C<outbound_payments> hash
251              
252             Contains Features related to initiating money movement out of the FinancialAccount to someone else's bucket of money.
253              
254             =over 8
255              
256             =item C<ach> hash
257              
258             Enables ACH transfers via the OutboundPayments API.
259              
260             When expanded, this is a L<Net::API::Stripe::Connect::Account::Capability> object.
261              
262             =item C<us_domestic_wire> hash
263              
264             Enables US domestic wire tranfers via the OutboundPayments API.
265              
266             When expanded, this is a L<Net::API::Stripe::Connect::Account::Capability> object.
267              
268              
269             =back
270              
271             =item C<outbound_transfers> hash
272              
273             Contains a Feature and settings related to moving money out of the FinancialAccount into another Account with the same owner.
274              
275             =over 8
276              
277             =item C<ach> hash
278              
279             Enables ACH transfers via the OutboundTransfers API.
280              
281             When expanded, this is a L<Net::API::Stripe::Connect::Account::Capability> object.
282              
283             =item C<us_domestic_wire> hash
284              
285             Enables US domestic wire tranfers via the OutboundTransfers API.
286              
287             When expanded, this is a L<Net::API::Stripe::Connect::Account::Capability> object.
288              
289              
290             =back
291              
292             =back
293              
294             =head2 financial_addresses array of hash
295              
296             The set of credentials that resolve to a FinancialAccount.
297              
298             It has the following properties:
299              
300             =over 4
301              
302             =item C<aba> hash
303              
304             Identifying information for the ABA address
305              
306             When expanded, this is a L<Net::API::Stripe::Connect::ExternalAccount::Bank> object.
307              
308             =item C<supported_networks> array
309              
310             The list of networks that the address supports
311              
312             =item C<type> string
313              
314             The type of financial address
315              
316             =back
317              
318             =head2 livemode boolean
319              
320             Has the value C<true> if the object exists in live mode or the value C<false> if the object exists in test mode.
321              
322             =head2 metadata hash
323              
324             Set of L<key-value pairs|https://stripe.com/docs/api/metadata> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
325              
326             =head2 pending_features array
327              
328             The array of paths to pending Features in the Features hash.
329              
330             =head2 platform_restrictions hash
331              
332             The set of functionalities that the platform can restrict on the FinancialAccount.
333              
334             It has the following properties:
335              
336             =over 4
337              
338             =item C<inbound_flows> string
339              
340             Restricts all inbound money movement.
341              
342             =item C<outbound_flows> string
343              
344             Restricts all outbound money movement.
345              
346             =back
347              
348             =head2 restricted_features array
349              
350             The array of paths to restricted Features in the Features hash.
351              
352             =head2 status string
353              
354             The enum specifying what state the account is in.
355              
356             =head2 status_details object
357              
358             Details related to the status of this FinancialAccount.
359              
360             This is a L<Net::API::Stripe::Billing::Invoice> object.
361              
362             =head2 supported_currencies array
363              
364             The currencies the FinancialAccount can hold a balance in. Three-letter L<ISO currency code|https://www.iso.org/iso-4217-currency-codes.html>, in lowercase.
365              
366             =head1 API SAMPLE
367              
368             [
369             {
370             "active_features" : [
371             "financial_addresses.aba",
372             "outbound_payments.ach",
373             "outbound_payments.us_domestic_wire"
374             ],
375             "balance" : {
376             "cash" : {
377             "usd" : "0"
378             },
379             "inbound_pending" : {
380             "usd" : "0"
381             },
382             "outbound_pending" : {
383             "usd" : "0"
384             }
385             },
386             "country" : "US",
387             "created" : "1662261085",
388             "financial_addresses" : [
389             {
390             "aba" : {
391             "account_holder_name" : "Jenny Rosen",
392             "account_number_last4" : "7890",
393             "bank_name" : "STRIPE TEST BANK",
394             "routing_number" : "0000000001"
395             },
396             "supported_networks" : [
397             "ach",
398             "us_domestic_wire"
399             ],
400             "type" : "aba"
401             }
402             ],
403             "id" : "fa_1Le9F32eZvKYlo2CjbQcDQUE",
404             "livemode" : 1,
405             "metadata" : null,
406             "object" : "treasury.financial_account",
407             "pending_features" : [],
408             "restricted_features" : [],
409             "status" : "open",
410             "status_details" : {
411             "closed" : null
412             },
413             "supported_currencies" : [
414             "usd"
415             ]
416             }
417             ]
418              
419             =head1 HISTORY
420              
421             =head2 v0.1.0
422              
423             Initial version
424              
425             =head1 AUTHOR
426              
427             Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
428              
429             =head1 SEE ALSO
430              
431             L<Stripe API documentation|https://stripe.com/docs/api/treasury/financial_accounts>
432              
433             =head1 COPYRIGHT & LICENSE
434              
435             Copyright (c) 2019-2022 DEGUEST Pte. Ltd.
436              
437             You can use, copy, modify and redistribute this package and associated
438             files under the same terms as Perl itself.
439              
440             =cut