File Coverage

lib/Net/API/Stripe/Treasury/OutboundTransfer.pm
Criterion Covered Total %
statement 7 26 26.9
branch n/a
condition n/a
subroutine 3 22 13.6
pod 19 19 100.0
total 29 67 43.2


line stmt bran cond sub pod time code
1             ##----------------------------------------------------------------------------
2             ## Stripe API - ~/lib/Net/API/Stripe/Treasury/OutboundTransfer.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::OutboundTransfer;
11             BEGIN
12             {
13 2     2   21370453 use strict;
  2         16  
  2         74  
14 2     2   12 use parent qw( Net::API::Stripe::Generic );
  2         4  
  2         11  
15 2     2   1051 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 amount { return( shift->_set_get_number( 'amount', @_ ) ); }
23              
24 0     0 1   sub cancelable { return( shift->_set_get_boolean( 'cancelable', @_ ) ); }
25              
26 0     0 1   sub created { return( shift->_set_get_datetime( 'created', @_ ) ); }
27              
28 0     0 1   sub currency { return( shift->_set_get_number( 'currency', @_ ) ); }
29              
30 0     0 1   sub description { return( shift->_set_get_scalar( 'description', @_ ) ); }
31              
32 0     0 1   sub destination_payment_method { return( shift->_set_get_scalar( 'destination_payment_method', @_ ) ); }
33              
34 0     0 1   sub destination_payment_method_details { return( shift->_set_get_object( 'destination_payment_method_details', 'Net::API::Stripe::Payment::Method', @_ ) ); }
35              
36 0     0 1   sub expected_arrival_date { return( shift->_set_get_datetime( 'expected_arrival_date', @_ ) ); }
37              
38 0     0 1   sub financial_account { return( shift->_set_get_scalar( 'financial_account', @_ ) ); }
39              
40 0     0 1   sub hosted_regulatory_receipt_url { return( shift->_set_get_scalar( 'hosted_regulatory_receipt_url', @_ ) ); }
41              
42 0     0 1   sub livemode { return( shift->_set_get_boolean( 'livemode', @_ ) ); }
43              
44 0     0 1   sub metadata { return( shift->_set_get_hash( 'metadata', @_ ) ); }
45              
46 0     0 1   sub returned_details { return( shift->_set_get_class( 'returned_details',
47             {
48             code => { type => "scalar" },
49             transaction => {
50             package => "Net::API::Stripe::Treasury::Transaction",
51             type => "scalar_or_object",
52             },
53             }, @_ ) ); }
54              
55 0     0 1   sub statement_descriptor { return( shift->_set_get_scalar( 'statement_descriptor', @_ ) ); }
56              
57 0     0 1   sub status { return( shift->_set_get_scalar( 'status', @_ ) ); }
58              
59 0     0 1   sub status_transitions { return( shift->_set_get_class( 'status_transitions',
60             {
61             canceled_at => { type => "datetime" },
62             failed_at => { type => "datetime" },
63             posted_at => { type => "datetime" },
64             returned_at => { type => "datetime" },
65             }, @_ ) ); }
66              
67 0     0 1   sub transaction { return( shift->_set_get_scalar_or_object( 'transaction', 'Net::API::Stripe::Treasury::Transaction', @_ ) ); }
68              
69             1;
70             # NOTE: POD
71             __END__
72              
73             =encoding utf8
74              
75             =head1 NAME
76              
77             Net::API::Stripe::Treasury::OutboundTransfer - The OutboundTransfer object
78              
79             =head1 SYNOPSIS
80              
81             =head1 VERSION
82              
83             v0.1.0
84              
85             =head1 DESCRIPTION
86              
87             Use OutboundTransfers to transfer funds from a L<FinancialAccount|https://stripe.com/docs/api/treasury/financial_accounts> to a PaymentMethod belonging to the same entity. To send funds to a different party, use L<OutboundPayments|https://stripe.com/docs/api/treasury/outbound_payments> instead. You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account.
88              
89             Simulate OutboundTransfer state changes with the C</v1/test_helpers/treasury/outbound_transfers> endpoints. These methods can only be called on test mode objects.
90              
91             =head1 METHODS
92              
93             =head2 id string
94              
95             Unique identifier for the object.
96              
97             =head2 object string
98              
99             String representing the object's type. Objects of the same type share the same value.
100              
101             =head2 amount integer
102              
103             Amount (in cents) transferred.
104              
105             =head2 cancelable boolean
106              
107             Returns C<true> if the object can be canceled, and C<false> otherwise.
108              
109             =head2 created timestamp
110              
111             Time at which the object was created. Measured in seconds since the Unix epoch.
112              
113             =head2 currency currency
114              
115             Three-letter L<ISO currency code|https://www.iso.org/iso-4217-currency-codes.html>, in lowercase. Must be a L<supported currency|https://stripe.com/docs/currencies>.
116              
117             =head2 description string
118              
119             An arbitrary string attached to the object. Often useful for displaying to users.
120              
121             =head2 destination_payment_method string
122              
123             The PaymentMethod used as the payment instrument for an OutboundTransfer.
124              
125             =head2 destination_payment_method_details object
126              
127             Details about the PaymentMethod for an OutboundTransfer
128              
129             This is a L<Net::API::Stripe::Payment::Method> object.
130              
131             =head2 expected_arrival_date timestamp
132              
133             The date when funds are expected to arrive in the destination account.
134              
135             =head2 financial_account string
136              
137             The FinancialAccount that funds were pulled from.
138              
139             =head2 hosted_regulatory_receipt_url string
140              
141             A L<hosted transaction receipt|https://stripe.com/docs/treasury/moving-money/regulatory-receipts> URL that is provided when money movement is considered regulated under Stripe's money transmission licenses.
142              
143             =head2 livemode boolean
144              
145             Has the value C<true> if the object exists in live mode or the value C<false> if the object exists in test mode.
146              
147             =head2 metadata hash
148              
149             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.
150              
151             =head2 returned_details hash
152              
153             Details about a returned OutboundTransfer. Only set when the status is C<returned>.
154              
155             It has the following properties:
156              
157             =over 4
158              
159             =item C<code> string
160              
161             Reason for the return.
162              
163             =item C<transaction> string expandable
164              
165             The Transaction associated with this object.
166              
167             When expanded this is an L<Net::API::Stripe::Treasury::Transaction> object.
168              
169             =back
170              
171             =head2 statement_descriptor string
172              
173             Information about the OutboundTransfer to be sent to the recipient account.
174              
175             =head2 status string
176              
177             Current status of the OutboundTransfer: C<processing>, C<failed>, C<canceled>, C<posted>, C<returned>. An OutboundTransfer is C<processing> if it has been created and is pending. The status changes to C<posted> once the OutboundTransfer has been "confirmed" and funds have left the account, or to C<failed> or C<canceled>. If an OutboundTransfer fails to arrive at its destination, its status will change to C<returned>.
178              
179             =head2 status_transitions hash
180              
181             Hash containing timestamps of when the object transitioned to a particular C<status>.
182              
183             It has the following properties:
184              
185             =over 4
186              
187             =item C<canceled_at> timestamp
188              
189             Timestamp describing when an OutboundTransfer changed status to C<canceled>
190              
191             =item C<failed_at> timestamp
192              
193             Timestamp describing when an OutboundTransfer changed status to C<failed>
194              
195             =item C<posted_at> timestamp
196              
197             Timestamp describing when an OutboundTransfer changed status to C<posted>
198              
199             =item C<returned_at> timestamp
200              
201             Timestamp describing when an OutboundTransfer changed status to C<returned>
202              
203             =back
204              
205             =head2 transaction expandable
206              
207             The Transaction associated with this object.
208              
209             When expanded this is an L<Net::API::Stripe::Treasury::Transaction> object.
210              
211             =head1 API SAMPLE
212              
213             [
214             {
215             "amount" : "10000",
216             "cancelable" : 1,
217             "created" : "1662261085",
218             "currency" : "usd",
219             "description" : "OutboundTransfer to my external bank account",
220             "destination_payment_method" : "pm_1Le9F32eZvKYlo2CpHGQxg2C",
221             "destination_payment_method_details" : {
222             "billing_details" : {
223             "address" : {
224             "city" : "San Francisco",
225             "country" : "US",
226             "line1" : "1234 Fake Street",
227             "line2" : null,
228             "postal_code" : "94102",
229             "state" : "CA"
230             },
231             "email" : null,
232             "name" : "Jane Austen"
233             },
234             "type" : "us_bank_account",
235             "us_bank_account" : {
236             "account_holder_type" : "company",
237             "account_type" : "checking",
238             "bank_name" : "STRIPE TEST BANK",
239             "fingerprint" : "1JWtPxqbdX5Gamtc",
240             "last4" : "6789",
241             "network" : "ach",
242             "routing_number" : "110000000"
243             }
244             },
245             "expected_arrival_date" : "1662422400",
246             "financial_account" : "fa_1Le9F32eZvKYlo2CjbQcDQUE",
247             "hosted_regulatory_receipt_url" : "https://payments.stripe.com/regulatory-receipt/CBQaFwoVYWNjdF8xMDMyRDgyZVp2S1lsbzJDKN6u0JgGMgYg10dl2l46NpNi7-U4RHGRK4gmazw1MJMHmoXQhqSVwlK_KfXIpam3FgzagG7PLAcDtvccPlM_sJNFGTBUBQ",
248             "id" : "obt_1Le9F32eZvKYlo2CPQD5jo2F",
249             "livemode" : 0,
250             "metadata" : {},
251             "object" : "treasury.outbound_transfer",
252             "returned_details" : null,
253             "statement_descriptor" : "transfer",
254             "status" : "processing",
255             "status_transitions" : {
256             "canceled_at" : null,
257             "failed_at" : null,
258             "posted_at" : null,
259             "returned_at" : null
260             },
261             "transaction" : "trxn_1Le9F32eZvKYlo2C2dtkse82"
262             }
263             ]
264              
265             =head1 HISTORY
266              
267             =head2 v0.1.0
268              
269             Initial version
270              
271             =head1 AUTHOR
272              
273             Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
274              
275             =head1 SEE ALSO
276              
277             L<Stripe API documentation|https://stripe.com/docs/api/treasury/outbound_transfers>
278              
279             =head1 COPYRIGHT & LICENSE
280              
281             Copyright (c) 2019-2022 DEGUEST Pte. Ltd.
282              
283             You can use, copy, modify and redistribute this package and associated
284             files under the same terms as Perl itself.
285              
286             =cut