File Coverage

lib/Net/API/Stripe/Connect/ExternalAccount/Bank.pm
Criterion Covered Total %
statement 19 36 52.7
branch n/a
condition n/a
subroutine 7 24 29.1
pod 17 17 100.0
total 43 77 55.8


line stmt bran cond sub pod time code
1             ##----------------------------------------------------------------------------
2             ## Stripe API - ~/lib/Net/API/Stripe/Connect/ExternalAccount/Bank.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             ## https://stripe.com/docs/api/external_account_bank_accounts/object
11             package Net::API::Stripe::Connect::ExternalAccount::Bank;
12             BEGIN
13             {
14 3     3   21348451 use strict;
  3         17  
  3         149  
15 3     3   17 use warnings;
  3         6  
  3         98  
16 3     3   20 use parent qw( Net::API::Stripe::Generic );
  3         6  
  3         19  
17 3     3   218 use vars qw( $VERSION );
  3         8  
  3         184  
18 3     3   62 our( $VERSION ) = 'v0.100.0';
19             };
20              
21 3     3   16 use strict;
  3         7  
  3         63  
22 3     3   17 use warnings;
  3         6  
  3         1144  
23              
24 0     0 1   sub id { return( shift->_set_get_scalar( 'id', @_ ) ); }
25              
26 0     0 1   sub object { return( shift->_set_get_scalar( 'object', @_ ) ); }
27              
28 0     0 1   sub account { return( shift->_set_get_scalar_or_object( 'account', 'Net::API::Stripe::Connect::Account', @_ ) ); }
29              
30 0     0 1   sub account_holder_name { return( shift->_set_get_scalar( 'account_holder_name', @_ ) ); }
31              
32 0     0 1   sub account_holder_type { return( shift->_set_get_scalar( 'account_holder_type', @_ ) ); }
33              
34 0     0 1   sub account_type { return( shift->_set_get_scalar( 'account_type', @_ ) ); }
35              
36 0     0 1   sub available_payout_methods { return( shift->_set_get_array( 'available_payout_methods', @_ ) ); }
37              
38 0     0 1   sub bank_name { return( shift->_set_get_scalar( 'bank_name', @_ ) ); }
39              
40 0     0 1   sub country { return( shift->_set_get_scalar( 'country', @_ ) ); }
41              
42 0     0 1   sub currency { return( shift->_set_get_scalar( 'currency', @_ ) ); }
43              
44 0     0 1   sub customer { return( shift->_set_get_scalar_or_object( 'customer', 'Net::API::Stripe::Customer', @_ ) ); }
45              
46 0     0 1   sub default_for_currency { return( shift->_set_get_boolean( 'default_for_currency', @_ ) ); }
47              
48 0     0 1   sub fingerprint { return( shift->_set_get_scalar( 'fingerprint', @_ ) ); }
49              
50 0     0 1   sub last4 { return( shift->_set_get_scalar( 'last4', @_ ) ); }
51              
52 0     0 1   sub metadata { return( shift->_set_get_hash( 'metadata', @_ ) ); }
53              
54 0     0 1   sub routing_number { return( shift->_set_get_scalar( 'routing_number', @_ ) ); }
55              
56 0     0 1   sub status { return( shift->_set_get_scalar( 'status', @_ ) ); }
57              
58             1;
59              
60             __END__
61              
62             =encoding utf8
63              
64             =head1 NAME
65              
66             Net::API::Stripe::Connect::ExternalAccount::Bank - A Stripe Bank Account Object
67              
68             =head1 SYNOPSIS
69              
70             my $bank = $stripe->bank_account({
71             account_holder_name => 'Big Corp, Inc',
72             account_holder_type => 'company',
73             bank_name => 'Big Bank, Corp'
74             country => 'us',
75             currency => 'usd',
76             customer => $customer_object,
77             default_for_currency => $stripe->true,
78             fingerprint => 'kshfkjhfkjsjdla',
79             last4 => 1234,
80             metadata => { transaction_id => 2222 },
81             routing_number => 123,
82             status => 'new',
83             });
84              
85             See documentation in L<Net::API::Stripe> for example to make api calls to Stripe to create those objects. For example:
86              
87             my $stripe = Net::API::Stripe->new( conf_file => 'settings.json' ) | die( Net::API::Stripe->error );
88             my $stripe_bank = $stripe->bank_accounts( create =>
89             {
90             account => 'acct_fake123456789',
91             external_account =>
92             {
93             object => 'bank_account',
94             country => 'jp',
95             currency => 'jpy',
96             account_number => '012345678',
97             },
98             default_for_currency => $stripe->true,
99             metadata => { transaction_id => 123, customer_id => 456 },
100             }) || die( $stripe->error );
101              
102             =head1 VERSION
103              
104             v0.100.0
105              
106             =head1 DESCRIPTION
107              
108             These External Accounts are transfer destinations on Account objects for Custom accounts (L<https://stripe.com/docs/connect/custom-accounts>). They can be bank accounts or debit cards.
109              
110             Bank accounts (L<https://stripe.com/docs/api#customer_bank_account_object>) and debit cards (L<https://stripe.com/docs/api#card_object>) can also be used as payment sources on regular charges, and are documented in the links above.
111              
112             =head1 CONSTRUCTOR
113              
114             =head2 new( %ARG )
115              
116             Creates a new L<Net::API::Stripe::Connect::ExternalAccount::Bank> object.
117             It may also take an hash like arguments, that also are method of the same name.
118              
119             =head1 METHODS
120              
121             =head2 id string
122              
123             Unique identifier for the object.
124              
125             =head2 object string, value is "bank_account"
126              
127             String representing the object’s type. Objects of the same type share the same value.
128              
129             =head2 account string (expandable)
130              
131             When expanded, this is a L<Net::API::Stripe::Connect::Account> object.
132              
133             =head2 account_holder_name string
134              
135             The name of the person or business that owns the bank account.
136              
137             =head2 account_holder_type string
138              
139             The type of entity that holds the account. This can be either individual or company.
140              
141             =head2 account_type string
142              
143             The bank account type. This can only be C<checking> or C<savings> in most countries. In Japan, this can only be C<futsu> or C<toza>.
144              
145             =head2 available_payout_methods array
146              
147             A set of available payout methods for this bank account. Only values from this set should be passed as the method when creating a payout.
148              
149             =head2 bank_name string
150              
151             Name of the bank associated with the routing number (e.g., WELLS FARGO).
152              
153             =head2 country string
154              
155             Two-letter ISO code representing the country the bank account is located in.
156              
157             =head2 currency currency
158              
159             Three-letter ISO code for the currency paid out to the bank account.
160              
161             =head2 customer string (expandable)
162              
163             When expanded, this is a L<Net::API::Stripe::Customer> object.
164              
165             =head2 default_for_currency boolean
166              
167             Whether this bank account is the default external account for its currency.
168              
169             =head2 fingerprint string
170              
171             Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.
172              
173             =head2 last4 string
174              
175             The last four digits of the bank account number.
176              
177             =head2 metadata hash
178              
179             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.
180              
181             =head2 routing_number string
182              
183             The routing transit number for the bank account.
184              
185             =head2 status string
186              
187             For bank accounts, possible values are C<new>, C<validated>, C<verified>, C<verification_failed>, or C<errored>. A bank account that hasn’t had any activity or validation performed is C<new>. If Stripe can determine that the bank account exists, its status will be C<validated>. Note that there often isn’t enough information to know (e.g., for smaller credit unions), and the validation is not always run. If customer bank account verification has succeeded, the bank account status will be C<verified>. If the verification failed for any reason, such as microdeposit failure, the status will be C<verification_failed>. If a transfer sent to this bank account fails, we’ll set the status to C<errored> and will not continue to send transfers until the bank details are updated.
188              
189             For external accounts, possible values are C<new> and C<errored>. Validations aren’t run against external accounts because they’re only used for payouts. This means the other statuses don’t apply. If a transfer fails, the status is set to C<errored> and transfers are stopped until account details are updated.
190              
191             =head1 API SAMPLE
192              
193             {
194             "id": "ba_fake123456789",
195             "object": "bank_account",
196             "account": "acct_fake123456789",
197             "account_holder_name": "Jane Austen",
198             "account_holder_type": "individual",
199             "bank_name": "STRIPE TEST BANK",
200             "country": "US",
201             "currency": "jpy",
202             "fingerprint": "ksfkhfkjcchjkn",
203             "last4": "6789",
204             "metadata": {},
205             "routing_number": "110000000",
206             "status": "new"
207             }
208              
209             =head1 HISTORY
210              
211             =head2 v0.1
212              
213             Initial version
214              
215             =head1 STRIPE HISTORY
216              
217             =head2 2018-01-23
218              
219             When being viewed by a platform, cards and bank accounts created on behalf of connected accounts will have a fingerprint that is universal across all connected accounts. For accounts that are not connect platforms, there will be no change.
220              
221             =head1 AUTHOR
222              
223             Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
224              
225             =head1 SEE ALSO
226              
227             Stripe API documentation:
228              
229             L<https://stripe.com/docs/api/external_account_bank_accounts/object>, L<https://stripe.com/docs/connect/payouts>
230              
231             =head1 COPYRIGHT & LICENSE
232              
233             Copyright (c) 2019-2020 DEGUEST Pte. Ltd.
234              
235             You can use, copy, modify and redistribute this package and associated
236             files under the same terms as Perl itself.
237              
238             =cut