File Coverage

blib/lib/Net/Stripe/PaymentIntent.pm
Criterion Covered Total %
statement 12 15 80.0
branch 0 2 0.0
condition n/a
subroutine 4 5 80.0
pod n/a
total 16 22 72.7


line stmt bran cond sub pod time code
1             package Net::Stripe::PaymentIntent;
2             $Net::Stripe::PaymentIntent::VERSION = '0.42';
3 2     2   17 use Moose;
  2         5  
  2         17  
4 2     2   14933 use Moose::Util::TypeConstraints qw(enum);
  2         6  
  2         22  
5 2     2   1032 use Kavorka;
  2         4  
  2         18  
6             extends 'Net::Stripe::Resource';
7              
8             # ABSTRACT: represent an PaymentIntent object from Stripe
9              
10             # Args for posting to PaymentIntent endpoints
11             has 'amount' => (is => 'ro', isa => 'Maybe[Int]');
12             has 'amount_to_capture' => (is => 'ro', isa => 'Maybe[Int]');
13             has 'application_fee_amount' => (is => 'ro', isa => 'Maybe[Int]');
14             has 'cancellation_reason' => (is => 'ro', isa => 'Maybe[StripeCancellationReason]');
15             has 'capture_method' => (is => 'ro', isa => 'Maybe[StripeCaptureMethod]');
16             has 'client_secret' => (is => 'ro', isa => 'Maybe[Str]');
17             has 'confirm' => (is => 'ro', isa => 'Maybe[Bool]');
18             has 'confirmation_method' => (is => 'ro', isa => 'Maybe[StripeConfirmationMethod]');
19             has 'currency' => (is => 'ro', isa => 'Maybe[Str]');
20             has 'customer' => (is => 'ro', isa => 'Maybe[StripeCustomerId]');
21             has 'description' => (is => 'ro', isa => 'Maybe[Str]');
22             has 'error_on_requires_action' => (is => 'ro', isa => 'Maybe[Bool]');
23             has 'mandate' => (is => 'ro', isa => 'Maybe[Str]');
24             has 'mandate_data' => (is => 'ro', isa => 'Maybe[HashRef]');
25             has 'metadata' => (is => 'ro', isa => 'Maybe[HashRef[Str]|EmptyStr]');
26             has 'off_session' => (is => 'ro', isa => 'Maybe[Bool]');
27             has 'on_behalf_of' => (is => 'ro', isa => 'Maybe[Str]');
28             has 'payment_method' => (is => 'ro', isa => 'Maybe[StripePaymentMethodId]');
29             has 'payment_method_options' => (is => 'ro', isa => 'Maybe[HashRef]');
30             has 'payment_method_types' => (is => 'ro', isa => 'Maybe[ArrayRef[StripePaymentMethodType]]');
31             has 'receipt_email' => (is => 'ro', isa => 'Maybe[Str]');
32             has 'return_url' => (is => 'ro', isa => 'Maybe[Str]');
33             has 'save_payment_method' => (is => 'ro', isa => 'Maybe[Bool]');
34             has 'setup_future_usage' => (is => 'ro', isa => 'Maybe[Str]');
35             has 'shipping' => (is => 'ro', isa => 'Maybe[HashRef]');
36             has 'statement_descriptor' => (is => 'ro', isa => 'Maybe[Str]');
37             has 'statement_descriptor_suffix' => (is => 'ro', isa => 'Maybe[Str]');
38             has 'transfer_data' => (is => 'ro', isa => 'Maybe[HashRef]');
39             has 'transfer_group' => (is => 'ro', isa => 'Maybe[Str]');
40             has 'use_stripe_sdk' => (is => 'ro', isa => 'Maybe[Bool]');
41              
42             # Args returned by the API
43             has 'id' => (is => 'ro', isa => 'StripePaymentIntentId');
44             has 'amount_capturable' => (is => 'ro', isa => 'Int');
45             has 'amount_received' => (is => 'ro', isa => 'Int');
46             has 'application' => (is => 'ro', isa => 'Maybe[Str]');
47             has 'cancellation_reason' => (is => 'ro', isa => 'Maybe[StripeCancellationReason]');
48             has 'canceled_at' => (is => 'ro', isa => 'Maybe[Int]');
49             has 'charges' => (is => 'ro', isa => 'Net::Stripe::List');
50             has 'client_secret' => (is => 'ro', isa => 'Maybe[Str]');
51             has 'created' => (is => 'ro', isa => 'Int');
52             has 'invoice' => (is => 'ro', isa => 'Maybe[Str]');
53             has 'last_payment_error' => (is => 'ro', isa => 'Maybe[HashRef]');
54             has 'livemode' => (is => 'ro', isa => 'Bool');
55             has 'next_action' => (is => 'ro', isa => 'Maybe[HashRef]');
56             has 'review' => (is => 'ro', isa => 'Maybe[Str]');
57             has 'status' => (is => 'ro', isa => 'Str');
58              
59 2 0   2   5636 method form_fields {
  2     0   6  
  2         419  
  0            
  0            
60 0           return $self->form_fields_for(qw/
61             amount amount_to_capture application_fee_amount cancellation_reason
62             capture_method client_secret confirm confirmation_method currency
63             customer description error_on_requires_action expand mandate
64             mandate_data metadata off_session on_behalf_of payment_method
65             payment_method_options payment_method_types receipt_email return_url
66             save_payment_method setup_future_usage shipping statement_descriptor
67             statement_descriptor_suffix transfer_data transfer_group use_stripe_sdk
68             /);
69             }
70              
71             __PACKAGE__->meta->make_immutable;
72             1;
73              
74             __END__
75              
76             =pod
77              
78             =head1 NAME
79              
80             Net::Stripe::PaymentIntent - represent an PaymentIntent object from Stripe
81              
82             =head1 VERSION
83              
84             version 0.42
85              
86             =head1 ATTRIBUTES
87              
88             =head2 amount
89              
90             Reader: amount
91              
92             Type: Maybe[Int]
93              
94             =head2 amount_capturable
95              
96             Reader: amount_capturable
97              
98             Type: Int
99              
100             =head2 amount_received
101              
102             Reader: amount_received
103              
104             Type: Int
105              
106             =head2 amount_to_capture
107              
108             Reader: amount_to_capture
109              
110             Type: Maybe[Int]
111              
112             =head2 application
113              
114             Reader: application
115              
116             Type: Maybe[Str]
117              
118             =head2 application_fee_amount
119              
120             Reader: application_fee_amount
121              
122             Type: Maybe[Int]
123              
124             =head2 boolean_attributes
125              
126             Reader: boolean_attributes
127              
128             Type: ArrayRef[Str]
129              
130             =head2 canceled_at
131              
132             Reader: canceled_at
133              
134             Type: Maybe[Int]
135              
136             =head2 cancellation_reason
137              
138             Reader: cancellation_reason
139              
140             Type: Maybe[StripeCancellationReason]
141              
142             =head2 capture_method
143              
144             Reader: capture_method
145              
146             Type: Maybe[StripeCaptureMethod]
147              
148             =head2 charges
149              
150             Reader: charges
151              
152             Type: Net::Stripe::List
153              
154             =head2 client_secret
155              
156             Reader: client_secret
157              
158             Type: Maybe[Str]
159              
160             =head2 confirm
161              
162             Reader: confirm
163              
164             Type: Maybe[Bool]
165              
166             =head2 confirmation_method
167              
168             Reader: confirmation_method
169              
170             Type: Maybe[StripeConfirmationMethod]
171              
172             =head2 created
173              
174             Reader: created
175              
176             Type: Int
177              
178             =head2 currency
179              
180             Reader: currency
181              
182             Type: Maybe[Str]
183              
184             =head2 customer
185              
186             Reader: customer
187              
188             Type: Maybe[StripeCustomerId]
189              
190             =head2 description
191              
192             Reader: description
193              
194             Type: Maybe[Str]
195              
196             =head2 error_on_requires_action
197              
198             Reader: error_on_requires_action
199              
200             Type: Maybe[Bool]
201              
202             =head2 id
203              
204             Reader: id
205              
206             Type: StripePaymentIntentId
207              
208             =head2 invoice
209              
210             Reader: invoice
211              
212             Type: Maybe[Str]
213              
214             =head2 last_payment_error
215              
216             Reader: last_payment_error
217              
218             Type: Maybe[HashRef]
219              
220             =head2 livemode
221              
222             Reader: livemode
223              
224             Type: Bool
225              
226             =head2 mandate
227              
228             Reader: mandate
229              
230             Type: Maybe[Str]
231              
232             =head2 mandate_data
233              
234             Reader: mandate_data
235              
236             Type: Maybe[HashRef]
237              
238             =head2 metadata
239              
240             Reader: metadata
241              
242             Type: Maybe[EmptyStr|HashRef[Str]]
243              
244             =head2 next_action
245              
246             Reader: next_action
247              
248             Type: Maybe[HashRef]
249              
250             =head2 off_session
251              
252             Reader: off_session
253              
254             Type: Maybe[Bool]
255              
256             =head2 on_behalf_of
257              
258             Reader: on_behalf_of
259              
260             Type: Maybe[Str]
261              
262             =head2 payment_method
263              
264             Reader: payment_method
265              
266             Type: Maybe[StripePaymentMethodId]
267              
268             =head2 payment_method_options
269              
270             Reader: payment_method_options
271              
272             Type: Maybe[HashRef]
273              
274             =head2 payment_method_types
275              
276             Reader: payment_method_types
277              
278             Type: Maybe[ArrayRef[StripePaymentMethodType]]
279              
280             =head2 receipt_email
281              
282             Reader: receipt_email
283              
284             Type: Maybe[Str]
285              
286             =head2 return_url
287              
288             Reader: return_url
289              
290             Type: Maybe[Str]
291              
292             =head2 review
293              
294             Reader: review
295              
296             Type: Maybe[Str]
297              
298             =head2 save_payment_method
299              
300             Reader: save_payment_method
301              
302             Type: Maybe[Bool]
303              
304             =head2 setup_future_usage
305              
306             Reader: setup_future_usage
307              
308             Type: Maybe[Str]
309              
310             =head2 shipping
311              
312             Reader: shipping
313              
314             Type: Maybe[HashRef]
315              
316             =head2 statement_descriptor
317              
318             Reader: statement_descriptor
319              
320             Type: Maybe[Str]
321              
322             =head2 statement_descriptor_suffix
323              
324             Reader: statement_descriptor_suffix
325              
326             Type: Maybe[Str]
327              
328             =head2 status
329              
330             Reader: status
331              
332             Type: Str
333              
334             =head2 transfer_data
335              
336             Reader: transfer_data
337              
338             Type: Maybe[HashRef]
339              
340             =head2 transfer_group
341              
342             Reader: transfer_group
343              
344             Type: Maybe[Str]
345              
346             =head2 use_stripe_sdk
347              
348             Reader: use_stripe_sdk
349              
350             Type: Maybe[Bool]
351              
352             =head1 AUTHORS
353              
354             =over 4
355              
356             =item *
357              
358             Luke Closs
359              
360             =item *
361              
362             Rusty Conover
363              
364             =back
365              
366             =head1 COPYRIGHT AND LICENSE
367              
368             This software is copyright (c) 2015 by Prime Radiant, Inc., (c) copyright 2014 Lucky Dinosaur LLC.
369              
370             This is free software; you can redistribute it and/or modify it under
371             the same terms as the Perl 5 programming language system itself.
372              
373             =cut