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