File Coverage

lib/Net/API/Stripe/Issuing/Authorization/Transaction.pm
Criterion Covered Total %
statement 19 35 54.2
branch n/a
condition n/a
subroutine 7 23 30.4
pod 16 16 100.0
total 42 74 56.7


line stmt bran cond sub pod time code
1             ##----------------------------------------------------------------------------
2             ## Stripe API - ~/lib/Net/API/Stripe/Issuing/Authorization/Transaction.pm
3             ## Version v0.100.0
4             ## Copyright(c) 2019 DEGUEST Pte. Ltd.
5             ## Author: Jacques Deguest <jack@deguest.jp>
6             ## Created 2019/11/02
7             ## Modified 2020/05/15
8             ##
9             ##----------------------------------------------------------------------------
10             package Net::API::Stripe::Issuing::Authorization::Transaction;
11             BEGIN
12             {
13 1     1   1071 use strict;
  1         3  
  1         32  
14 1     1   5 use warnings;
  1         2  
  1         32  
15 1     1   7 use parent qw( Net::API::Stripe::Generic );
  1         3  
  1         4  
16 1     1   65 use vars qw( $VERSION );
  1         2  
  1         46  
17 1     1   33 our( $VERSION ) = 'v0.100.0';
18             };
19              
20 1     1   5 use strict;
  1         3  
  1         23  
21 1     1   4 use warnings;
  1         3  
  1         373  
