File Coverage

lib/Net/API/Stripe/Treasury/ReceivedDebit.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/ReceivedDebit.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::ReceivedDebit;
11             BEGIN
12             {
13 2     2   21147702 use strict;
  2         15  
  2         71  
14 2     2   13 use parent qw( Net::API::Stripe::Generic );
  2         4  
  2         11  
15 2     2   1008 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             debit_reversal => { type => "scalar" },
55             inbound_transfer => { type => "scalar" },
56             issuing_authorization => { type => "scalar" },
57             issuing_transaction => { type => "scalar" },
58             }, @_ ) ); }
59              
60 0     0 1   sub livemode { return( shift->_set_get_boolean( 'livemode', @_ ) ); }
61              
62 0     0 1   sub network { return( shift->_set_get_scalar( 'network', @_ ) ); }
63              
64 0     0 1   sub reversal_details { return( shift->_set_get_class( 'reversal_details',
65             {
66             deadline => { type => "datetime" },
67             restricted_reason => { type => "scalar" },
68             }, @_ ) ); }
69              
70 0     0 1   sub status { return( shift->_set_get_scalar( 'status', @_ ) ); }
71              
72 0     0 1   sub transaction { return( shift->_set_get_scalar_or_object( 'transaction', 'Net::API::Stripe::Treasury::Transaction', @_ ) ); }
73              
74             1;
75             # NOTE: POD
76             __END__
77              
78             =encoding utf8
79              
80             =head1 NAME
81              
82             Net::API::Stripe::Treasury::ReceivedDebit - The ReceivedDebit object
83              
84             =head1 SYNOPSIS
85              
86             =head1 VERSION
87              
88             v0.1.0
89              
90             =head1 DESCRIPTION
91              
92             ReceivedDebits represent funds pulled from a L<FinancialAccount|https://stripe.com/docs/api/treasury/financial_accounts>. These are not initiated from the FinancialAccount.
93              
94             =head1 METHODS
95              
96             =head2 id string
97              
98             Unique identifier for the object.
99              
100             =head2 object string
101              
102             String representing the object's type. Objects of the same type share the same value.
103              
104             =head2 amount integer
105              
106             Amount (in cents) transferred.
107              
108             =head2 created timestamp
109              
110             Time at which the object was created. Measured in seconds since the Unix epoch.
111              
112             =head2 currency currency
113              
114             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>.
115              
116             =head2 description string
117              
118             An arbitrary string attached to the object. Often useful for displaying to users.
119              
120             =head2 failure_code string
121              
122             Reason for the failure. A ReceivedDebit might fail because the FinancialAccount doesn't have sufficient funds, is closed, or is frozen.
123              
124             =head2 financial_account string
125              
126             The FinancialAccount that funds were pulled from.
127              
128             =head2 hosted_regulatory_receipt_url string
129              
130             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.
131              
132             =head2 initiating_payment_method_details hash
133              
134             Details about how a ReceivedDebit was created.
135              
136             It has the following properties:
137              
138             =over 4
139              
140             =item C<balance> string
141              
142             Set when C<type> is C<balance>.
143              
144             =item C<billing_details> hash
145              
146             The contact details of the person or business referenced by the received payment method details.
147              
148             When expanded, this is a L<Net::API::Stripe::Billing::Details> object.
149              
150             =item C<financial_account> hash
151              
152             Set when C<type> is C<financial_account>. This is a L<FinancialAccount|https://stripe.com/docs/api/treasury/financial_accounts> ID.
153              
154             When expanded, this is a L<Net::API::Stripe::Connect::ExternalAccount::Card> object.
155              
156             =item C<issuing_card> string
157              
158             Set when C<type> is C<issuing_card>. This is an L<Issuing Card|https://stripe.com/docs/api/issuing/cards> ID.
159              
160             =item C<type> string
161              
162             Polymorphic type matching the originating money movement's source. This can be an external account, a Stripe balance, or a FinancialAccount.
163              
164             =item C<us_bank_account> hash
165              
166             Set when C<type> is C<us_bank_account>.
167              
168             When expanded, this is a L<Net::API::Stripe::Connect::ExternalAccount::Bank> object.
169              
170             =back
171              
172             =head2 linked_flows hash
173              
174             Other flows linked to a ReceivedDebit.
175              
176             It has the following properties:
177              
178             =over 4
179              
180             =item C<debit_reversal> string
181              
182             The DebitReversal created as a result of this ReceivedDebit being reversed.
183              
184             =item C<inbound_transfer> string
185              
186             Set if the ReceivedDebit is associated with an InboundTransfer's return of funds.
187              
188             =item C<issuing_authorization> string
189              
190             Set if the ReceivedDebit was created due to an L<Issuing Authorization|https://stripe.com/docs/api/issuing/authorizations> object.
191              
192             =item C<issuing_transaction> string
193              
194             Set if the ReceivedDebit is also viewable as an L<Issuing Dispute|https://stripe.com/docs/api/issuing/disputes> object.
195              
196             =back
197              
198             =head2 livemode boolean
199              
200             Has the value C<true> if the object exists in live mode or the value C<false> if the object exists in test mode.
201              
202             =head2 network string
203              
204             The network used for the ReceivedDebit.
205              
206             =head2 reversal_details hash
207              
208             Details describing when a ReceivedDebit might be reversed.
209              
210             It has the following properties:
211              
212             =over 4
213              
214             =item C<deadline> timestamp
215              
216             Time before which a ReceivedDebit can be reversed.
217              
218             =item C<restricted_reason> string
219              
220             Set if a ReceivedDebit can't be reversed.
221              
222             =back
223              
224             =head2 status string
225              
226             Status of the ReceivedDebit. ReceivedDebits are created with a status of either C<succeeded> (approved) or C<failed> (declined). The failure reason can be found under the C<failure_code>.
227              
228             =head2 transaction expandable
229              
230             The Transaction associated with this object.
231              
232             When expanded this is an L<Net::API::Stripe::Treasury::Transaction> object.
233              
234             =head1 API SAMPLE
235              
236             [
237             {
238             "amount" : "54321",
239             "created" : "1662261086",
240             "currency" : "usd",
241             "description" : "Stripe Test",
242             "failure_code" : null,
243             "financial_account" : "fa_1Le9F32eZvKYlo2CjbQcDQUE",
244             "hosted_regulatory_receipt_url" : "https://payments.stripe.com/regulatory-receipt/CBQaFwoVYWNjdF8xMDMyRDgyZVp2S1lsbzJDKN6u0JgGMgaJXJ5gPWM6NpNVsxwbJ0H2IYdjE-FeJWvCxhxTRMtAqNeU_wiSFNdGGWnGiwIbGaTowMIXAsm7Eie-ou_Wuw",
245             "id" : "rd_1Le9F42eZvKYlo2CkeS54zSl",
246             "initiating_payment_method_details" : {
247             "billing_details" : {
248             "address" : {
249             "city" : null,
250             "country" : null,
251             "line1" : null,
252             "line2" : null,
253             "postal_code" : null,
254             "state" : null
255             },
256             "email" : null,
257             "name" : "Jane Austen"
258             },
259             "type" : "us_bank_account",
260             "us_bank_account" : {
261             "bank_name" : "STRIPE TEST BANK",
262             "last4" : "6789",
263             "routing_number" : "110000000"
264             }
265             },
266             "linked_flows" : {
267             "debit_reversal" : null,
268             "inbound_transfer" : null,
269             "issuing_authorization" : null,
270             "issuing_transaction" : null
271             },
272             "livemode" : 0,
273             "network" : "ach",
274             "object" : "treasury.received_debit",
275             "reversal_details" : {
276             "deadline" : "1662508800",
277             "restricted_reason" : null
278             },
279             "status" : "succeeded",
280             "transaction" : "trxn_1Le9F32eZvKYlo2C2dtkse82"
281             }
282             ]
283              
284             =head1 HISTORY
285              
286             =head2 v0.1.0
287              
288             Initial version
289              
290             =head1 AUTHOR
291              
292             Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
293              
294             =head1 SEE ALSO
295              
296             L<Stripe API documentation|https://stripe.com/docs/api/treasury/received_debits>
297              
298             =head1 COPYRIGHT & LICENSE
299              
300             Copyright (c) 2019-2022 DEGUEST Pte. Ltd.
301              
302             You can use, copy, modify and redistribute this package and associated
303             files under the same terms as Perl itself.
304              
305             =cut