Skip to content
Browse files

ENH: Added cancel_at_end_of_period as an updatedable field.

Also, fixed a subtle bug with usage of &goto.
  • Loading branch information...
1 parent ff7f8fe commit 57ba08cd8eda5b47e55971763cb56974fb97d571 @gdey committed Mar 2, 2012
Showing with 6 additions and 11 deletions.
  1. +1 −1 lib/WWW/Chargify/Role/Destroy.pm
  2. +5 −10 lib/WWW/Chargify/Subscription.pm
View
2 lib/WWW/Chargify/Role/Destroy.pm
@@ -4,7 +4,7 @@ use Moose::Role;
requires '_resource_key';
requires 'id';
- sub cancel { goto &destroy; }
+ sub cancel { shift->destroy(@_) }
sub destroy {
my $self = shift;
View
15 lib/WWW/Chargify/Subscription.pm
@@ -66,12 +66,8 @@ use WWW::Chargify::Migration;
has cancellation_message => ( is => 'rw', isa => 'Str' );
has signup_revenue => ( is => 'rw', isa => 'Num' );
has signup_payment_id => ( is => 'rw', isa => 'Num' );
- has cancel_at_end_of_period => ( is => 'rw', isa => 'Bool' );
has previous_state => ( is => 'rw', isa => 'Str' );
has coupon_code => ( is => 'rw', isa => 'Str' );
-
-
-
has vault_token => ( is => 'rw',
isa => 'Str' ,
traits => [qw/Chargify::APIAttribute/] ,
@@ -82,14 +78,12 @@ use WWW::Chargify::Migration;
traits => [qw/Chargify::APIAttribute/],
isAPIUpdatable => 1,
);
-
has credit_card_attributes => ( is => 'rw',
isa => 'CreditCardAttributeSet',
traits => [qw/Chargify::APIAttribute/],
isAPIUpdatable => 1,
coerce => 1
);
-
has next_billing_at => ( is => 'rw',
traits => [qw/Chargify::APIAttribute/],
isAPIUpdatable => 1,
@@ -98,15 +92,16 @@ use WWW::Chargify::Migration;
traits => [qw/Chargify::APIAttribute/],
isAPIUpdatable => 1,
);
-
has component => ( is => 'rw',
isa => 'WWW::Chargify::Component',
traits => [qw/Chargify::APIAttribute/],
isAPIUpdatable => 1,
);
-
-
-
+ has cancel_at_end_of_period => ( is => 'rw',
+ isa => 'Bool',
+ default => 0,
+ traits => [qw/Chargify::APIAttribute/],
+ );
with 'WWW::Chargify::Role::Config';
with 'WWW::Chargify::Role::HTTP';
with 'WWW::Chargify::Role::FromHash';

0 comments on commit 57ba08c

Please sign in to comment.
Something went wrong with that request. Please try again.