File Coverage

lib/Net/API/Stripe/Issuing/Transaction.pm
Criterion Covered Total %
statement 19 38 50.0
branch n/a
condition n/a
subroutine 7 26 26.9
pod 19 19 100.0
total 45 83 54.2


line stmt bran cond sub pod time code
1             ##----------------------------------------------------------------------------
2             ## Stripe API - ~/lib/Net/API/Stripe/Issuing/Transaction.pm
3             ## Version v0.101.0
4             ## Copyright(c) 2019 DEGUEST Pte. Ltd.
5             ## Author: Jacques Deguest <jack@deguest.jp>
6             ## Created 2019/11/02
7             ## Modified 2022/10/29
8             ##
9             ##----------------------------------------------------------------------------
10             ## https://stripe.com/docs/api/issuing/transactions
11             BEGIN
12             {
13             use strict;
14 2     2   23999011 use warnings;
  2         14  
  2         66  
15 2     2   11 use parent qw( Net::API::Stripe::Generic );
  2         4  
  2         59  
16 2     2   10 use vars qw( $VERSION );
  2         4  
  2         10  
17 2     2   143 our( $VERSION ) = 'v0.101.0';
  2         4  
  2         113  
18 2     2   51 };
19              
20             use strict;
21 2     2   13 use warnings;
  2         4  
  2         45  
22 2     2   12  
  2         4  
  2         1175  
