Class: Braintree::Subscription

### Home Classes Methods

### In Files

- lib/braintree/subscription.rb

### Parent

Object

### Namespace

- MODULE Braintree::Subscription::Status
- MODULE Braintree::Subscription::TrialDurationUnit

### Methods

- ::cancel
- ::create
- ::create!
- ::find
- ::retry_charge
- ::search
- ::update
- ::update!
- #==
- #never_expires?
- #next_bill_amount

### Class/Module Index

Quicksearch

- Braintree
- Braintree::AddOn
- Braintree::AddOnGateway
- Braintree::Address
- Braintree::AddressGateway
- Braintree::AdvancedSearch
- Braintree::AdvancedSearch::MultipleValueOrTextNode
- Braintree::AuthenticationError
- Braintree::AuthorizationError
- Braintree::BraintreeError
- Braintree::Configuration
- Braintree::ConfigurationError
- Braintree::CreditCard
- Braintree::CreditCard::CardType
- Braintree::CreditCard::CustomerLocation
- Braintree::CreditCardVerification
- Braintree::CreditCardVerification::Status
- Braintree::Customer
- Braintree::Discount
- Braintree::DiscountGateway
- Braintree::DownForMaintenanceError
- Braintree::ErrorCodes
- Braintree::ErrorCodes::Address
- Braintree::ErrorCodes::CreditCard
- Braintree::ErrorCodes::CreditCard::Options
- Braintree::ErrorCodes::Customer
- Braintree::ErrorCodes::Descriptor
- Braintree::ErrorCodes::SettlementBatchSummary
- Braintree::ErrorCodes::Subscription
- Braintree::ErrorCodes::Subscription::Modification
- Braintree::ErrorCodes::Transaction
- Braintree::ErrorCodes::Transaction::Options
- Braintree::ErrorResult
- Braintree::Errors
- Braintree::ForgedQueryString
- Braintree::NotFoundError
- Braintree::Plan
- Braintree::SSLCertificateError
- Braintree::ServerError
- Braintree::SettlementBatchSummary
- Braintree::SettlementBatchSummaryGateway
- Braintree::Subscription
- Braintree::Subscription::Status
- Braintree::Subscription::TrialDurationUnit
- Braintree::SuccessfulResult
- Braintree::Test
- Braintree::Test::CreditCardNumbers
- Braintree::Test::CreditCardNumbers::FailsSandboxVerification
- Braintree::Test::TransactionAmounts
- Braintree::Transaction
- Braintree::Transaction::CreatedUsing
- Braintree::Transaction::GatewayRejectionReason
- Braintree::Transaction::Source
- Braintree::Transaction::Status
- Braintree::TransparentRedirect
- Braintree::TransparentRedirectGateway
- Braintree::UnexpectedError
- Braintree::UpgradeRequiredError
- Braintree::ValidationError
- Braintree::ValidationErrorCollection
- Braintree::ValidationsFailed
- Braintree::Version

No matching classes.

# Braintree::Subscription

See www.braintreepayments.com/docs/ruby/subscriptions/overview

### Attributes

add_ons[R]
balance[R]
billing_day_of_month[R]
billing_period_end_date[R]
billing_period_start_date[R]
current_billing_cycle[R]
days_past_due[R]
descriptor[R]
discounts[R]
failure_count[R]
first_billing_date[R]
id[R]
merchant_account_id[R]
next_billing_date[R]
next_billing_period_amount[R]
number_of_billing_cycles[R]
paid_through_date[R]
payment_method_token[R]
plan_id[R]
price[R]
status[R]
transactions[R]
trial_duration[R]
trial_duration_unit[R]
trial_period[R]

### Public Class Methods

cancel(subscription_id) click to toggle source

See www.braintreepayments.com/docs/ruby/subscriptions/cancel

    # File lib/braintree/subscription.rb, line 34
    def self.cancel(subscription_id)
      Configuration.gateway.subscription.cancel(subscription_id)
    end

create(attributes) click to toggle source

See www.braintreepayments.com/docs/ruby/subscriptions/create

    # File lib/braintree/subscription.rb, line 39
    def self.create(attributes)
      Configuration.gateway.subscription.create(attributes)
    end

create!(attributes) click to toggle source

    # File lib/braintree/subscription.rb, line 43
    def self.create!(attributes)
      return_object_or_raise(:subscription) { create(attributes) }
    end

find(id) click to toggle source

See www.braintreepayments.com/docs/ruby/subscriptions/search

    # File lib/braintree/subscription.rb, line 48
    def self.find(id)
      Configuration.gateway.subscription.find(id)
    end

retry_charge(subscription_id, amount=nil) click to toggle source

    # File lib/braintree/subscription.rb, line 52
    def self.retry_charge(subscription_id, amount=nil)
      Configuration.gateway.transaction.retry_subscription_charge(subscription_id, amount)
    end

search(&block) click to toggle source

See www.braintreepayments.com/docs/ruby/subscriptions/search

    # File lib/braintree/subscription.rb, line 57
    def self.search(&block)
      Configuration.gateway.subscription.search(&block)
    end

update(subscription_id, attributes) click to toggle source

See www.braintreepayments.com/docs/ruby/subscriptions/update

    # File lib/braintree/subscription.rb, line 62
    def self.update(subscription_id, attributes)
      Configuration.gateway.subscription.update(subscription_id, attributes)
    end

update!(subscription_id, attributes) click to toggle source

    # File lib/braintree/subscription.rb, line 66
    def self.update!(subscription_id, attributes)
      return_object_or_raise(:subscription) { update(subscription_id, attributes) }
    end

### Public Instance Methods

==(other) click to toggle source

True if `other` has the same id.

    # File lib/braintree/subscription.rb, line 91
    def ==(other)
      return false unless other.is_a?(Subscription)
      id == other.id
    end

never_expires?() click to toggle source

    # File lib/braintree/subscription.rb, line 86
    def never_expires?
      @never_expires
    end

next_bill_amount() click to toggle source

    # File lib/braintree/subscription.rb, line 81
    def next_bill_amount
      warn "[DEPRECATED] Subscription.next_bill_amount is deprecated. Please use Subscription.next_billing_period_amount"
      @next_bill_amount
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.