File Coverage

lib/Net/API/Stripe/Treasury/OutboundPayment.pm
Criterion Covered Total %
statement 7 28 25.0
branch n/a
condition n/a
subroutine 3 24 12.5
pod 21 21 100.0
total 31 73 42.4


line stmt bran cond sub pod time code
1             ##----------------------------------------------------------------------------
2             ## Stripe API - ~/lib/Net/API/Stripe/Treasury/OutboundPayment.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::OutboundPayment;
11             BEGIN
12             {
13 2     2   21534293 use strict;
  2         19  
  2         78  
14 2     2   14 use parent qw( Net::API::Stripe::Generic );
  2         7  
  2         12  
15 2     2   1262 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 customer { return( shift->_set_get_scalar( 'customer', @_ ) ); }
31              
32 0     0 1   sub description { return( shift->_set_get_scalar( 'description', @_ ) ); }
33              
34 0     0 1   sub destination_payment_method { return( shift->_set_get_scalar( 'destination_payment_method', @_ ) ); }
35              
36 0     0 1   sub destination_payment_method_details { return( shift->_set_get_class( 'destination_payment_method_details',
37             {
38             billing_details => { package => "Net::API::Stripe::Billing::Details", type => "object" },
39             financial_account => {
40             package => "Net::API::Stripe::Connect::ExternalAccount::Card",
41             type => "object",
42             },
43             type => { type => "scalar" },
44             us_bank_account => {
45             package => "Net::API::Stripe::Connect::ExternalAccount::Bank",
46             type => "object",
47             },
48             }, @_ ) ); }
49              
50 0     0 1   sub end_user_details { return( shift->_set_get_class( 'end_user_details',
51             {
52             ip_address => { type => "scalar" },
53             present => { type => "boolean" },
54             }, @_ ) ); }
55              
56 0     0 1   sub expected_arrival_date { return( shift->_set_get_datetime( 'expected_arrival_date', @_ ) ); }
57              
58 0     0 1   sub financial_account { return( shift->_set_get_scalar( 'financial_account', @_ ) ); }
59              
60 0     0 1   sub hosted_regulatory_receipt_url { return( shift->_set_get_scalar( 'hosted_regulatory_receipt_url', @_ ) ); }
61              
62 0     0 1   sub livemode { return( shift->_set_get_boolean( 'livemode', @_ ) ); }
63              
64 0     0 1   sub metadata { return( shift->_set_get_hash( 'metadata', @_ ) ); }
65              
66 0     0 1   sub returned_details { return( shift->_set_get_class( 'returned_details',
67             {
68             code => { type => "scalar" },
69             transaction => {
70             package => "Net::API::Stripe::Treasury::Transaction",
71             type => "scalar_or_object",
72             },
73             }, @_ ) ); }
74              
75 0     0 1   sub statement_descriptor { return( shift->_set_get_scalar( 'statement_descriptor', @_ ) ); }
76              
77 0     0 1   sub status { return( shift->_set_get_scalar( 'status', @_ ) ); }
78              
79 0     0 1   sub status_transitions { return( shift->_set_get_class( 'status_transitions',
80             {
81             canceled_at => { type => "datetime" },
82             failed_at => { type => "datetime" },
83             posted_at => { type => "datetime" },
84             returned_at => { type => "datetime" },
85             }, @_ ) ); }
86              
87 0     0 1   sub transaction { return( shift->_set_get_scalar_or_object( 'transaction', 'Net::API::Stripe::Treasury::Transaction', @_ ) ); }
88              
89             1;
90             # NOTE: POD
91             __END__
92              
93             =encoding utf8
94              
95             =head1 NAME
96              
97             Net::API::Stripe::Treasury::OutboundPayment - The OutboundPayment object
98              
99             =head1 SYNOPSIS
100              
101             =head1 VERSION
102              
103             v0.1.0
104              
105             =head1 DESCRIPTION
106              
107             Use OutboundPayments to send funds to another party's external bank account or L<FinancialAccount|https://stripe.com/docs/api/treasury/financial_accounts>. To send money to an account belonging to the same user, use an L<OutboundTransfer|https://stripe.com/docs/api/treasury/outbound_transfers>.
108              
109             Simulate OutboundPayment state changes with the C</v1/test_helpers/treasury/outbound_payments> endpoints. These methods can only be called on test mode objects.
110              
111             =head1 METHODS
112              
113             =head2 id string
114              
115             Unique identifier for the object.
116              
117             =head2 object string
118              
119             String representing the object's type. Objects of the same type share the same value.
120              
121             =head2 amount integer
122              
123             Amount (in cents) transferred.
124              
125             =head2 cancelable boolean
126              
127             Returns C<true> if the object can be canceled, and C<false> otherwise.
128              
129             =head2 created timestamp
130              
131             Time at which the object was created. Measured in seconds since the Unix epoch.
132              
133             =head2 currency currency
134              
135             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>.
136              
137             =head2 customer string
138              
139             ID of the L<customer|https://stripe.com/docs/api/customers> to whom an OutboundPayment is sent.
140              
141             =head2 description string
142              
143             An arbitrary string attached to the object. Often useful for displaying to users.
144              
145             =head2 destination_payment_method string
146              
147             The PaymentMethod via which an OutboundPayment is sent. This field can be empty if the OutboundPayment was created using C<destination_payment_method_data>.
148              
149             =head2 destination_payment_method_details hash
150              
151             Details about the PaymentMethod for an OutboundPayment.
152              
153             It has the following properties:
154              
155             =over 4
156              
157             =item C<billing_details> hash
158              
159             Contact details for the person or business receiving the OutboundPayment.
160              
161             When expanded, this is a L<Net::API::Stripe::Billing::Details> object.
162              
163             =item C<financial_account> hash
164              
165             Details about the C<financial_account.>
166              
167             When expanded, this is a L<Net::API::Stripe::Connect::ExternalAccount::Card> object.
168              
169             =item C<type> string
170              
171             The type of the payment method used in the OutboundPayment.
172              
173             =item C<us_bank_account> hash
174              
175             Details about the C<us_bank_account.>
176              
177             When expanded, this is a L<Net::API::Stripe::Connect::ExternalAccount::Bank> object.
178              
179             =back
180              
181             =head2 end_user_details hash
182              
183             Details about the end user.
184              
185             It has the following properties:
186              
187             =over 4
188              
189             =item C<ip_address> string
190              
191             IP address of the user initiating the OutboundPayment. Set if C<present> is set to C<true>. IP address collection is required for risk and compliance reasons. This will be used to help determine if the OutboundPayment is authorized or should be blocked.
192              
193             =item C<present> boolean
194              
195             C<true`` if the OutboundPayment creation request is being made on behalf of an end user by a platform. Otherwise,>false`.
196              
197             =back
198              
199             =head2 expected_arrival_date timestamp
200              
201             The date when funds are expected to arrive in the destination account.
202              
203             =head2 financial_account string
204              
205             The FinancialAccount that funds were pulled from.
206              
207             =head2 hosted_regulatory_receipt_url string
208              
209             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.
210              
211             =head2 livemode boolean
212              
213             Has the value C<true> if the object exists in live mode or the value C<false> if the object exists in test mode.
214              
215             =head2 metadata hash
216              
217             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.
218              
219             =head2 returned_details hash
220              
221             Details about a returned OutboundPayment. Only set when the status is C<returned>.
222              
223             It has the following properties:
224              
225             =over 4
226              
227             =item C<code> string
228              
229             Reason for the return.
230              
231             =item C<transaction> string expandable
232              
233             The Transaction associated with this object.
234              
235             When expanded this is an L<Net::API::Stripe::Treasury::Transaction> object.
236              
237             =back
238              
239             =head2 statement_descriptor string
240              
241             The description that appears on the receiving end for an OutboundPayment (for example, bank statement for external bank transfer).
242              
243             =head2 status string
244              
245             Current status of the OutboundPayment: C<processing>, C<failed>, C<posted>, C<returned>, C<canceled>. An OutboundPayment is C<processing> if it has been created and is pending. The status changes to C<posted> once the OutboundPayment has been "confirmed" and funds have left the account, or to C<failed> or C<canceled>. If an OutboundPayment fails to arrive at its destination, its status will change to C<returned>.
246              
247             =head2 status_transitions hash
248              
249             Hash containing timestamps of when the object transitioned to a particular C<status>.
250              
251             It has the following properties:
252              
253             =over 4
254              
255             =item C<canceled_at> timestamp
256              
257             Timestamp describing when an OutboundPayment changed status to C<canceled>.
258              
259             =item C<failed_at> timestamp
260              
261             Timestamp describing when an OutboundPayment changed status to C<failed>.
262              
263             =item C<posted_at> timestamp
264              
265             Timestamp describing when an OutboundPayment changed status to C<posted>.
266              
267             =item C<returned_at> timestamp
268              
269             Timestamp describing when an OutboundPayment changed status to C<returned>.
270              
271             =back
272              
273             =head2 transaction expandable
274              
275             The Transaction associated with this object.
276              
277             When expanded this is an L<Net::API::Stripe::Treasury::Transaction> object.
278              
279             =head1 API SAMPLE
280              
281             [
282             {
283             "amount" : "10000",
284             "cancelable" : 1,
285             "created" : "1662261086",
286             "currency" : "usd",
287             "customer" : null,
288             "description" : "OutboundPayment to a 3rd party",
289             "destination_payment_method" : null,
290             "destination_payment_method_details" : {
291             "billing_details" : {
292             "address" : {
293             "city" : "San Francisco",
294             "country" : "US",
295             "line1" : "1234 Fake Street",
296             "line2" : null,
297             "postal_code" : "94102",
298             "state" : "CA"
299             },
300             "email" : null,
301             "name" : "Jane Austen"
302             },
303             "type" : "us_bank_account",
304             "us_bank_account" : {
305             "account_holder_type" : "individual",
306             "account_type" : "checking",
307             "bank_name" : "STRIPE TEST BANK",
308             "fingerprint" : "1JWtPxqbdX5Gamtz",
309             "last4" : "6789",
310             "network" : "ach",
311             "routing_number" : "110000000"
312             }
313             },
314             "end_user_details" : {
315             "ip_address" : null,
316             "present" : 0
317             },
318             "expected_arrival_date" : "1662422400",
319             "financial_account" : "fa_1Le9F32eZvKYlo2CjbQcDQUE",
320             "hosted_regulatory_receipt_url" : "https://payments.stripe.com/regulatory-receipt/CBQaFwoVYWNjdF8xMDMyRDgyZVp2S1lsbzJDKN6u0JgGMga0Su026sg6NpNF_5Q6tvMEpWEUiDbGDU97VaAIklGS9OIDXmvjiWY8npbpXaOBAk0SB9UCp4Ga0Qx_Ft3Ksg",
321             "id" : "obp_1Le9F42eZvKYlo2CBS5f6W7m",
322             "livemode" : 0,
323             "metadata" : {},
324             "object" : "treasury.outbound_payment",
325             "returned_details" : null,
326             "statement_descriptor" : "payment",
327             "status" : "processing",
328             "status_transitions" : {
329             "canceled_at" : null,
330             "failed_at" : null,
331             "posted_at" : null,
332             "returned_at" : null
333             },
334             "transaction" : "trxn_1Le9F32eZvKYlo2C2dtkse82"
335             }
336             ]
337              
338             =head1 HISTORY
339              
340             =head2 v0.1.0
341              
342             Initial version
343              
344             =head1 AUTHOR
345              
346             Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
347              
348             =head1 SEE ALSO
349              
350             L<Stripe API documentation|https://stripe.com/docs/api/treasury/outbound_payments>
351              
352             =head1 COPYRIGHT & LICENSE
353              
354             Copyright (c) 2019-2022 DEGUEST Pte. Ltd.
355              
356             You can use, copy, modify and redistribute this package and associated
357             files under the same terms as Perl itself.
358              
359             =cut