23              
24 0     0 1    
25              
26 0     0 1   atm_fee => { type => "number" }
27             }, @_ ) ); }
28 0     0 1    
29              
30 0     0 1    
31              
32              
33              
34 0     0 1    
35              
36 0     0 1    
37              
38 0     0 1    
39              
40 0     0 1    
41             {
42 0     0 1   flight => {
43             definition => {
44 0     0 1   departure_at => { type => "number" },
45             passenger_name => { type => "scalar" },
46 0     0 1   refundable => { type => "boolean" },
47             segments => {
48 0     0 1   definition => {
49             arrival_airport_code => { type => "scalar" },
50 0     0 1   carrier => { type => "scalar" },
51             departure_airport_code => { type => "scalar" },
52 0     0 1   flight_number => { type => "scalar" },
53             service_class => { type => "scalar" },
54 0     0 1   stopover_allowed => { type => "boolean" },
55             },
56 0     0 1   type => "class_array",
57             },
58 0     0 1   travel_agency => { type => "scalar" },
59             },
60             type => "class",
61             },
62             fuel => {
63             definition => {
64             type => { type => "scalar" },
65             unit => { type => "scalar" },
66             unit_cost_decimal => { type => "number" },
67             volume_decimal => { type => "number" },
68             },
69             type => "class",
70             },
71             lodging => {
72             definition => { check_in_at => { type => "number" }, nights => { type => "number" } },
73             type => "class",
74             },
75             receipt => {
76             definition => {
77             description => { type => "scalar" },
78             quantity => { type => "number" },
79             total => { type => "number" },
80             unit_cost => { type => "number" },
81             },
82             type => "class_array",
83             },
84             reference => { type => "scalar" },
85             }, @_ ) ); }
86              
87              
88              
89             1;
90              
91              
92             =encoding utf8
93              
94             =head1 NAME
95              
96             Net::API::Stripe::Issuing::Transaction - A Stripe Issuing Transaction Object
97              
98             =head1 SYNOPSIS
99              
100             my $trans = $stripe->issuing_transaction({
101             amount => 2000,
102             authorization => $authorization_object,
103             balance_transaction => $balance_transaction,
104             card => $card_object,
105 0     0 1   currency => 'jpy',
106             merchant_amount => 2000,
107 0     0 1   merchant_currency => 'jpy',
108             metadata => { transaction_id => 123, customer_id > 456 },
109             });
110              
111             See documentation in L<Net::API::Stripe> for example to make api calls to Stripe to create those objects.
112              
113             =head1 VERSION
114              
115             v0.101.0
116              
117             =head1 DESCRIPTION
118              
119             Any use of an issued card (L<https://stripe.com/docs/issuing>) that results in funds entering or leaving your Stripe account, such as a completed purchase or refund, is represented by an Issuing Transaction object.
120              
121             =head1 CONSTRUCTOR
122              
123             =head2 new( %ARG )
124              
125             Creates a new L<Net::API::Stripe::Issuing::Transaction> object.
126             It may also take an hash like arguments, that also are method of the same name.
127              
128             =head1 METHODS
129              
130             =head2 id string
131              
132             Unique identifier for the object.
133              
134             =head2 object string, value is "issuing.transaction"
135              
136             String representing the object’s type. Objects of the same type share the same value.
137              
138             =head2 amount integer
139              
140             The transaction amount, which will be reflected in your balance. This amount is in your currency and in the L<smallest currency unit|https://stripe.com/docs/currencies#zero-decimal>.
141              
142             =head2 amount_details hash
143              
144             Detailed breakdown of amount components. These amounts are denominated in `currency` and in the L<smallest currency unit|https://stripe.com/docs/currencies#zero-decimal>.
145              
146             It has the following properties:
147              
148             =over 4
149              
150             =item I<atm_fee> integer
151              
152             The fee charged by the ATM for the cash withdrawal.
153              
154             =back
155              
156             =head2 authorization string (expandable)
157              
158             The Authorization object that led to this transaction.
159              
160             When expanded, this is a L<Net::API::Stripe::Issuing::Authorization> object.
161              
162             =head2 balance_transaction string (expandable)
163              
164             When expanded, this is a L<Net::API::Stripe::Balance::Transaction> object.
165              
166             =head2 card string (expandable)
167              
168             The card used to make this transaction.
169              
170             When expanded, this is a L<Net::API::Stripe::Payment::Card> object.
171              
172             =head2 cardholder string (expandable)
173              
174             The cardholder to whom this transaction belongs.
175              
176             When expanded, this is a L<Net::API::Stripe::Issuing::Card::Holder> object.
177              
178             =head2 created timestamp
179              
180             Time at which the object was created. Measured in seconds since the Unix epoch.
181              
182             =head2 currency currency
183              
184             Three-letter ISO currency code, in lowercase. Must be a supported currency.
185              
186             =head2 dispute string (expandable)
187              
188             When expanded, this is a L<Net::API::Stripe::Issuing::Dispute> object.
189              
190             =head2 livemode boolean
191              
192             Has the value true if the object exists in live mode or the value false if the object exists in test mode.
193              
194             =head2 merchant_amount integer
195              
196             The amount that the merchant will receive, denominated in L</merchant_currency> and in the smallest currency unit. It will be different from L</amount> if the merchant is taking payment in a different currency.
197              
198             =head2 merchant_currency currency
199              
200             The currency with which the merchant is taking payment.
201              
202             =head2 merchant_data hash
203              
204             More information about the user involved in the transaction.
205              
206             This is a L<Net::API::Stripe::Issuing::MerchantData> object.
207              
208             =head2 metadata hash
209              
210             Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
211              
212             =head2 purchase_details hash
213              
214             Additional purchase information that is optionally provided by the merchant.
215              
216             It has the following properties:
217              
218             =over 4
219              
220             =item I<flight> hash
221              
222             Information about the flight that was purchased with this transaction.
223              
224             =over 8
225              
226             =item I<departure_at> integer
227              
228             The time that the flight departed.
229              
230             =item I<passenger_name> string
231              
232             The name of the passenger.
233              
234             =item I<refundable> boolean
235              
236             Whether the ticket is refundable.
237              
238             =item I<segments> array
239              
240             The legs of the trip.
241              
242             =over 12
243              
244             =item I<arrival_airport_code> string
245              
246             The three-letter IATA airport code of the flight's destination.
247              
248             =item I<carrier> string
249              
250             The airline carrier code.
251              
252             =item I<departure_airport_code> string
253              
254             The three-letter IATA airport code that the flight departed from.
255              
256             =item I<flight_number> string
257              
258             The flight number.
259              
260             =item I<service_class> string
261              
262             The flight's service class.
263              
264             =item I<stopover_allowed> boolean
265              
266             Whether a stopover is allowed on this flight.
267              
268             =back
269              
270             =item I<travel_agency> string
271              
272             The travel agency that issued the ticket.
273              
274             =back
275              
276             =item I<fuel> hash
277              
278             Information about fuel that was purchased with this transaction.
279              
280             =over 8
281              
282             =item I<type> string
283              
284             The type of fuel that was purchased. One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`.
285              
286             =item I<unit> string
287              
288             The units for `volume_decimal`. One of `us_gallon` or `liter`.
289              
290             =item I<unit_cost_decimal> decimal_string
291              
292             The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places.
293              
294             =item I<volume_decimal> decimal_string
295              
296             The volume of the fuel that was pumped, represented as a decimal string with at most 12 decimal places.
297              
298             =back
299              
300             =item I<lodging> hash
301              
302             Information about lodging that was purchased with this transaction.
303              
304             =over 8
305              
306             =item I<check_in_at> integer
307              
308             The time of checking into the lodging.
309              
310             =item I<nights> integer
311              
312             The number of nights stayed at the lodging.
313              
314             =back
315              
316             =item I<receipt> array
317              
318             The line items in the purchase.
319              
320             =over 8
321              
322             =item I<description> string
323              
324             The description of the item. The maximum length of this field is 26 characters.
325              
326             =item I<quantity> decimal
327              
328             The quantity of the item.
329              
330             =item I<total> integer
331              
332             The total for this line item in cents.
333              
334             =item I<unit_cost> integer
335              
336             The unit cost of the item in cents.
337              
338             =back
339              
340             =item I<reference> string
341              
342             A merchant-specific order number.
343              
344             =back
345              
346             =head2 type string
347              
348             One of capture, refund, cash_withdrawal, refund_reversal, dispute, or dispute_loss.
349              
350             =head2 wallet string
351              
352             The digital wallet used for this transaction. One of C<apple_pay>, C<google_pay>, or C<samsung_pay>.
353              
354             =head1 API SAMPLE
355              
356             {
357             "id": "ipi_fake123456789",
358             "object": "issuing.transaction",
359             "amount": -100,
360             "authorization": "iauth_fake123456789",
361             "balance_transaction": null,
362             "card": "ic_fake123456789",
363             "cardholder": null,
364             "created": 1571480456,
365             "currency": "usd",
366             "dispute": null,
367             "livemode": false,
368             "merchant_amount": -100,
369             "merchant_currency": "usd",
370             "merchant_data": {
371             "category": "taxicabs_limousines",
372             "city": "San Francisco",
373             "country": "US",
374             "name": "Rocket Rides",
375             "network_id": "1234567890",
376             "postal_code": "94107",
377             "state": "CA",
378             "url": null
379             },
380             "metadata": {},
381             "type": "capture"
382             }
383              
384             =head1 HISTORY
385              
386             =head2 v0.1
387              
388             Initial version
389              
390             =head1 AUTHOR
391              
392             Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
393              
394             =head1 SEE ALSO
395              
396             Stripe API documentation:
397              
398             L<https://stripe.com/docs/api/issuing/transactions>, L<https://stripe.com/docs/issuing/transactions>
399              
400             =head1 COPYRIGHT & LICENSE
401              
402             Copyright (c) 2019-2020 DEGUEST Pte. Ltd.
403              
404             You can use, copy, modify and redistribute this package and associated
405             files under the same terms as Perl itself.
406              
407             =cut