Stripe/Payout.pm

filter: Statementstmt 28.5% 8 / 28 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 13.0% 3 / 23 Podpod 100% 20 / 20 totaltotal 43.6% 31 / 71 CC 1 SCAR 6.3
CC
1
Cov
29%
id
2.0
object
2.0
amount
2.0
CRAP 1.9
« Stripe/Issuing/Card.pm ↑ Summary Stripe/Payment/Method/Details.pm »
1 ##----------------------------------------------------------------------------
2 ## Stripe API - ~/lib/Net/API/Stripe/Payout.pm
3 ## Version v0.100.0
4 ## Copyright(c) 2020 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/payouts
11 package Net::API::Stripe::Payout;
12 BEGIN
13 {
14 1 ▶ use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 1 ▶ use parent qw( Net::API::Stripe::Generic );
Subroutine BEGIN: called CC=1 SCAR=0.0
16 1 ▶ our( $VERSION ) = 'v0.100.0';
Subroutine BEGIN: called CC=1 SCAR=0.0
17 };
18  
19 0 ▶sub id { shift->_set_get_scalar( 'id', @_ ); }
Subroutine id: not called CC=1 SCAR=6.9
Pod documented
20  
21 0 ▶sub object { shift->_set_get_scalar( 'object', @_ ); }
Subroutine object: not called CC=1 SCAR=6.9
Pod documented
22  
23 0 ▶sub amount { shift->_set_get_number( 'amount', @_ ); }
Subroutine amount: not called CC=1 SCAR=6.9
Pod documented
24  
25 0 ▶sub arrival_date { shift->_set_get_datetime( 'arrival_date', @_ ); }
Subroutine arrival_date: not called CC=1 SCAR=6.9
Pod documented
26  
27 0 ▶sub automatic { shift->_set_get_boolean( 'automatic', @_ ); }
Subroutine automatic: not called CC=1 SCAR=6.9
Pod documented
28  
29 0 ▶sub balance_transaction { shift->_set_get_scalar_or_object( 'balance_transaction', 'Net::API::Stripe::Balance::Transaction', @_ ); }
Subroutine balance_transaction: not called CC=1 SCAR=6.9
Pod documented
30  
31 0 ▶sub created { shift->_set_get_datetime( 'created', @_ ); }
Subroutine created: not called CC=1 SCAR=6.9
Pod documented
32  
33 0 ▶sub currency { shift->_set_get_scalar( 'currency', @_ ); }
Subroutine currency: not called CC=1 SCAR=6.9
Pod documented
34  
35 0 ▶sub description { shift->_set_get_scalar( 'description', @_ ); }
Subroutine description: not called CC=1 SCAR=6.9
Pod documented
36  
37 0 ▶sub destination { shift->_set_get_scalar_or_object( 'destination', 'Net::API::Stripe::Connect::Account', @_ ); }
Subroutine destination: not called CC=1 SCAR=6.9
Pod documented
38  
39 0 ▶sub failure_balance_transaction { shift->_set_get_scalar_or_object( 'failure_balance_transaction', 'Net::API::Stripe::Balance::Transaction', @_ ); }
Subroutine failure_balance_transaction: not called CC=1 SCAR=6.9
Pod documented
40  
41 0 ▶sub failure_code { shift->_set_get_scalar( 'failure_code', @_ ); }
Subroutine failure_code: not called CC=1 SCAR=6.9
Pod documented
42  
43 0 ▶sub failure_message { shift->_set_get_scalar( 'failure_message', @_ ); }
Subroutine failure_message: not called CC=1 SCAR=6.9
Pod documented
44  
45 0 ▶sub livemode { shift->_set_get_boolean( 'livemode', @_ ); }
Subroutine livemode: not called CC=1 SCAR=6.9
Pod documented
46  
47 0 ▶sub metadata { shift->_set_get_hash( 'metadata', @_ ); }
Subroutine metadata: not called CC=1 SCAR=6.9
Pod documented
48  
49 0 ▶sub method { shift->_set_get_scalar( 'method', @_ ); }
Subroutine method: not called CC=1 SCAR=6.9
Pod documented
50  
51 0 ▶sub source_type { shift->_set_get_scalar( 'source_type', @_ ); }
Subroutine source_type: not called CC=1 SCAR=6.9
Pod documented
52  
53 0 ▶sub statement_descriptor { shift->_set_get_scalar( 'statement_descriptor', @_ ); }
Subroutine statement_descriptor: not called CC=1 SCAR=6.9
Pod documented
54  
55 0 ▶sub status { shift->_set_get_scalar( 'status', @_ ); }
Subroutine status: not called CC=1 SCAR=6.9
Pod documented
56  
57 0 ▶sub type { shift->_set_get_scalar( 'type', @_ ); }
Subroutine type: not called CC=1 SCAR=6.9
Pod documented
58  
59 1 1;
60  
61 __END__
62  
63 =encoding utf8
64  
65 =head1 NAME
66  
67 Net::API::Stripe::Payout - A Stripe Payout Object
68  
69 =head1 SYNOPSIS
70  
71 my $payout = $stripe->payout({
72 amount => 2000,
73 arrival_date => '2020-04-12',
74 automatic => $stripe->true,
75 currency => 'jpy',
76 description => 'Customer payout',
77 destination => $connect_account_object,
78 livemode => $stripe->false,
79 metadata => { transaction_id => 123, customer_id => 456 },
80 method => 'standard',
81 statement_descriptor => 'Fund raised payout',
82 status => 'pending',
83 type => 'bank_account',
84 });
85  
86 See documentation in L<Net::API::Stripe> for example to make api calls to Stripe to create those objects.
87  
88 =head1 VERSION
89  
90 v0.100.0
91  
92 =head1 DESCRIPTION
93  
94 A Payout object is created when you receive funds from Stripe, or when you initiate a payout to either a bank account or debit card of a connected Stripe account (L<https://stripe.com/docs/connect/payouts>). You can retrieve individual payouts, as well as list all payouts. Payouts are made on varying schedules, depending on your country and industry.
95  
96 =head1 CONSTRUCTOR
97  
98 =over 4
99  
100 =item B<new>( %ARG )
101  
102 Creates a new L<Net::API::Stripe::Payout> object.
103 It may also take an hash like arguments, that also are method of the same name.
104  
105 =back
106  
107 =head1 METHODS
108  
109 =over 4
110  
111 =item B<id> string
112  
113 Unique identifier for the object.
114  
115 =item B<object> string, value is "payout"
116  
117 String representing the object’s type. Objects of the same type share the same value.
118  
119 =item B<amount> integer
120  
121 Amount (in JPY) to be transferred to your bank account or debit card.
122  
123 =item B<arrival_date> timestamp
124  
125 Date the payout is expected to arrive in the bank. This factors in delays like weekends or bank holidays.
126  
127 =item B<automatic> boolean
128  
129 Returns true if the payout was created by an automated payout schedule (L<https://stripe.com/docs/payouts#payout-schedule>), and false if it was requested manually (L<https://stripe.com/docs/payouts#manual-payouts>).
130  
131 =item B<balance_transaction> string (expandable)
132  
133 ID of the balance transaction that describes the impact of this payout on your account balance. This is a string or a L<Net::API::Stripe::Balance::Transaction> object.
134  
135 =item B<created> timestamp
136  
137 Time at which the object was created. Measured in seconds since the Unix epoch.
138  
139 =item B<currency> currency
140  
141 Three-letter ISO currency code (L<https://www.iso.org/iso-4217-currency-codes.html>), in lowercase. Must be a supported currency (L<https://stripe.com/docs/currencies>).
142  
143 =item B<description> string
144  
145 An arbitrary string attached to the object. Often useful for displaying to users.
146  
147 =item B<destination> string expandable card or bank account
148  
149 ID of the bank account or card the payout was sent to. This is a string or a L<Net::API::Stripe::Connect::Account> object.
150  
151 =item B<failure_balance_transaction> string (expandable)
152  
153 If the payout failed or was canceled, this will be the ID of the balance transaction that reversed the initial balance transaction, and puts the funds from the failed payout back in your balance. Alternatively it can also be the L<Net::API::Stripe::Balance::Transaction> object if it was expanded.
154  
155 =item B<failure_code> string
156  
157 Error code explaining reason for payout failure if available. See Types of payout failures (L<https://stripe.com/docs/api#payout_failures>) for a list of failure codes.
158  
159 =item B<failure_message> string
160  
161 Message to user further explaining reason for payout failure if available.
162  
163 =item B<livemode> boolean
164  
165 Has the value true if the object exists in live mode or the value false if the object exists in test mode.
166  
167 =item B<metadata> hash
168  
169 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.
170  
171 =item B<method> string
172  
173 The method used to send this payout, which can be standard or instant. instant is only supported for payouts to debit cards. (See Instant payouts for marketplaces for more information: L<https://stripe.com/blog/instant-payouts-for-marketplaces>)
174  
175 =item B<source_type> string
176  
177 The source balance this payout came from. One of card or bank_account.
178  
179 =item B<statement_descriptor> string
180  
181 Extra information about a payout to be displayed on the user’s bank statement.
182  
183 =item B<status> string
184  
185 Current status of the payout (paid, pending, in_transit, canceled or failed). A payout will be pending until it is submitted to the bank, at which point it becomes in_transit. It will then change to paid if the transaction goes through. If it does not go through successfully, its status will change to failed or canceled.
186  
187 =item B<type> string
188  
189 Can be bank_account or card.
190  
191 =back
192  
193 =head1 API SAMPLE
194  
195 {
196 "id": "po_fake123456789",
197 "object": "payout",
198 "amount": 7712,
199 "arrival_date": 1568851200,
200 "automatic": true,
201 "balance_transaction": "txn_fake123456789",
202 "created": 1568682616,
203 "currency": "jpy",
204 "description": "STRIPE PAYOUT",
205 "destination": "ba_fake123456789",
206 "failure_balance_transaction": null,
207 "failure_code": null,
208 "failure_message": null,
209 "livemode": false,
210 "metadata": {},
211 "method": "standard",
212 "source_type": "card",
213 "statement_descriptor": null,
214 "status": "paid",
215 "type": "bank_account"
216 }
217  
218 =head1 HISTORY
219  
220 =head2 v0.100.0
221  
222 Initial version
223  
224 =head1 STRIPE HISTORY
225  
226 =head2 2017-04-06
227  
228 Splits the Transfer object into Payout and Transfer. The Payout object represents money moving from a Stripe account to an external account (bank or debit card). The Transfer object now only represents money moving between Stripe accounts on a Connect platform. For more details, see L<https://stripe.com/docs/transfer-payout-split>.
229  
230 =head1 AUTHOR
231  
232 Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
233  
234 =head1 SEE ALSO
235  
236 Stripe API documentation:
237  
238 L<https://stripe.com/docs/api/payouts>,
239 L<https://stripe.com/docs/payouts>
240  
241 =head1 COPYRIGHT & LICENSE
242  
243 Copyright (c) 2019-2020 DEGUEST Pte. Ltd.
244  
245 You can use, copy, modify and redistribute this package and associated
246 files under the same terms as Perl itself.
247  
248 =cut
« Stripe/Issuing/Card.pm ↑ Summary Stripe/Payment/Method/Details.pm »