line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::Iugu::PaymentMethods; |
2
|
|
|
|
|
|
|
$Net::Iugu::PaymentMethods::VERSION = '0.000002'; |
3
|
8
|
|
|
8
|
|
33
|
use Moo; |
|
8
|
|
|
|
|
10
|
|
|
8
|
|
|
|
|
60
|
|
4
|
|
|
|
|
|
|
extends 'Net::Iugu::CRUD'; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub create { |
7
|
0
|
|
|
0
|
1
|
|
my ( $self, $customer_id, $data ) = @_; |
8
|
|
|
|
|
|
|
|
9
|
0
|
|
|
|
|
|
my $uri = $self->_uri($customer_id); |
10
|
|
|
|
|
|
|
|
11
|
0
|
|
|
|
|
|
return $self->request( POST => $uri, $data ); |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub read { |
15
|
0
|
|
|
0
|
1
|
|
my ( $self, $customer_id, $payment_method_id ) = @_; |
16
|
|
|
|
|
|
|
|
17
|
0
|
|
|
|
|
|
my $uri = $self->_uri( $customer_id, $payment_method_id ); |
18
|
|
|
|
|
|
|
|
19
|
0
|
|
|
|
|
|
return $self->request( GET => $uri ); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub update { |
23
|
0
|
|
|
0
|
1
|
|
my ( $self, $customer_id, $payment_method_id, $data ) = @_; |
24
|
|
|
|
|
|
|
|
25
|
0
|
|
|
|
|
|
my $uri = $self->_uri( $customer_id, $payment_method_id ); |
26
|
|
|
|
|
|
|
|
27
|
0
|
|
|
|
|
|
return $self->request( PUT => $uri, $data ); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub delete { |
31
|
0
|
|
|
0
|
1
|
|
my ( $self, $customer_id, $payment_method_id ) = @_; |
32
|
|
|
|
|
|
|
|
33
|
0
|
|
|
|
|
|
my $uri = $self->_uri( $customer_id, $payment_method_id ); |
34
|
|
|
|
|
|
|
|
35
|
0
|
|
|
|
|
|
return $self->request( DELETE => $uri ); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub list { |
39
|
0
|
|
|
0
|
1
|
|
my ( $self, $customer_id ) = @_; |
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
|
|
|
my $uri = $self->_uri($customer_id); |
42
|
|
|
|
|
|
|
|
43
|
0
|
|
|
|
|
|
return $self->request( GET => $uri ); |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub _uri { |
47
|
0
|
|
|
0
|
|
|
my ( $self, $customer_id, $payment_method_id ) = @_; |
48
|
|
|
|
|
|
|
|
49
|
0
|
|
|
|
|
|
my @parts = ( |
50
|
|
|
|
|
|
|
$self->base_uri, ## |
51
|
|
|
|
|
|
|
'customers', ## |
52
|
|
|
|
|
|
|
$customer_id, ## |
53
|
|
|
|
|
|
|
'payment_methods', ## |
54
|
|
|
|
|
|
|
$payment_method_id, ## |
55
|
|
|
|
|
|
|
); |
56
|
|
|
|
|
|
|
|
57
|
0
|
|
|
|
|
|
return join '/', grep { !!$_ } @parts; |
|
0
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
1; |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
# ABSTRACT: Net::Iugu::PaymentMethods - Methods to manage payment methods |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
__END__ |