PayPal/Capture.pm

filter: Statementstmt 50.0% 10 / 20 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 22.2% 2 / 9 Podpod 100% 7 / 7 totaltotal 50.0% 19 / 38 CC 2 SCAR 9.6
CC
2
Cov
45%
fee_in_cent
6.0
id
2.0
status
2.0
CRAP 2.6
« PayPal/Order.pm ↑ Summary PayPal/Subscription.pm »
1 package WWW::PayPal::Capture;
2  
3 # ABSTRACT: PayPal Payments v2 capture entity
4  
5 3 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 3 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 3 our $VERSION = '0.003';
9  
10  
11 3 has _client => (
12 is => 'ro',
13 required => 1,
14 weak_ref => 1,
15 init_arg => 'client',
16 );
17  
18 3 has data => ( is => 'rw', required => 1 );
19  
20  
21 0 ▶sub id { $_[0]->data->{id} }
Subroutine id: not called CC=1 SCAR=6.9
Pod documented
22 0 ▶sub status { $_[0]->data->{status} }
Subroutine status: not called CC=1 SCAR=6.9
Pod documented
23 0 ▶sub amount { $_[0]->data->{amount}{value} }
Subroutine amount: not called CC=1 SCAR=6.9
Pod documented
24 0 ▶sub currency { $_[0]->data->{amount}{currency_code} }
Subroutine currency: not called CC=1 SCAR=6.9
Pod documented
25 0 ▶sub invoice_id { $_[0]->data->{invoice_id} }
Subroutine invoice_id: not called CC=1 SCAR=6.9
Pod documented
26  
27  
28 0 ▶sub fee_in_cent {
Subroutine fee_in_cent: not called CC=2 SCAR=17.9
Pod documented
29 0 my ($self) = @_;
30 0 ▶ my $fee = $self->data->{seller_receivable_breakdown}{paypal_fee}{value} or return;
Branch: 1 branch
BranchTrueFalseTotal
my $fee = $self->data->{"seller_receivable_breakdown"}{"paypal_fee"}{"value"} or return 0 0 0
31 0 return int($fee * 100 + 0.5);
32 }
33  
34  
35 0 ▶sub refund {
Subroutine refund: not called CC=1 SCAR=6.9
Pod documented
36 0 my ($self, %args) = @_;
37 0 return $self->_client->payments->refund($self->id, %args);
38 }
39  
40  
41  
42 3 1;
43  
44 __END__
« PayPal/Order.pm ↑ Summary PayPal/Subscription.pm »