File Coverage

blib/lib/Paymill/REST/Item/Refund.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 12 12 100.0


line stmt bran cond sub pod time code
1             package Paymill::REST::Item::Refund;
2              
3 9     9   6386 use Moose;
  9         31  
  9         79  
4 9     9   62270 use MooseX::Types::DateTime::ButMaintained qw(DateTime);
  9         24  
  9         131  
5              
6             has _factory => (is => 'ro', isa => 'Object');
7              
8             has id => (is => 'ro', isa => 'Str');
9             has amount => (is => 'ro', isa => 'Int', required => 1);
10             has status => (is => 'ro', isa => 'RefundStatus');
11             has description => (is => 'ro', isa => 'Undef|Str');
12             has livemode => (is => 'ro', isa => 'Bool');
13             has created_at => (is => 'ro', isa => DateTime, coerce => 1);
14             has updated_at => (is => 'ro', isa => DateTime, coerce => 1);
15             has app_id => (is => 'ro', isa => 'Undef|Str');
16              
17             has transaction => (
18             is => 'ro',
19             isa => 'Undef|Object|HashRef',
20             trigger => sub { Paymill::REST::TypesAndTriggers::item_from_hashref('transaction', @_) }
21             );
22              
23 9     9   19619 no Moose;
  9         34  
  9         64  
24             1;
25             __END__
26              
27             =encoding utf-8
28              
29             =head1 NAME
30              
31             Paymill::REST::Item::Refund - Item class for a refund
32              
33             =head1 SYNOPSIS
34              
35             my $refund_api = Paymill::REST::Refunds->new;
36             $refund = $refund_api->find('refund_lk2j34h5lk34h5lkjh2');
37              
38             say $refund->amount; # Prints amount of the refund
39              
40             =head1 DESCRIPTION
41              
42             Represents a refund with all attributes and all sub items.
43              
44             =head1 ATTRIBUTES
45              
46             =over 4
47              
48             =item id
49              
50             String containing the identifier of the client
51              
52             =item amount
53              
54             Integer containing the assigned amount
55              
56             =item description
57              
58             String containing the assigned description
59              
60             =item status
61              
62             String indicating the current status of the refund. Can be one of:
63              
64             =over
65              
66             =item *
67              
68             open
69              
70             =item *
71              
72             refunded
73              
74             =item *
75              
76             failed
77              
78             =back
79              
80             =item livemode
81              
82             Boolean indicating whether this refund has been made with the live keys or not
83              
84             =item created_at
85              
86             L<DateTime> object indicating the date of the creation as returned by the API
87              
88             =item updated_at
89              
90             L<DateTime> object indicating the date of the last update as returned by the API
91              
92             =item app_id
93              
94             String representing the app id that issued this transaction
95              
96             =back
97              
98             =head1 SUB ITEMS
99              
100             =over 4
101              
102             =item transaction
103              
104             A transaction object.
105              
106             See also L<Paymill::REST::Item::Transaction>.
107              
108             =back
109              
110             =head1 AVAILABLE OPERATIONS
111              
112             =over 4
113              
114             =item delete
115              
116             L<Paymill::REST::Operations::Delete>
117              
118             =back
119              
120             =head1 SEE ALSO
121              
122             L<Paymill::REST> for more documentation.
123              
124             =head1 AUTHOR
125              
126             Matthias Dietrich E<lt>perl@rainboxx.deE<gt>
127              
128             =head1 COPYRIGHT
129              
130             Copyright 2013 - Matthias Dietrich
131              
132             =head1 LICENSE
133              
134             This library is free software; you can redistribute it and/or modify
135             it under the same terms as Perl itself.