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             BEGIN
12             {
13             use strict;
14 3     3   24123891 use warnings;
  3         16  
  3         93  
15 3     3   19 use parent qw( Net::API::Stripe::Generic );
  3         8  
  3         97  
16 3     3   17 use vars qw( $VERSION );
  3         5  
  3         18  
17 3     3   348 our( $VERSION ) = 'v0.100.0';
  3         9  
  3         284  
18 3     3   80 };
19              
20             use strict;
21 3     3   22 use warnings;
  3         7  
  3         82  
22 3     3   25  
  3         6  
  3         1328  
23              
24 0     0 1    
25              
26 0     0 1    
27              
28 0     0 1    
29              
30 0     0 1    
31              
32 0     0 1    
33              
34 0     0 1    
35              
36 0     0 1    
37              
38 0     0 1    
39              
40 0     0 1   1;
41              
42 0     0 1    
43             =encoding utf8
44 0     0 1    
45             =head1 NAME
46 0     0 1    
47             Net::API::Stripe::Connect::ExternalAccount::Bank - A Stripe Bank Account Object
48 0     0 1    
49             =head1 SYNOPSIS
50 0     0 1    
51             my $bank = $stripe->bank_account({
52 0     0 1   account_holder_name => 'Big Corp, Inc',
53             account_holder_type => 'company',
54 0     0 1   bank_name => 'Big Bank, Corp'
55             country => 'us',
56 0     0 1   currency => 'usd',
57             customer => $customer_object,
58             default_for_currency => $stripe->true,
59             fingerprint => 'kshfkjhfkjsjdla',
60             last4 => 1234,
61             metadata => { transaction_id => 2222 },
62             routing_number => 123,
63             status => 'new',
64             });
65              
66             See documentation in L<Net::API::Stripe> for example to make api calls to Stripe to create those objects. For example:
67              
68             my $stripe = Net::API::Stripe->new( conf_file => 'settings.json' ) | die( Net::API::Stripe->error );
69             my $stripe_bank = $stripe->bank_accounts( create =>
70             {
71             account => 'acct_fake123456789',
72             external_account =>
73             {
74             object => 'bank_account',
75             country => 'jp',
76             currency => 'jpy',
77             account_number => '012345678',
78             },
79             default_for_currency => $stripe->true,
80             metadata => { transaction_id => 123, customer_id => 456 },
81             }) || die( $stripe->error );
82              
83             =head1 VERSION
84              
85             v0.100.0
86              
87             =head1 DESCRIPTION
88              
89             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.
90              
91             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.
92              
93             =head1 CONSTRUCTOR
94              
95             =head2 new( %ARG )
96              
97             Creates a new L<Net::API::Stripe::Connect::ExternalAccount::Bank> object.
98             It may also take an hash like arguments, that also are method of the same name.
99              
100             =head1 METHODS
101              
102             =head2 id string
103              
104             Unique identifier for the object.
105              
106             =head2 object string, value is "bank_account"
107              
108             String representing the object’s type. Objects of the same type share the same value.
109              
110             =head2 account string (expandable)
111              
112             When expanded, this is a L<Net::API::Stripe::Connect::Account> object.
113              
114             =head2 account_holder_name string
115              
116             The name of the person or business that owns the bank account.
117              
118             =head2 account_holder_type string
119              
120             The type of entity that holds the account. This can be either individual or company.
121              
122             =head2 account_type string
123              
124             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>.
125              
126             =head2 available_payout_methods array
127              
128             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.
129              
130             =head2 bank_name string
131              
132             Name of the bank associated with the routing number (e.g., WELLS FARGO).
133              
134             =head2 country string
135              
136             Two-letter ISO code representing the country the bank account is located in.
137              
138             =head2 currency currency
139              
140             Three-letter ISO code for the currency paid out to the bank account.
141              
142             =head2 customer string (expandable)
143              
144             When expanded, this is a L<Net::API::Stripe::Customer> object.
145              
146             =head2 default_for_currency boolean
147              
148             Whether this bank account is the default external account for its currency.
149              
150             =head2 fingerprint string
151              
152             Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.
153              
154             =head2 last4 string
155              
156             The last four digits of the bank account number.
157              
158             =head2 metadata hash
159              
160             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.
161              
162             =head2 routing_number string
163              
164             The routing transit number for the bank account.
165              
166             =head2 status string
167              
168             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.
169              
170             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.
171              
172             =head1 API SAMPLE
173              
174             {
175             "id": "ba_fake123456789",
176             "object": "bank_account",
177             "account": "acct_fake123456789",
178             "account_holder_name": "Jane Austen",
179             "account_holder_type": "individual",
180             "bank_name": "STRIPE TEST BANK",
181             "country": "US",
182             "currency": "jpy",
183             "fingerprint": "ksfkhfkjcchjkn",
184             "last4": "6789",
185             "metadata": {},
186             "routing_number": "110000000",
187             "status": "new"
188             }
189              
190             =head1 HISTORY
191              
192             =head2 v0.1
193              
194             Initial version
195              
196             =head1 STRIPE HISTORY
197              
198             =head2 2018-01-23
199              
200             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.
201              
202             =head1 AUTHOR
203              
204             Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
205              
206             =head1 SEE ALSO
207              
208             Stripe API documentation:
209              
210             L<https://stripe.com/docs/api/external_account_bank_accounts/object>, L<https://stripe.com/docs/connect/payouts>
211              
212             =head1 COPYRIGHT & LICENSE
213              
214             Copyright (c) 2019-2020 DEGUEST Pte. Ltd.
215              
216             You can use, copy, modify and redistribute this package and associated
217             files under the same terms as Perl itself.
218              
219             =cut