File Coverage

blib/lib/Net/Stripe/Charge.pm
Criterion Covered Total %
statement 9 12 75.0
branch 0 2 0.0
condition n/a
subroutine 3 4 75.0
pod n/a
total 12 18 66.6


line stmt bran cond sub pod time code
1             package Net::Stripe::Charge;
2             $Net::Stripe::Charge::VERSION = '0.41';
3 2     2   16 use Moose;
  2         5  
  2         16  
4 2     2   15067 use Kavorka;
  2         4  
  2         19  
5             extends 'Net::Stripe::Resource';
6              
7             # ABSTRACT: represent an Charge object from Stripe
8              
9             has 'id' => (is => 'ro', isa => 'Maybe[Str]');
10             has 'created' => (is => 'ro', isa => 'Maybe[Int]');
11             has 'amount' => (is => 'ro', isa => 'Maybe[Int]', required => 1);
12             has 'currency' => (is => 'ro', isa => 'Maybe[Str]', required => 1);
13             has 'customer' => (is => 'ro', isa => 'Maybe[StripeCustomerId]');
14             has 'card' => (is => 'ro', isa => 'Maybe[Net::Stripe::Card|StripeTokenId|StripeCardId]');
15             has 'source' => (is => 'ro', isa => 'Maybe[Net::Stripe::Card|Net::Stripe::Source|StripeTokenId|StripeCardId|StripeSourceId]');
16             has 'description' => (is => 'ro', isa => 'Maybe[Str]');
17             has 'livemode' => (is => 'ro', isa => 'Maybe[Bool|Object]');
18             has 'paid' => (is => 'ro', isa => 'Maybe[Bool|Object]');
19             has 'refunded' => (is => 'ro', isa => 'Maybe[Bool|Object]');
20             has 'amount_refunded' => (is => 'ro', isa => 'Maybe[Int]');
21             has 'captured' => (is => 'ro', isa => 'Maybe[Bool|Object]');
22             has 'balance_transaction' => (is => 'ro', isa => 'Maybe[Str]');
23             has 'failure_message' => (is => 'ro', isa => 'Maybe[Str]');
24             has 'failure_code' => (is => 'ro', isa => 'Maybe[Str]');
25             has 'application_fee' => (is => 'ro', isa => 'Maybe[Int]');
26             has 'metadata' => (is => 'rw', isa => 'Maybe[HashRef]');
27             has 'invoice' => (is => 'ro', isa => 'Maybe[Str]');
28             has 'receipt_email' => (is => 'ro', isa => 'Maybe[Str]');
29             has 'status' => (is => 'ro', isa => 'Maybe[Str]');
30             has 'capture' => (is => 'ro', isa => 'Bool', default=> 1);
31             has 'statement_descriptor' => (is => 'ro', isa => 'Maybe[Str]');
32             has 'refunds' => (is => 'ro', isa => 'Net::Stripe::List');
33              
34 2 0   2   5165 method form_fields {
  2     0   6  
  2         365  
  0            
  0            
35 0           return $self->form_fields_for(
36             qw/amount currency customer description application_fee receipt_email
37             capture statement_descriptor card source metadata/
38             );
39             }
40              
41             __PACKAGE__->meta->make_immutable;
42             1;
43              
44             __END__
45              
46             =pod
47              
48             =head1 NAME
49              
50             Net::Stripe::Charge - represent an Charge object from Stripe
51              
52             =head1 VERSION
53              
54             version 0.41
55              
56             =head1 ATTRIBUTES
57              
58             =head2 amount
59              
60             Reader: amount
61              
62             Type: Maybe[Int]
63              
64             This attribute is required.
65              
66             =head2 amount_refunded
67              
68             Reader: amount_refunded
69              
70             Type: Maybe[Int]
71              
72             =head2 application_fee
73              
74             Reader: application_fee
75              
76             Type: Maybe[Int]
77              
78             =head2 balance_transaction
79              
80             Reader: balance_transaction
81              
82             Type: Maybe[Str]
83              
84             =head2 boolean_attributes
85              
86             Reader: boolean_attributes
87              
88             Type: ArrayRef[Str]
89              
90             =head2 capture
91              
92             Reader: capture
93              
94             Type: Bool
95              
96             =head2 captured
97              
98             Reader: captured
99              
100             Type: Maybe[Bool|Object]
101              
102             =head2 card
103              
104             Reader: card
105              
106             Type: Maybe[Net::Stripe::Card|StripeCardId|StripeTokenId]
107              
108             =head2 created
109              
110             Reader: created
111              
112             Type: Maybe[Int]
113              
114             =head2 currency
115              
116             Reader: currency
117              
118             Type: Maybe[Str]
119              
120             This attribute is required.
121              
122             =head2 customer
123              
124             Reader: customer
125              
126             Type: Maybe[StripeCustomerId]
127              
128             =head2 description
129              
130             Reader: description
131              
132             Type: Maybe[Str]
133              
134             =head2 failure_code
135              
136             Reader: failure_code
137              
138             Type: Maybe[Str]
139              
140             =head2 failure_message
141              
142             Reader: failure_message
143              
144             Type: Maybe[Str]
145              
146             =head2 id
147              
148             Reader: id
149              
150             Type: Maybe[Str]
151              
152             =head2 invoice
153              
154             Reader: invoice
155              
156             Type: Maybe[Str]
157              
158             =head2 livemode
159              
160             Reader: livemode
161              
162             Type: Maybe[Bool|Object]
163              
164             =head2 metadata
165              
166             Reader: metadata
167              
168             Writer: metadata
169              
170             Type: Maybe[HashRef]
171              
172             =head2 paid
173              
174             Reader: paid
175              
176             Type: Maybe[Bool|Object]
177              
178             =head2 receipt_email
179              
180             Reader: receipt_email
181              
182             Type: Maybe[Str]
183              
184             =head2 refunded
185              
186             Reader: refunded
187              
188             Type: Maybe[Bool|Object]
189              
190             =head2 refunds
191              
192             Reader: refunds
193              
194             Type: Net::Stripe::List
195              
196             =head2 source
197              
198             Reader: source
199              
200             Type: Maybe[Net::Stripe::Card|Net::Stripe::Source|StripeCardId|StripeSourceId|StripeTokenId]
201              
202             =head2 statement_descriptor
203              
204             Reader: statement_descriptor
205              
206             Type: Maybe[Str]
207              
208             =head2 status
209              
210             Reader: status
211              
212             Type: Maybe[Str]
213              
214             =head1 AUTHORS
215              
216             =over 4
217              
218             =item *
219              
220             Luke Closs
221              
222             =item *
223              
224             Rusty Conover
225              
226             =back
227              
228             =head1 COPYRIGHT AND LICENSE
229              
230             This software is copyright (c) 2015 by Prime Radiant, Inc., (c) copyright 2014 Lucky Dinosaur LLC.
231              
232             This is free software; you can redistribute it and/or modify it under
233             the same terms as the Perl 5 programming language system itself.
234              
235             =cut