Stripe/Balance/Transaction.pm

filter: Statementstmt 34.7% 8 / 23 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 16.6% 3 / 18 Podpod 93.3% 14 / 15 totaltotal 44.6% 25 / 56 CC 1 SCAR 6.1
CC
1
Cov
35%
id
2.0
object
2.0
amount
2.0
CRAP 1.8
« Stripe/Issuing/Card/Holder.pm ↑ Summary Stripe/Billing/Coupon.pm »
1 ##----------------------------------------------------------------------------
2 ## Stripe API - ~/lib/Net/API/Stripe/Balance/Transaction.pm
3 ## Version v0.100.0
4 ## Copyright(c) 2019 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/balance/balance_transaction
11 package Net::API::Stripe::Balance::Transaction;
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 available_on { shift->_set_get_datetime( 'available_on', @_ ); }
Subroutine available_on: not called CC=1 SCAR=6.9
Pod documented
26  
27 0 ▶sub created { shift->_set_get_datetime( 'created', @_ ); }
Subroutine created: not called CC=1 SCAR=6.9
Pod documented
28  
29 0 ▶sub currency { shift->_set_get_scalar( 'currency', @_ ); }
Subroutine currency: not called CC=1 SCAR=6.9
Pod documented
30  
31 0 ▶sub description { shift->_set_get_scalar( 'description', @_ ); }
Subroutine description: not called CC=1 SCAR=6.9
Pod documented
32  
33 0 ▶sub exchange_rate { shift->_set_get_number( 'exchange_rate', @_ ); }
Subroutine exchange_rate: not called CC=1 SCAR=6.9
Pod documented
34  
35 0 ▶sub fee { shift->_set_get_number( 'fee', @_ ); }
Subroutine fee: not called CC=1 SCAR=6.9
Pod undocumented
36  
37 ## Array of Net::API::Stripe::Balance::Transaction::FeeDetails
38 0 ▶sub fee_details { shift->_set_get_object_array( 'fee_details', 'Net::API::Stripe::Balance::Transaction::FeeDetails', @_ ); }
Subroutine fee_details: not called CC=1 SCAR=6.9
Pod documented
39  
40 0 ▶sub net { shift->_set_get_number( 'net', @_ ); }
Subroutine net: not called CC=1 SCAR=6.9
Pod documented
41  
42 0 ▶sub source { shift->_set_get_scalar_or_object_variant( 'source', @_ ); }
Subroutine source: not called CC=1 SCAR=6.9
Pod documented
43  
44 0 ▶sub sourced_transfers { return( shift->_set_get_object( 'sourced_transfers', 'Net::API::Stripe::List', @_ ) ); }
Subroutine sourced_transfers: not called CC=1 SCAR=6.9
Pod documented
45  
46 0 ▶sub status { shift->_set_get_scalar( 'status', @_ ); }
Subroutine status: not called CC=1 SCAR=6.9
Pod documented
47  
48 0 ▶sub type { shift->_set_get_scalar( 'type', @_ ); }
Subroutine type: not called CC=1 SCAR=6.9
Pod documented
49  
50 1 1;
51  
52 __END__
53  
54 =encoding utf8
55  
56 =head1 NAME
57  
58 Net::API::Stripe::Balance::Transaction - The Balance Transaction object
59  
60 =head1 SYNOPSIS
61  
62 my $bt = $stripe->balance_transactions({
63 amount => 2000,
64 # or we could also use a unix timestamp
65 available_on => '2019-08-15',
66 currency => 'jpy',
67 description => 'Customer account credit',
68 fee_details => Net::API::Stripe::Balance::Transaction::FeeDetails->new({
69 amount => 40,
70 currency => 'eur',
71 description => 'Some transaction',
72 type => 'application_fee',
73 }),
74 net => 1960,
75 status => 'available',
76 type => 'application_fee',
77 }) || die( $stripe->error );
78  
79 =head1 VERSION
80  
81 v0.100.0
82  
83 =head1 DESCRIPTION
84  
85 Balance transactions represent funds moving through your Stripe account. They're created for every type of transaction that comes into or flows out of your Stripe account balance.
86  
87 =head1 CONSTRUCTOR
88  
89 =over 4
90  
91 =item B<new>( %ARG )
92  
93 Creates a new L<Net::API::Stripe::Balance::Transaction> object
94  
95 =back
96  
97 =head1 METHODS
98  
99 =over 4
100  
101 =item B<id> string
102  
103 Unique identifier for the object.
104  
105 =item B<object> string, value is "balance_transaction"
106  
107 String representing the object’s type. Objects of the same type share the same value.
108  
109 =item B<amount> integer
110  
111 Gross amount of the transaction, in JPY.
112  
113 =item B<available_on> timestamp
114  
115 The date the transaction’s net funds will become available in the Stripe balance.
116  
117 =item B<created> timestamp
118  
119 Time at which the object was created. Measured in seconds since the Unix epoch.
120  
121 =item B<currency> currency
122  
123 Three-letter ISO currency code, in lowercase. Must be a supported currency (L<https://stripe.com/docs/currencies>).
124  
125 =item B<description> string
126  
127 An arbitrary string attached to the object. Often useful for displaying to users.
128  
129 =item B<exchange_rate> decimal
130  
131 fee integer
132  
133 Fees (in JPY) paid for this transaction.
134  
135 =item B<fee_details> array of L<Net::API::Stripe::Balance::Transaction::FeeDetails> objects
136  
137 Detailed breakdown of fees (in JPY) paid for this transaction.
138  
139 =over 8
140  
141 =item B<amount> integer
142  
143 Amount of the fee, in cents.
144  
145 =item B<application> string
146  
147 =item B<currency> currency
148  
149 Three-letter ISO currency code, in lowercase. Must be a supported currency.
150  
151 =item B<description> string
152  
153 An arbitrary string attached to the object. Often useful for displaying to users.
154  
155 =item B<type> string
156  
157 Type of the fee, one of: application_fee, stripe_fee or tax.
158  
159 =back
160  
161 =item B<net> integer
162  
163 Net amount of the transaction, in JPY.
164  
165 =item B<source> string (expandable)
166  
167 The Stripe object to which this transaction is related.
168  
169 For example, a charge object. This is managed with L<Net::API::Stripe::Generic/"_set_get_scalar_or_object_variant"> method. It will check if this is a hash, array or string, and will find out the proper associated class by peeking into the data.
170  
171 =item B<sourced_transfers> array
172  
173 This is a list of object, but according to Stripe and its support, it is deprecated.
174  
175 The "sourced_transfers parameters used to include any charges or ACH payments to which the balance transfer relates and provide a link back to the 'source' of the balance transaction."
176  
177 See L<https://stripe.com/docs/upgrades#2017-01-27>
178  
179 =item B<status> string
180  
181 If the transaction’s net funds are available in the Stripe balance yet. Either available or pending.
182  
183 =item B<type> string
184  
185 Transaction type:
186  
187 =over 8
188  
189 =item I<adjustment>
190  
191 =item I<advance>
192  
193 =item I<advance_funding>
194  
195 =item I<application_fee>
196  
197 =item I<application_fee_refund>
198  
199 =item I<charge>
200  
201 =item I<connect_collection_transfer>
202  
203 =item I<issuing_authorization_hold>
204  
205 =item I<issuing_authorization_release>
206  
207 =item I<issuing_transaction>
208  
209 =item I<payment>
210  
211 =item I<payment_failure_refund>
212  
213 =item I<payment_refund>
214  
215 =item I<payout>
216  
217 =item I<payout_cancel>
218  
219 =item I<payout_failure>
220  
221 =item I<refund>
222  
223 =item I<refund_failure>
224  
225 =item I<reserve_transaction>
226  
227 =item I<reserved_funds>
228  
229 =item I<stripe_fee>
230  
231 =item I<stripe_fx_fee>
232  
233 =item I<tax_fee>
234  
235 =item I<topup>
236  
237 =item I<topup_reversal>
238  
239 =item I<transfer>
240  
241 =item I<transfer_cancel>
242  
243 =item I<transfer_failure>
244  
245 =item I<transfer_refund>
246  
247 =back
248  
249 =back
250  
251 =head1 API SAMPLE
252  
253 {
254 "id": "txn_1FTlZvCeyNCl6fY2qIteNrPe",
255 "object": "balance_transaction",
256 "amount": 8000,
257 "available_on": 1571443200,
258 "created": 1571128827,
259 "currency": "jpy",
260 "description": "Invoice 409CD54-0039",
261 "exchange_rate": null,
262 "fee": 288,
263 "fee_details": [
264 {
265 "amount": 288,
266 "application": null,
267 "currency": "jpy",
268 "description": "Stripe processing fees",
269 "type": "stripe_fee"
270 }
271 ],
272 "net": 7712,
273 "source": "ch_1FTlZvCeyNCl6fY2YAZ8thLx",
274 "status": "pending",
275 "type": "charge"
276 }
277  
278 =head1 HISTORY
279  
280 =head2 v0.1
281  
282 Initial version
283  
284 =head1 AUTHOR
285  
286 Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
287  
288 =head1 SEE ALSO
289  
290 Stripe API documentation:
291  
292 L<https://stripe.com/docs/api/balance_transactions>, L<https://stripe.com/docs/reports/balance-transaction-types>
293  
294 =head1 COPYRIGHT & LICENSE
295  
296 Copyright (c) 2019-2020 DEGUEST Pte. Ltd.
297  
298 You can use, copy, modify and redistribute this package and associated
299 files under the same terms as Perl itself.
300  
301 =cut
« Stripe/Issuing/Card/Holder.pm ↑ Summary Stripe/Billing/Coupon.pm »