| 1 | package Net::Braintree::PaymentMethodGateway; | ||||||||||||||||||||||||||||
| 2 | 1 | ▶ | use Moose; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use Carp qw(confess); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | 1 | has 'gateway' => (is => 'ro'); | |||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 0 | ▶ | sub create { | ||||||||||||||||||||||||||
|
Subroutine
create: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 8 | 0 | my ($self, $params) = @_; | |||||||||||||||||||||||||||
| 9 | 0 | $self->_make_request("/payment_methods", 'post', {payment_method => $params}); | |||||||||||||||||||||||||||
| 10 | } | ||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 0 | ▶ | sub update { | ||||||||||||||||||||||||||
|
Subroutine
update: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 13 | 0 | my ($self, $token, $params) = @_; | |||||||||||||||||||||||||||
| 14 | 0 | $self->_make_request("/payment_methods/any/" . $token, "put", {payment_method => $params}); | |||||||||||||||||||||||||||
| 15 | } | ||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | 0 | ▶ | sub delete { | ||||||||||||||||||||||||||
|
Subroutine
delete: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 18 | 0 | my ($self, $token) = @_; | |||||||||||||||||||||||||||
| 19 | 0 | $self->_make_request("/payment_methods/any/" . $token, 'delete'); | |||||||||||||||||||||||||||
| 20 | } | ||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | 0 | ▶ | sub find { | ||||||||||||||||||||||||||
|
Subroutine
find: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||
| 23 | 0 | my ($self, $token) = @_; | |||||||||||||||||||||||||||
| 24 | 0 | ▶ | if (!defined($token) || Net::Braintree::Util::trim($token) eq "") { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
not defined $token or Net::Braintree::Util::trim($token) eq ""
MC/DC0%0/2
not defined $token or Net::Braintree::Util::trim($token) eq ""
not defined $token
Net::Braintree::Util::trim($token) eq ""
Truth table0%0/3
not(A) or B
A= not defined $tokenB= Net::Braintree::Util::trim($token) eq ""
| |||||||||||||||||||||||||||||
| 25 | 0 | confess "NotFoundError"; | |||||||||||||||||||||||||||
| 26 | } | ||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | 0 | my $response = $self->_make_request("/payment_methods/any/" . $token, 'get'); | |||||||||||||||||||||||||||
| 29 | 0 | return $response->payment_method; | |||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | 0 | ▶ | sub _make_request { | ||||||||||||||||||||||||||
|
Subroutine
_make_request: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 33 | 0 | my ($self, $path, $verb, $params) = @_; | |||||||||||||||||||||||||||
| 34 | 0 | my $response = $self->gateway->http->$verb($path, $params); | |||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | 0 | return Net::Braintree::Result->new(response => $response); | |||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | 1 | 1; | |||||||||||||||||||||||||||