Class: Braintree::Configuration

### Home Classes Methods

### In Files

- lib/braintree/configuration.rb

### Parent

Object

### Methods

- ::environment=
- ::logger
- ::new
- #endpoint
- #logger

### 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::Configuration

See www.braintreepayments.com/docs/ruby

### Attributes

custom_user_agent[W]
endpoint[W]
logger[W]
merchant_id[W]
private_key[W]
public_key[W]
merchant_id[R]
private_key[R]
public_key[R]

### Public Class Methods

environment=(env) click to toggle source

Sets the Braintree environment to use. Valid values are `:sandbox` and `:production`

    # File lib/braintree/configuration.rb, line 24
    def self.environment=(env)
      unless [:development, :qa, :sandbox, :production].include?(env)
        raise ArgumentError, "#{env.inspect} is not a valid environment"
      end
      @environment = env
    end

logger() click to toggle source

    # File lib/braintree/configuration.rb, line 47
    def self.logger
      @logger ||= _default_logger
    end

new(options = {}) click to toggle source

    # File lib/braintree/configuration.rb, line 51
    def initialize(options = {})
      [:endpoint, :environment, :merchant_id, :public_key, :private_key, :custom_user_agent, :logger].each do |attr|
        instance_variable_set "@#{attr}", options[attr]
      end
    end

### Public Instance Methods

endpoint() click to toggle source

    # File lib/braintree/configuration.rb, line 78
    def endpoint
      @endpoint || DEFAULT_ENDPOINT
    end

logger() click to toggle source

    # File lib/braintree/configuration.rb, line 86
    def logger
      @logger ||= self.class._default_logger
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.