File Coverage

blib/lib/Net/API/Stripe/Connect/ExternalAccount/Bank.pm
Criterion Covered Total %
statement 7 22 31.8
branch n/a
condition n/a
subroutine 3 18 16.6
pod 15 15 100.0
total 25 55 45.4


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