| 1 | package WWW::PayPal::Plan; | ||
| 2 | |||
| 3 | # ABSTRACT: PayPal Billing Plan entity | ||
| 4 | |||
| 5 | 3 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 3 | ▶ | use namespace::clean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 3 | our $VERSION = '0.003'; | |
| 9 | |||
| 10 | |||
| 11 | 3 | has _client => ( | |
| 12 | is => 'ro', | ||
| 13 | required => 1, | ||
| 14 | weak_ref => 1, | ||
| 15 | init_arg => 'client', | ||
| 16 | ); | ||
| 17 | |||
| 18 | 3 | has data => ( is => 'rw', required => 1 ); | |
| 19 | |||
| 20 | |||
| 21 | 1 | ▶ | sub id { $_[0]->data->{id} } |
|
Subroutine
id: called CC=1 SCAR=0.0
Pod
documented
| |||
| 22 | 0 | ▶ | sub product_id { $_[0]->data->{product_id} } |
|
Subroutine
product_id: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 23 | 0 | ▶ | sub name { $_[0]->data->{name} } |
|
Subroutine
name: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 24 | 0 | ▶ | sub description { $_[0]->data->{description} } |
|
Subroutine
description: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 25 | 0 | ▶ | sub status { $_[0]->data->{status} } |
|
Subroutine
status: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 26 | 0 | ▶ | sub billing_cycles { $_[0]->data->{billing_cycles} } |
|
Subroutine
billing_cycles: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 27 | 0 | ▶ | sub create_time { $_[0]->data->{create_time} } |
|
Subroutine
create_time: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 28 | 0 | ▶ | sub update_time { $_[0]->data->{update_time} } |
|
Subroutine
update_time: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 29 | |||
| 30 | |||
| 31 | 0 | ▶ | sub activate { |
|
Subroutine
activate: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 32 | 0 | my ($self) = @_; | |
| 33 | 0 | $self->_client->plans->activate($self->id); | |
| 34 | 0 | $self->refresh; | |
| 35 | 0 | return $self; | |
| 36 | } | ||
| 37 | |||
| 38 | 0 | ▶ | sub deactivate { |
|
Subroutine
deactivate: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 39 | 0 | my ($self) = @_; | |
| 40 | 0 | $self->_client->plans->deactivate($self->id); | |
| 41 | 0 | $self->refresh; | |
| 42 | 0 | return $self; | |
| 43 | } | ||
| 44 | |||
| 45 | |||
| 46 | 0 | ▶ | sub refresh { |
|
Subroutine
refresh: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 47 | 0 | my ($self) = @_; | |
| 48 | 0 | my $fresh = $self->_client->plans->get($self->id); | |
| 49 | 0 | $self->data($fresh->data); | |
| 50 | 0 | return $self; | |
| 51 | } | ||
| 52 | |||
| 53 | |||
| 54 | 3 | 1; | |
| 55 | |||
| 56 | __END__ | ||