File Coverage

lib/Net/API/Stripe/Treasury/ReceivedCredit.pm
Criterion Covered Total %
statement 7 23 30.4
branch n/a
condition n/a
subroutine 3 19 15.7
pod 16 16 100.0
total 26 58 44.8


line stmt bran cond sub pod time code
1             ##----------------------------------------------------------------------------
2             ## Stripe API - ~/lib/Net/API/Stripe/Treasury/ReceivedCredit.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::ReceivedCredit;
11             BEGIN
12             {
13 2     2   21207473 use strict;
  2         17  
  2         69  
14 2     2   13 use parent qw( Net::API::Stripe::Generic );
  2         6  
  2         11  
15 2     2   1134 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 created { return( shift->_set_get_datetime( 'created', @_ ) ); }
25              
26 0     0 1   sub currency { return( shift->_set_get_number( 'currency', @_ ) ); }
27              
28 0     0 1   sub description { return( shift->_set_get_scalar( 'description', @_ ) ); }
29              
30 0     0 1   sub failure_code { return( shift->_set_get_scalar( 'failure_code', @_ ) ); }
31              
32 0     0 1   sub financial_account { return( shift->_set_get_scalar( 'financial_account', @_ ) ); }
33              
34 0     0 1   sub hosted_regulatory_receipt_url { return( shift->_set_get_scalar( 'hosted_regulatory_receipt_url', @_ ) ); }
35              
36 0     0 1   sub initiating_payment_method_details { return( shift->_set_get_class( 'initiating_payment_method_details',
37             {
38             balance => { type => "scalar" },
39             billing_details => { package => "Net::API::Stripe::Billing::Details", type => "object" },
40             financial_account => {
41             package => "Net::API::Stripe::Connect::ExternalAccount::Card",
42             type => "object",
43             },
44             issuing_card => { type => "scalar" },
45             type => { type => "scalar" },
46             us_bank_account => {
47             package => "Net::API::Stripe::Connect::ExternalAccount::Bank",
48             type => "object",
49             },
50             }, @_ ) ); }
51              
52 0     0 1   sub linked_flows { return( shift->_set_get_class( 'linked_flows',
53             {
54             credit_reversal => { type => "scalar" },
55             issuing_authorization => { type => "scalar" },
56             issuing_transaction => { type => "scalar" },
57             source_flow => { type => "scalar" },
58             source_flow_details => {
59             definition => {
60             credit_reversal => {
61             package => "Net::API::Stripe::Treasury::CreditReversal",
62             type => "object",
63             },
64             outbound_payment => {
65             package => "Net::API::Stripe::Treasury::OutboundPayment",
66             type => "object",
67             },
68             payout => { type => "hash" },
69             type => { type => "scalar" },
70             },
71             type => "class",
72             },
73             source_flow_type => { type => "scalar" },
74             }, @_ ) ); }
75              
76 0     0 1   sub livemode { return( shift->_set_get_boolean( 'livemode', @_ ) ); }
77              
78 0     0 1   sub network { return( shift->_set_get_scalar( 'network', @_ ) ); }
79              
80 0     0 1   sub reversal_details { return( shift->_set_get_class( 'reversal_details',
81             {
82             deadline => { type => "datetime" },
83             restricted_reason => { type => "scalar" },
84             }, @_ ) ); }
85              
86 0     0 1   sub status { return( shift->_set_get_scalar( 'status', @_ ) ); }
87              
88 0     0 1   sub transaction { return( shift->_set_get_scalar_or_object( 'transaction', 'Net::API::Stripe::Treasury::Transaction', @_ ) ); }
89              
90             1;
91             # NOTE: POD
92             __END__
93              
94             =encoding utf8
95              
96             =head1 NAME
97              
98             Net::API::Stripe::Treasury::ReceivedCredit - The ReceivedCredit object
99              
100             =head1 SYNOPSIS
101              
102             =head1 VERSION
103              
104             v0.1.0
105              
106             =head1 DESCRIPTION
107              
108             ReceivedCredits represent funds sent to a L<FinancialAccount|https://stripe.com/docs/api/treasury/financial_accounts> (for example, via ACH or wire). These money movements are not initiated from the FinancialAccount.
109              
110             =head1 METHODS
111              
112             =head2 id string
113              
114             Unique identifier for the object.
115              
116             =head2 object string
117              
118             String representing the object's type. Objects of the same type share the same value.
119              
120             =head2 amount integer
121              
122             Amount (in cents) transferred.
123              
124             =head2 created timestamp
125              
126             Time at which the object was created. Measured in seconds since the Unix epoch.
127              
128             =head2 currency currency
129              
130             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>.
131              
132             =head2 description string
133              
134             An arbitrary string attached to the object. Often useful for displaying to users.
135              
136             =head2 failure_code string
137              
138             Reason for the failure. A ReceivedCredit might fail because the receiving FinancialAccount is closed or frozen.
139              
140             =head2 financial_account string
141              
142             The FinancialAccount that received the funds.
143              
144             =head2 hosted_regulatory_receipt_url string
145              
146             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.
147              
148             =head2 initiating_payment_method_details hash
149              
150             Details about the PaymentMethod used to send a ReceivedCredit.
151              
152             It has the following properties:
153              
154             =over 4
155              
156             =item C<balance> string
157              
158             Set when C<type> is C<balance>.
159              
160             =item C<billing_details> hash
161              
162             The contact details of the person or business referenced by the received payment method details.
163              
164             When expanded, this is a L<Net::API::Stripe::Billing::Details> object.
165              
166             =item C<financial_account> hash
167              
168             Set when C<type> is C<financial_account>. This is a L<FinancialAccount|https://stripe.com/docs/api/treasury/financial_accounts> ID.
169              
170             When expanded, this is a L<Net::API::Stripe::Connect::ExternalAccount::Card> object.
171              
172             =item C<issuing_card> string
173              
174             Set when C<type> is C<issuing_card>. This is an L<Issuing Card|https://stripe.com/docs/api/issuing/cards> ID.
175              
176             =item C<type> string
177              
178             Polymorphic type matching the originating money movement's source. This can be an external account, a Stripe balance, or a FinancialAccount.
179              
180             =item C<us_bank_account> hash
181              
182             Set when C<type> is C<us_bank_account>.
183              
184             When expanded, this is a L<Net::API::Stripe::Connect::ExternalAccount::Bank> object.
185              
186             =back
187              
188             =head2 linked_flows hash
189              
190             Other flows linked to a ReceivedCredit.
191              
192             It has the following properties:
193              
194             =over 4
195              
196             =item C<credit_reversal> string
197              
198             The CreditReversal created as a result of this ReceivedCredit being reversed.
199              
200             =item C<issuing_authorization> string
201              
202             Set if the ReceivedCredit was created due to an L<Issuing Authorization|https://stripe.com/docs/api/issuing/authorizations> object.
203              
204             =item C<issuing_transaction> string
205              
206             Set if the ReceivedCredit is also viewable as an L<Issuing transaction|https://stripe.com/docs/api/issuing/transactions> object.
207              
208             =item C<source_flow> string
209              
210             ID of the source flow. Set if C<network> is C<stripe> and the source flow is visible to the user. Examples of source flows include OutboundPayments, payouts, or CreditReversals.
211              
212             =item C<source_flow_details> hash
213              
214             The expandable object of the source flow.
215              
216             =over 8
217              
218             =item C<credit_reversal> hash
219              
220             Details about a L<CreditReversal|https://stripe.com/docs/api/treasury/credit_reversals>.
221              
222             When expanded, this is a L<Net::API::Stripe::Treasury::CreditReversal> object.
223              
224             =item C<outbound_payment> hash
225              
226             Details about an L<OutboundPayment|https://stripe.com/docs/api/treasury/outbound_payments>.
227              
228             When expanded, this is a L<Net::API::Stripe::Treasury::OutboundPayment> object.
229              
230             =item C<payout> hash
231              
232             Details about a L<Payout|https://stripe.com/docs/api/payouts>.
233              
234             =item C<type> string
235              
236             The type of the source flow that originated the ReceivedCredit.
237              
238              
239             =back
240              
241             =item C<source_flow_type> string
242              
243             The type of flow that originated the ReceivedCredit (for example, C<outbound_payment>).
244              
245             =back
246              
247             =head2 livemode boolean
248              
249             Has the value C<true> if the object exists in live mode or the value C<false> if the object exists in test mode.
250              
251             =head2 network string
252              
253             The rails used to send the funds.
254              
255             =head2 reversal_details hash
256              
257             Details describing when a ReceivedCredit may be reversed.
258              
259             It has the following properties:
260              
261             =over 4
262              
263             =item C<deadline> timestamp
264              
265             Time before which a ReceivedCredit can be reversed.
266              
267             =item C<restricted_reason> string
268              
269             Set if a ReceivedCredit cannot be reversed.
270              
271             =back
272              
273             =head2 status string
274              
275             Status of the ReceivedCredit. ReceivedCredits are created either C<succeeded> (approved) or C<failed> (declined). If a ReceivedCredit is declined, the failure reason can be found in the C<failure_code> field.
276              
277             =head2 transaction expandable
278              
279             The Transaction associated with this object.
280              
281             When expanded this is an L<Net::API::Stripe::Treasury::Transaction> object.
282              
283             =head1 API SAMPLE
284              
285             [
286             {
287             "amount" : "1234",
288             "created" : "1662261086",
289             "currency" : "usd",
290             "description" : "Stripe Test",
291             "failure_code" : null,
292             "financial_account" : "fa_1Le9F32eZvKYlo2CjbQcDQUE",
293             "hosted_regulatory_receipt_url" : "https://payments.stripe.com/regulatory-receipt/CBQaFwoVYWNjdF8xMDMyRDgyZVp2S1lsbzJDKN6u0JgGMgYDYytXp4Q6NpNxnyW6ja3A-rXLfX65n1xJ84o7-KJYCHHCamuKkO61-lq-6oeQnW0rKTXcVFx_UTYtQ73i9w",
294             "id" : "rc_1Le9F42eZvKYlo2CM2wIU5bz",
295             "initiating_payment_method_details" : {
296             "billing_details" : {
297             "address" : {
298             "city" : null,
299             "country" : null,
300             "line1" : null,
301             "line2" : null,
302             "postal_code" : null,
303             "state" : null
304             },
305             "email" : null,
306             "name" : "Jane Austen"
307             },
308             "type" : "us_bank_account",
309             "us_bank_account" : {
310             "bank_name" : "STRIPE TEST BANK",
311             "last4" : "6789",
312             "routing_number" : "110000000"
313             }
314             },
315             "linked_flows" : {
316             "credit_reversal" : null,
317             "issuing_authorization" : null,
318             "issuing_transaction" : null,
319             "source_flow" : null,
320             "source_flow_type" : null
321             },
322             "livemode" : 0,
323             "network" : "ach",
324             "object" : "treasury.received_credit",
325             "reversal_details" : {
326             "deadline" : "1662508800",
327             "restricted_reason" : null
328             },
329             "status" : "succeeded",
330             "transaction" : "trxn_1Le9F32eZvKYlo2C2dtkse82"
331             }
332             ]
333              
334             =head1 HISTORY
335              
336             =head2 v0.1.0
337              
338             Initial version
339              
340             =head1 AUTHOR
341              
342             Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
343              
344             =head1 SEE ALSO
345              
346             L<Stripe API documentation|https://stripe.com/docs/api/treasury/received_credits>
347              
348             =head1 COPYRIGHT & LICENSE
349              
350             Copyright (c) 2019-2022 DEGUEST Pte. Ltd.
351              
352             You can use, copy, modify and redistribute this package and associated
353             files under the same terms as Perl itself.
354              
355             =cut