| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package Net::Braintree::Subscription; | 
| 2 | 1 |  |  | 1 |  | 314 | use Net::Braintree::SubscriptionGateway; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 45 |  | 
| 3 | 1 |  |  | 1 |  | 390 | use Net::Braintree::Subscription::Status; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 21 |  | 
| 4 |  |  |  |  |  |  |  | 
| 5 | 1 |  |  | 1 |  | 4 | use Moose; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 4 |  | 
| 6 |  |  |  |  |  |  | extends 'Net::Braintree::ResultObject'; | 
| 7 |  |  |  |  |  |  |  | 
| 8 |  |  |  |  |  |  | my $meta = __PACKAGE__->meta; | 
| 9 |  |  |  |  |  |  |  | 
| 10 |  |  |  |  |  |  | sub BUILD { | 
| 11 | 0 |  |  | 0 | 0 |  | my ($self, $attributes) = @_; | 
| 12 | 0 |  |  |  |  |  | my $sub_objects = { 'transactions' => 'Net::Braintree::Transaction'}; | 
| 13 | 0 |  |  |  |  |  | $self->setup_sub_objects($self, $attributes, $sub_objects); | 
| 14 | 0 |  |  |  |  |  | $self->set_attributes_from_hash($self, $attributes); | 
| 15 |  |  |  |  |  |  | } | 
| 16 |  |  |  |  |  |  |  | 
| 17 |  |  |  |  |  |  | sub create { | 
| 18 | 0 |  |  | 0 | 0 |  | my ($class, $params) = @_; | 
| 19 | 0 |  |  |  |  |  | $class->gateway->subscription->create($params); | 
| 20 |  |  |  |  |  |  | } | 
| 21 |  |  |  |  |  |  |  | 
| 22 |  |  |  |  |  |  | sub find { | 
| 23 | 0 |  |  | 0 | 0 |  | my ($class, $id) = @_; | 
| 24 | 0 |  |  |  |  |  | $class->gateway->subscription->find($id); | 
| 25 |  |  |  |  |  |  | } | 
| 26 |  |  |  |  |  |  |  | 
| 27 |  |  |  |  |  |  | sub update { | 
| 28 | 0 |  |  | 0 | 0 |  | my ($class, $id, $params) = @_; | 
| 29 | 0 |  |  |  |  |  | $class->gateway->subscription->update($id, $params); | 
| 30 |  |  |  |  |  |  | } | 
| 31 |  |  |  |  |  |  |  | 
| 32 |  |  |  |  |  |  | sub cancel { | 
| 33 | 0 |  |  | 0 | 0 |  | my ($class, $id) = @_; | 
| 34 | 0 |  |  |  |  |  | $class->gateway->subscription->cancel($id); | 
| 35 |  |  |  |  |  |  | } | 
| 36 |  |  |  |  |  |  |  | 
| 37 |  |  |  |  |  |  | sub retry_charge { | 
| 38 | 0 |  |  | 0 | 0 |  | my ($class, $subscription_id, $amount) = @_; | 
| 39 | 0 |  |  |  |  |  | $class->gateway->transaction->retry_subscription_charge($subscription_id, $amount); | 
| 40 |  |  |  |  |  |  | } | 
| 41 |  |  |  |  |  |  |  | 
| 42 |  |  |  |  |  |  | sub search { | 
| 43 | 0 |  |  | 0 | 0 |  | my($class, $block) = @_; | 
| 44 | 0 |  |  |  |  |  | $class->gateway->subscription->search($block); | 
| 45 |  |  |  |  |  |  | } | 
| 46 |  |  |  |  |  |  |  | 
| 47 |  |  |  |  |  |  | sub all { | 
| 48 | 0 |  |  | 0 | 0 |  | my $class = shift; | 
| 49 | 0 |  |  |  |  |  | $class->gateway->subscription->all; | 
| 50 |  |  |  |  |  |  | } | 
| 51 |  |  |  |  |  |  |  | 
| 52 |  |  |  |  |  |  | sub gateway { | 
| 53 | 0 |  |  | 0 | 0 |  | return Net::Braintree->configuration->gateway; | 
| 54 |  |  |  |  |  |  | } | 
| 55 |  |  |  |  |  |  |  | 
| 56 |  |  |  |  |  |  | 1; |