| 1 | package Net::Braintree::CreditCardVerificationGateway; | ||||||||||
| 2 | 1 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 1 | ▶ | use Net::Braintree::CreditCardVerificationSearch; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use Net::Braintree::Util; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 1 | has 'gateway' => (is => 'ro'); | |||||||||
| 7 | |||||||||||
| 8 | 0 | ▶ | sub find { | ||||||||
|
Subroutine
find: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 9 | 0 | my ($self, $id) = @_; | |||||||||
| 10 | 0 | ▶ | confess "NotFoundError" unless validate_id($id); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 11 | 0 | my $response = $self->gateway->http->get("/verifications/$id"); | |||||||||
| 12 | 0 | return Net::Braintree::CreditCardVerification->new($response->{'verification'}); | |||||||||
| 13 | } | ||||||||||
| 14 | |||||||||||
| 15 | 0 | ▶ | sub search { | ||||||||
|
Subroutine
search: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 16 | 0 | my ($self, $block) = @_; | |||||||||
| 17 | 0 | my $search = Net::Braintree::CreditCardVerificationSearch->new; | |||||||||
| 18 | 0 | my $params = $block->($search)->to_hash; | |||||||||
| 19 | 0 | my $response = $self->gateway->http->post("/verifications/advanced_search_ids", {search => $params}); | |||||||||
| 20 | 0 | ▶ | return Net::Braintree::ResourceCollection->new()->init($response, sub { | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 21 | 0 | $self->fetch_verifications($search, shift); | |||||||||
| 22 | 0 | }); | |||||||||
| 23 | } | ||||||||||
| 24 | |||||||||||
| 25 | 0 | ▶ | sub all { | ||||||||
|
Subroutine
all: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 26 | 0 | my $self = shift; | |||||||||
| 27 | 0 | my $response = $self->gateway->http->post("/verifications/advanced_search_ids"); | |||||||||
| 28 | 0 | ▶ | return Net::Braintree::ResourceCollection->new()->init($response, sub { | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 29 | 0 | $self->fetch_verifications(Net::Braintree::CreditCardVerificationSearch->new, shift); | |||||||||
| 30 | 0 | }); | |||||||||
| 31 | } | ||||||||||
| 32 | |||||||||||
| 33 | 0 | ▶ | sub fetch_verifications { | ||||||||
|
Subroutine
fetch_verifications: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 34 | 0 | my ($self, $search, $ids) = @_; | |||||||||
| 35 | 0 | $search->ids->in($ids); | |||||||||
| 36 | 0 | ▶ | return [] if scalar @{$ids} == 0; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 37 | 0 | my $response = $self->gateway->http->post("/verifications/advanced_search/", {search => $search->to_hash}); | |||||||||
| 38 | 0 | my $attrs = $response->{'credit_card_verifications'}->{'verification'}; | |||||||||
| 39 | 0 | return to_instance_array($attrs, "Net::Braintree::CreditCardVerification"); | |||||||||
| 40 | } | ||||||||||
| 41 | |||||||||||
| 42 | 1 | 1; | |||||||||