File Coverage

lib/Net/API/Stripe/Issuing/Authorization/RequestHistory.pm
Criterion Covered Total %
statement 19 31 61.2
branch n/a
condition n/a
subroutine 7 19 36.8
pod 12 12 100.0
total 38 62 61.2


line stmt bran cond sub pod time code
1             ##----------------------------------------------------------------------------
2             ## Stripe API - ~/lib/Net/API/Stripe/Issuing/Authorization/RequestHistory.pm
3             ## Version v0.201.0
4             ## Copyright(c) 2020 DEGUEST Pte. Ltd.
5             ## Author: Jacques Deguest <jack@deguest.jp>
6             ## Created 2019/11/02
7             ## Modified 2020/11/29
8             ## All rights reserved
9             ##
10             ## This program is free software; you can redistribute it and/or modify it
11             ## under the same terms as Perl itself.
12             ##----------------------------------------------------------------------------
13             BEGIN
14             {
15             use strict;
16 1     1   1028 use warnings;
  1         2  
  1         31  
17 1     1   5 use parent qw( Net::API::Stripe::Generic );
  1         4  
  1         30  
18 1     1   5 use vars qw( $VERSION );
  1         3  
  1         5  
19 1     1   67 our( $VERSION ) = 'v0.201.0';
  1         3  
  1         49  
20 1     1   18 };
21              
22             use strict;
23 1     1   5 use warnings;
  1         2  
  1         18  
24 1     1   4  
  1         2  
  1         330  
