« lib/WebService/Braintree/MerchantAccountGateway.pm
↑ Summary
lib/WebService/Braintree/Validations.pm »
| 1 | # vim: sw=4 ts=4 ft=perl | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | package # hide from pause | ||||||||||||||||||||||||||||
| 4 | WebService::Braintree::AddressGateway; | ||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 22 | ▶ | use 5.010_001; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 22 | ▶ | use strictures 1; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 22 | ▶ | use Moo; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | 22 | with 'WebService::Braintree::Role::MakeRequest'; | |||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 22 | ▶ | use Carp qw(confess); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | 22 | ▶ | use WebService::Braintree::Util qw(validate_id); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 15 | 22 | ▶ | use WebService::Braintree::Validations qw(verify_params address_signature); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | 22 | ▶ | use WebService::Braintree::_::Address; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | 1 | ▶ | sub create { | ||||||||||||||||||||||||||
|
Subroutine
create: called CC=2 SCAR=7.6
Pod
undocumented
| |||||||||||||||||||||||||||||
| 20 | 1 | my($self, $params) = @_; | |||||||||||||||||||||||||||
| 21 | 1 | my $customer_id = delete($params->{'customer_id'}); | |||||||||||||||||||||||||||
| 22 | 1 | ▶ | confess "ArgumentError" unless verify_params($params, address_signature()); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 23 | 0 | $self->_make_request("/customers/$customer_id/addresses", "post", {address => $params}); | |||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | 4 | ▶ | sub find { | ||||||||||||||||||||||||||
|
Subroutine
find: called CC=3 SCAR=12.5
Pod
undocumented
| |||||||||||||||||||||||||||||
| 27 | 4 | my ($self, $customer_id, $address_id) = @_; | |||||||||||||||||||||||||||
| 28 | 4 | ▶ | confess "NotFoundError" unless validate_id($address_id) && validate_id($customer_id); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
validate_id($address_id) and validate_id($customer_id)
MC/DC0%0/2
validate_id($address_id) and validate_id($customer_id)
validate_id($address_id)
validate_id($customer_id)
Truth table66%2/3
A and B
A= validate_id($address_id)B= validate_id($customer_id)
| |||||||||||||||||||||||||||||
| 29 | 0 | $self->_make_request("/customers/$customer_id/addresses/$address_id", "get")->address; | |||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | 0 | ▶ | sub update { | ||||||||||||||||||||||||||
|
Subroutine
update: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 33 | 0 | my ($self, $customer_id, $address_id, $params) = @_; | |||||||||||||||||||||||||||
| 34 | 0 | ▶ | confess "ArgumentError" unless verify_params($params, address_signature()); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 35 | 0 | $self->_make_request("/customers/$customer_id/addresses/$address_id", "put", {address => $params}); | |||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | 0 | ▶ | sub delete { | ||||||||||||||||||||||||||
|
Subroutine
delete: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||
| 39 | 0 | my ($self, $customer_id, $address_id) = @_; | |||||||||||||||||||||||||||
| 40 | 0 | ▶ | confess "NotFoundError" unless validate_id($address_id) && validate_id($customer_id); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
validate_id($address_id) and validate_id($customer_id)
MC/DC0%0/2
validate_id($address_id) and validate_id($customer_id)
validate_id($address_id)
validate_id($customer_id)
Truth table0%0/3
A and B
A= validate_id($address_id)B= validate_id($customer_id)
| |||||||||||||||||||||||||||||
| 41 | 0 | $self->_make_request("/customers/$customer_id/addresses/$address_id", "delete"); | |||||||||||||||||||||||||||
| 42 | } | ||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | 22 | __PACKAGE__->meta->make_immutable; | |||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | 22 | 1; | |||||||||||||||||||||||||||
| 47 | __END__ | ||||||||||||||||||||||||||||