| 1 | # vim: sw=4 ts=4 ft=perl | ||||||||||
| 2 | |||||||||||
| 3 | package # hide from pause | ||||||||||
| 4 | WebService::Braintree::CreditCardVerificationGateway; | ||||||||||
| 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 | 22 | with 'WebService::Braintree::Role::CollectionBuilder'; | |||||||||
| 12 | |||||||||||
| 13 | 22 | ▶ | use Carp qw(confess); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 14 | |||||||||||
| 15 | 22 | ▶ | use WebService::Braintree::Util qw(validate_id); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 16 | 22 | ▶ | use WebService::Braintree::Validations qw( | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 17 | verify_params | ||||||||||
| 18 | credit_card_verification_signature | ||||||||||
| 19 | 22 | ); | |||||||||
| 20 | |||||||||||
| 21 | 22 | ▶ | use WebService::Braintree::_::CreditCardVerification; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 22 | 22 | ▶ | use WebService::Braintree::CreditCardVerificationSearch; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 23 | |||||||||||
| 24 | 0 | ▶ | sub find { | ||||||||
|
Subroutine
find: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 25 | 0 | my ($self, $id) = @_; | |||||||||
| 26 | 0 | ▶ | confess "NotFoundError" unless validate_id($id); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 27 | 0 | $self->_make_request("/verifications/$id", "get", undef)->verification; | |||||||||
| 28 | } | ||||||||||
| 29 | |||||||||||
| 30 | 0 | ▶ | sub search { | ||||||||
|
Subroutine
search: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 31 | 0 | my ($self, $block) = @_; | |||||||||
| 32 | |||||||||||
| 33 | 0 | return $self->resource_collection({ | |||||||||
| 34 | ids_url => "/verifications/advanced_search_ids", | ||||||||||
| 35 | obj_url => "/verifications/advanced_search/", | ||||||||||
| 36 | inflate => [qw/credit_card_verifications verification _::CreditCardVerification/], | ||||||||||
| 37 | search => $block->(WebService::Braintree::CreditCardVerificationSearch->new), | ||||||||||
| 38 | }); | ||||||||||
| 39 | } | ||||||||||
| 40 | |||||||||||
| 41 | 0 | ▶ | sub all { | ||||||||
|
Subroutine
all: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 42 | 0 | my $self = shift; | |||||||||
| 43 | |||||||||||
| 44 | 0 | return $self->resource_collection({ | |||||||||
| 45 | ids_url => "/verifications/advanced_search_ids", | ||||||||||
| 46 | obj_url => "/verifications/advanced_search/", | ||||||||||
| 47 | inflate => [qw/credit_card_verifications verification _::CreditCardVerification/], | ||||||||||
| 48 | }); | ||||||||||
| 49 | } | ||||||||||
| 50 | |||||||||||
| 51 | 0 | ▶ | sub create { | ||||||||
|
Subroutine
create: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 52 | 0 | my ($self, $params) = @_; | |||||||||
| 53 | 0 | ▶ | confess "ArgumentError" unless verify_params($params, credit_card_verification_signature); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 54 | 0 | $self->_make_request("/verifications", "post", {verification => $params}); | |||||||||
| 55 | } | ||||||||||
| 56 | |||||||||||
| 57 | 22 | __PACKAGE__->meta->make_immutable; | |||||||||
| 58 | |||||||||||
| 59 | 22 | 1; | |||||||||
| 60 | __END__ | ||||||||||