25              
26 0     0 1   {
27             atm_fee => { type => "number" }
28 0     0 1   }, @_ ) ); }
29              
30              
31              
32              
33 0     0 1    
34              
35 0     0 1    
36              
37 0     0 1    
38              
39 0     0 1    
40             1;
41 0     0 1    
42              
43 0     0 1   =encoding utf8
44              
45 0     0 1   =head1 NAME
46              
47 0     0 1   Net::API::Stripe::Issuing::Authorization::RequestHistory - A Stripe Authorization History Request Object
48              
49 0     0 1   =head1 SYNOPSIS
50              
51 0     0 1   my $req_history = $stripe->authorization->req_history({
52             approved => $stripe->true,
53             authorized_amount => 2000,
54             authorized_currency => 'jpy',
55             created => '2020-04-12',
56             held_amount => 1000,
57             held_currency => 'jpy',
58             reason => 'webhook_declined',
59             });
60              
61             =head1 VERSION
62              
63             v0.201.0
64              
65             =head1 DESCRIPTION
66              
67             This is instantiated by method B<request_history> in module L<Net::API::Stripe::Issuing::Authorization>
68              
69             =head1 CONSTRUCTOR
70              
71             =head2 new( %ARG )
72              
73             Creates a new L<Net::API::Stripe::Issuing::Authorization::RequestHistory> object.
74             It may also take an hash like arguments, that also are method of the same name.
75              
76             =head1 METHODS
77              
78             =head2 amount integer
79              
80             The authorization amount in your card's currency and in the L<smallest currency unit|https://stripe.com/docs/currencies#zero-decimal>. Stripe held this amount from your account to fund the authorization if the request was approved.
81              
82             =head2 amount_details hash
83              
84             Detailed breakdown of amount components. These amounts are denominated in C<currency> and in the L<smallest currency unit|https://stripe.com/docs/currencies#zero-decimal>.
85              
86             It has the following properties:
87              
88             =over 4
89              
90             =item I<atm_fee> integer
91              
92             The fee charged by the ATM for the cash withdrawal.
93              
94             =back
95              
96             =head2 approved boolean
97              
98             Whether this request was approved.
99              
100             =head2 authorized_amount integer
101              
102             The amount that was authorized at the time of this request
103              
104             =head2 authorized_currency string
105              
106             The currency that was presented to the cardholder for the authorization. Three-letter ISO currency code, in lowercase. Must be a supported currency.
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 string
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 held_amount integer
117              
118             The amount Stripe held from your account to fund the authorization, if the request was approved
119              
120             =head2 held_currency string
121              
122             The currency of the held amount
123              
124             =head2 merchant_amount integer
125              
126             The amount that was authorized at the time of this request. This amount is in the C<merchant_currency> and in the L<smallest currency unit|https://stripe.com/docs/currencies#zero-decimal>.
127              
128             =head2 merchant_currency string
129              
130             The currency that was collected by the merchant and presented to the cardholder for the authorization. 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 reason string
133              
134             One of authentication_failed, authorization_controls, card_active, card_inactive, insufficient_funds, account_compliance_disabled, account_inactive, suspected_fraud, webhook_approved, webhook_declined, or webhook_timeout.
135              
136             =head1 API SAMPLE
137              
138             {
139             "id": "iauth_fake123456789",
140             "object": "issuing.authorization",
141             "approved": true,
142             "authorization_method": "online",
143             "authorized_amount": 500,
144             "authorized_currency": "usd",
145             "balance_transactions": [],
146             "card": null,
147             "cardholder": null,
148             "created": 1540642827,
149             "held_amount": 0,
150             "held_currency": "usd",
151             "is_held_amount_controllable": false,
152             "livemode": false,
153             "merchant_data": {
154             "category": "taxicabs_limousines",
155             "city": "San Francisco",
156             "country": "US",
157             "name": "Rocket Rides",
158             "network_id": "1234567890",
159             "postal_code": "94107",
160             "state": "CA",
161             "url": null
162             },
163             "metadata": {},
164             "pending_authorized_amount": 0,
165             "pending_held_amount": 0,
166             "request_history": [],
167             "status": "reversed",
168             "transactions": [
169             {
170             "id": "ipi_fake123456789",
171             "object": "issuing.transaction",
172             "amount": -100,
173             "authorization": "iauth_fake123456789",
174             "balance_transaction": null,
175             "card": "ic_fake123456789",
176             "cardholder": null,
177             "created": 1540642827,
178             "currency": "usd",
179             "dispute": null,
180             "livemode": false,
181             "merchant_amount": null,
182             "merchant_currency": null,
183             "merchant_data": {
184             "category": "taxicabs_limousines",
185             "city": "San Francisco",
186             "country": "US",
187             "name": "Rocket Rides",
188             "network_id": "1234567890",
189             "postal_code": "94107",
190             "state": "CA",
191             "url": null
192             },
193             "metadata": {},
194             "type": "capture"
195             },
196             {
197             "id": "ipi_fake123456789",
198             "object": "issuing.transaction",
199             "amount": -100,
200             "authorization": "iauth_fake123456789",
201             "balance_transaction": null,
202             "card": "ic_fake123456789",
203             "cardholder": null,
204             "created": 1540642827,
205             "currency": "usd",
206             "dispute": null,
207             "livemode": false,
208             "merchant_amount": null,
209             "merchant_currency": null,
210             "merchant_data": {
211             "category": "taxicabs_limousines",
212             "city": "San Francisco",
213             "country": "US",
214             "name": "Rocket Rides",
215             "network_id": "1234567890",
216             "postal_code": "94107",
217             "state": "CA",
218             "url": null
219             },
220             "metadata": {},
221             "type": "capture"
222             }
223             ],
224             "verification_data": {
225             "address_line1_check": "not_provided",
226             "address_zip_check": "match",
227             "authentication": "none",
228             "cvc_check": "match"
229             },
230             "wallet_provider": null
231             }
232              
233             =head1 HISTORY
234              
235             =head2 v0.1
236              
237             Initial version
238              
239             =head2 v0.2
240              
241             Change helper method for B<approved> from B<_set_get_scalar> to B<_set_get_boolean>
242              
243             =head1 AUTHOR
244              
245             Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
246              
247             =head1 SEE ALSO
248              
249             Stripe API documentation:
250              
251             L<https://stripe.com/docs/api>
252              
253             =head1 COPYRIGHT & LICENSE
254              
255             Copyright (c) 2019-2020 DEGUEST Pte. Ltd.
256              
257             You can use, copy, modify and redistribute this package and associated
258             files under the same terms as Perl itself.
259              
260             =cut