22              
23 0     0 1   sub id { return( shift->_set_get_scalar( 'id', @_ ) ); }
24              
25 0     0 1   sub object { return( shift->_set_get_scalar( 'object', @_ ) ); }
26              
27 0     0 1   sub amount { return( shift->_set_get_number( 'amount', @_ ) ); }
28              
29 0     0 1   sub authorization { return( shift->_set_get_scalar_or_object( 'authorization', 'Net::API::Stripe::Issuing::Authorization', @_ ) ); }
30              
31 0     0 1   sub balance_transaction { return( shift->_set_get_scalar_or_object( 'balance_transaction', 'Net::API::Stripe::Balance::Transaction', @_ ) ); }
32              
33 0     0 1   sub card { return( shift->_set_get_scalar_or_object( 'card', 'Net::API::Stripe::Issuing::Card', @_ ) ); }
34              
35 0     0 1   sub cardholder { return( shift->_set_get_scalar_or_object( 'cardholder', 'Net::API::Stripe::Issuing::Card::Holder', @_ ) ); }
36              
37 0     0 1   sub created { return( shift->_set_get_datetime( 'created', @_ ) ); }
38              
39 0     0 1   sub currency { return( shift->_set_get_scalar( 'currency', @_ ) ); }
40              
41 0     0 1   sub dispute { return( shift->_set_get_scalar_or_object( 'dispute', 'Net::API::Stripe::Issuing::Dispute', @_ ) ); }
42              
43 0     0 1   sub livemode { return( shift->_set_get_scalar( 'livemode', @_ ) ); }
44              
45 0     0 1   sub merchant_amount { return( shift->_set_get_number( 'merchant_amount', @_ ) ); }
46              
47 0     0 1   sub merchant_currency { return( shift->_set_get_scalar( 'merchant_currency', @_ ) ); }
48              
49 0     0 1   sub merchant_data { return( shift->_set_get_object( 'merchant_data', 'Net::API::Stripe::Issuing::MerchantData', @_ ) ); }
50              
51 0     0 1   sub metadata { return( shift->_set_get_hash( 'metadata', @_ ) ); }
52              
53 0     0 1   sub type { return( shift->_set_get_scalar( 'type', @_ ) ); }
54              
55             1;
56              
57             __END__
58              
59             =encoding utf8
60              
61             =head1 NAME
62              
63             Net::API::Stripe::Issuing::Authorization::Transaction - A Stripe Authorization Transaction Object
64              
65             =head1 SYNOPSIS
66              
67             my $tr = $stripe->issuing_transaction({
68             amount => 2000,
69             authorization => $authorization_object,
70             card => $card_object,
71             cardholder => $cardholder_object,
72             currency => 'jpy',
73             merchant_amount => 2000,
74             merchant_currency => 'jpy',
75             merchant_data => $merchant_data_object,
76             metadata => { transaction_id => 123 },
77             type => 'capture',
78             });
79              
80             See documentation in L<Net::API::Stripe> for example to make api calls to Stripe to create those objects.
81              
82             =head1 VERSION
83              
84             v0.100.0
85              
86             =head1 DESCRIPTION
87              
88             No documentation on Stripe.com.
89              
90             This is instantiated by method B<transactions> in module L<Net::API::Stripe::Issuing::Authorization>
91              
92             =head1 CONSTRUCTOR
93              
94             =head2 new( %ARG )
95              
96             Creates a new L<Net::API::Stripe::Issuing::Authorization::Transaction> object.
97             It may also take an hash like arguments, that also are method of the same name.
98              
99             =head1 METHODS
100              
101             =head2 id string
102              
103             Unique identifier for the object.
104              
105             =head2 object string, value is "issuing.transaction"
106              
107             String representing the object’s type. Objects of the same type share the same value.
108              
109             =head2 amount integer
110              
111             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>.
112              
113             =head2 authorization string (expandable)
114              
115             The Authorization object that led to this transaction.
116              
117             When expanded, this is a L<Net::API::Stripe::Issuing::Authorization> object.
118              
119             =head2 balance_transaction string (expandable)
120              
121             When expanded, this is a L<Net::API::Stripe::Balance::Transaction> object.
122              
123             =head2 card string (expandable)
124              
125             The card used to make this transaction.
126              
127             When expanded, this is a L<Net::API::Stripe::Issuing::Card> object.
128              
129             =head2 cardholder string (expandable)
130              
131             The cardholder to whom this transaction belongs.
132              
133             When expanded, this is a L<Net::API::Stripe::Issuing::Card::Holder> object.
134              
135             =head2 created timestamp
136              
137             Time at which the object was created. Measured in seconds since the Unix epoch.
138              
139             =head2 currency currency
140              
141             Three-letter ISO currency code, in lowercase. Must be a supported currency.
142              
143             =head2 dispute string (expandable)
144              
145             When expanded, this is a L<Net::API::Stripe::Issuing::Dispute> object.
146              
147             =head2 livemode boolean
148              
149             Has the value true if the object exists in live mode or the value false if the object exists in test mode.
150              
151             =head2 merchant_amount integer
152              
153             The amount that the merchant will receive, denominated in L</merchant_currency> and in the L<smallest currency unit|https://stripe.com/docs/currencies#zero-decimal>. It will be different from L</amount> if the merchant is taking payment in a different currency.
154              
155             =head2 merchant_currency currency
156              
157             The currency with which the merchant is taking payment.
158              
159             =head2 merchant_data hash
160              
161             More information about the user involved in the transaction.
162              
163             This is a L<Net::API::Stripe::Issuing::MerchantData> object.
164              
165             =head2 metadata hash
166              
167             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.
168              
169             =head2 type string
170              
171             One of capture, refund, cash_withdrawal, refund_reversal, dispute, or dispute_loss.
172              
173             =head1 API SAMPLE
174              
175             {
176             "id": "iauth_fake123456789",
177             "object": "issuing.authorization",
178             "approved": true,
179             "authorization_method": "online",
180             "authorized_amount": 500,
181             "authorized_currency": "usd",
182             "balance_transactions": [],
183             "card": null,
184             "cardholder": null,
185             "created": 1540642827,
186             "held_amount": 0,
187             "held_currency": "usd",
188             "is_held_amount_controllable": false,
189             "livemode": false,
190             "merchant_data": {
191             "category": "taxicabs_limousines",
192             "city": "San Francisco",
193             "country": "US",
194             "name": "Rocket Rides",
195             "network_id": "1234567890",
196             "postal_code": "94107",
197             "state": "CA",
198             "url": null
199             },
200             "metadata": {},
201             "pending_authorized_amount": 0,
202             "pending_held_amount": 0,
203             "request_history": [],
204             "status": "reversed",
205             "transactions": [
206             {
207             "id": "ipi_fake123456789",
208             "object": "issuing.transaction",
209             "amount": -100,
210             "authorization": "iauth_fake123456789",
211             "balance_transaction": null,
212             "card": "ic_fake123456789",
213             "cardholder": null,
214             "created": 1540642827,
215             "currency": "usd",
216             "dispute": null,
217             "livemode": false,
218             "merchant_amount": null,
219             "merchant_currency": null,
220             "merchant_data": {
221             "category": "taxicabs_limousines",
222             "city": "San Francisco",
223             "country": "US",
224             "name": "Rocket Rides",
225             "network_id": "1234567890",
226             "postal_code": "94107",
227             "state": "CA",
228             "url": null
229             },
230             "metadata": {},
231             "type": "capture"
232             },
233             {
234             "id": "ipi_fake123456789",
235             "object": "issuing.transaction",
236             "amount": -100,
237             "authorization": "iauth_fake123456789",
238             "balance_transaction": null,
239             "card": "ic_fake123456789",
240             "cardholder": null,
241             "created": 1540642827,
242             "currency": "usd",
243             "dispute": null,
244             "livemode": false,
245             "merchant_amount": null,
246             "merchant_currency": null,
247             "merchant_data": {
248             "category": "taxicabs_limousines",
249             "city": "San Francisco",
250             "country": "US",
251             "name": "Rocket Rides",
252             "network_id": "1234567890",
253             "postal_code": "94107",
254             "state": "CA",
255             "url": null
256             },
257             "metadata": {},
258             "type": "capture"
259             }
260             ],
261             "verification_data": {
262             "address_line1_check": "not_provided",
263             "address_zip_check": "match",
264             "authentication": "none",
265             "cvc_check": "match"
266             },
267             "wallet_provider": null
268             }
269              
270             =head1 HISTORY
271              
272             =head2 v0.1
273              
274             Initial version
275              
276             =head1 AUTHOR
277              
278             Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
279              
280             =head1 SEE ALSO
281              
282             Stripe API documentation:
283              
284             L<https://stripe.com/docs/api/issuing/transactions>, L<https://stripe.com/docs/api/issuing/authorizations/object>
285              
286             =head1 COPYRIGHT & LICENSE
287              
288             Copyright (c) 2019-2020 DEGUEST Pte. Ltd.
289              
290             You can use, copy, modify and redistribute this package and associated
291             files under the same terms as Perl itself.
292              
293             =cut