| 1 | package Net::Braintree::Customer; | ||||||||||
| 2 | 1 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 1 | extends 'Net::Braintree::ResultObject'; | |||||||||
| 4 | |||||||||||
| 5 | 1 | my $meta = __PACKAGE__->meta; | |||||||||
| 6 | |||||||||||
| 7 | 0 | ▶ | sub BUILD { | ||||||||
|
Subroutine
BUILD: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 8 | 0 | my ($self, $attributes) = @_; | |||||||||
| 9 | 0 | my $sub_objects = { | |||||||||
| 10 | credit_cards => "Net::Braintree::CreditCard", | ||||||||||
| 11 | addresses => "Net::Braintree::Address", | ||||||||||
| 12 | paypal_accounts => "Net::Braintree::PayPalAccount" | ||||||||||
| 13 | }; | ||||||||||
| 14 | |||||||||||
| 15 | 0 | $self->setup_sub_objects($self, $attributes, $sub_objects); | |||||||||
| 16 | 0 | $self->set_attributes_from_hash($self, $attributes); | |||||||||
| 17 | } | ||||||||||
| 18 | |||||||||||
| 19 | 0 | ▶ | sub payment_methods { | ||||||||
|
Subroutine
payment_methods: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||
| 20 | 0 | my $self = shift; | |||||||||
| 21 | 0 | my @pmt_methods; | |||||||||
| 22 | 0 | ▶ | if (defined($self->credit_cards)) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 23 | 0 | foreach my $credit_card (@{$self->credit_cards}) { | |||||||||
| 24 | 0 | push @pmt_methods, $credit_card; | |||||||||
| 25 | } | ||||||||||
| 26 | } | ||||||||||
| 27 | |||||||||||
| 28 | 0 | ▶ | if (defined($self->paypal_accounts)) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 29 | 0 | foreach my $paypal_account (@{$self->paypal_accounts}) { | |||||||||
| 30 | 0 | push @pmt_methods, $paypal_account; | |||||||||
| 31 | } | ||||||||||
| 32 | } | ||||||||||
| 33 | |||||||||||
| 34 | 0 | return \@pmt_methods; | |||||||||
| 35 | } | ||||||||||
| 36 | |||||||||||
| 37 | 0 | ▶ | sub create { | ||||||||
|
Subroutine
create: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 38 | 0 | my ($class, $params) = @_; | |||||||||
| 39 | 0 | $class->gateway->customer->create($params); | |||||||||
| 40 | } | ||||||||||
| 41 | |||||||||||
| 42 | 0 | ▶ | sub find { | ||||||||
|
Subroutine
find: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 43 | 0 | my($class, $id) = @_; | |||||||||
| 44 | 0 | $class->gateway->customer->find($id); | |||||||||
| 45 | } | ||||||||||
| 46 | |||||||||||
| 47 | 0 | ▶ | sub delete { | ||||||||
|
Subroutine
delete: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 48 | 0 | my ($class, $id) = @_; | |||||||||
| 49 | 0 | $class->gateway->customer->delete($id); | |||||||||
| 50 | } | ||||||||||
| 51 | |||||||||||
| 52 | 0 | ▶ | sub update { | ||||||||
|
Subroutine
update: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 53 | 0 | my ($class, $id, $params) = @_; | |||||||||
| 54 | 0 | $class->gateway->customer->update($id, $params); | |||||||||
| 55 | } | ||||||||||
| 56 | |||||||||||
| 57 | 0 | ▶ | sub search { | ||||||||
|
Subroutine
search: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 58 | 0 | my ($class, $block) = @_; | |||||||||
| 59 | 0 | $class->gateway->customer->search($block); | |||||||||
| 60 | } | ||||||||||
| 61 | |||||||||||
| 62 | 0 | ▶ | sub all { | ||||||||
|
Subroutine
all: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 63 | 0 | my ($class) = @_; | |||||||||
| 64 | 0 | $class->gateway->customer->all; | |||||||||
| 65 | } | ||||||||||
| 66 | |||||||||||
| 67 | 0 | ▶ | sub gateway { | ||||||||
|
Subroutine
gateway: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 68 | 0 | return Net::Braintree->configuration->gateway; | |||||||||
| 69 | } | ||||||||||
| 70 | |||||||||||
| 71 | 1 | 1; | |||||||||