line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WebService::Braintree::CreditCardVerificationGateway; |
2
|
|
|
|
|
|
|
$WebService::Braintree::CreditCardVerificationGateway::VERSION = '0.94'; |
3
|
20
|
|
|
20
|
|
421
|
use 5.010_001; |
|
20
|
|
|
|
|
74
|
|
4
|
20
|
|
|
20
|
|
332
|
use strictures 1; |
|
20
|
|
|
|
|
144
|
|
|
20
|
|
|
|
|
784
|
|
5
|
|
|
|
|
|
|
|
6
|
20
|
|
|
20
|
|
2103
|
use Moose; |
|
20
|
|
|
|
|
274
|
|
|
20
|
|
|
|
|
4213
|
|
7
|
20
|
|
|
20
|
|
129291
|
use WebService::Braintree::CreditCardVerificationSearch; |
|
20
|
|
|
|
|
228
|
|
|
20
|
|
|
|
|
873
|
|
8
|
20
|
|
|
20
|
|
169
|
use WebService::Braintree::Util qw(validate_id to_instance_array); |
|
20
|
|
|
|
|
43
|
|
|
20
|
|
|
|
|
1365
|
|
9
|
20
|
|
|
20
|
|
125
|
use Carp qw(confess); |
|
20
|
|
|
|
|
42
|
|
|
20
|
|
|
|
|
7526
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
has 'gateway' => (is => 'ro'); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub find { |
14
|
0
|
|
|
0
|
0
|
|
my ($self, $id) = @_; |
15
|
0
|
0
|
|
|
|
|
confess "NotFoundError" unless validate_id($id); |
16
|
0
|
|
|
|
|
|
my $response = $self->gateway->http->get("/verifications/$id"); |
17
|
0
|
|
|
|
|
|
return WebService::Braintree::CreditCardVerification->new($response->{'verification'}); |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub search { |
21
|
0
|
|
|
0
|
0
|
|
my ($self, $block) = @_; |
22
|
0
|
|
|
|
|
|
my $search = WebService::Braintree::CreditCardVerificationSearch->new; |
23
|
0
|
|
|
|
|
|
my $params = $block->($search)->to_hash; |
24
|
0
|
|
|
|
|
|
my $response = $self->gateway->http->post("/verifications/advanced_search_ids", {search => $params}); |
25
|
|
|
|
|
|
|
return WebService::Braintree::ResourceCollection->new()->init($response, sub { |
26
|
0
|
|
|
0
|
|
|
$self->fetch_verifications($search, shift); |
27
|
0
|
|
|
|
|
|
}); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub all { |
31
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
32
|
0
|
|
|
|
|
|
my $response = $self->gateway->http->post("/verifications/advanced_search_ids"); |
33
|
|
|
|
|
|
|
return WebService::Braintree::ResourceCollection->new->init($response, sub { |
34
|
0
|
|
|
0
|
|
|
$self->fetch_verifications( |
35
|
|
|
|
|
|
|
WebService::Braintree::CreditCardVerificationSearch->new, shift, |
36
|
|
|
|
|
|
|
); |
37
|
0
|
|
|
|
|
|
}); |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub fetch_verifications { |
41
|
0
|
|
|
0
|
0
|
|
my ($self, $search, $ids) = @_; |
42
|
|
|
|
|
|
|
|
43
|
0
|
0
|
|
|
|
|
return [] if scalar @{$ids} == 0; |
|
0
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
45
|
0
|
|
|
|
|
|
$search->ids->in($ids); |
46
|
0
|
|
|
|
|
|
my $response = $self->gateway->http->post("/verifications/advanced_search/", {search => $search->to_hash}); |
47
|
|
|
|
|
|
|
|
48
|
0
|
|
|
|
|
|
my $attrs = $response->{'credit_card_verifications'}->{'verification'}; |
49
|
0
|
|
|
|
|
|
return to_instance_array($attrs, "WebService::Braintree::CreditCardVerification"); |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
1; |
55
|
|
|
|
|
|
|
__END__ |