module Stripe
def self.app_info
Gets the application for a plugin that's identified some. See
def self.app_info @app_info end
def self.app_info=(info)
def self.app_info=(info) @app_info = info end
def self.ca_bundle_path
the library will use an included bundle that can successfully validate
The location of a file containing a bundle of CA certificates. By default
def self.ca_bundle_path @ca_bundle_path end
def self.ca_bundle_path=(path)
def self.ca_bundle_path=(path) @ca_bundle_path = path # empty this field so a new store is initialized @ca_store = nil end
def self.ca_store
`Stripe.ca_store`) in their initialization code because it marshals lazily
to leverage this pseudo safety should make a call to this method (i.e.
the most likely point of failure (see issue #382). Any program attempting
when initiating many parallel requests marshaling the certificate store is
This was added to the give the gem "pseudo thread safety" in that it seems
which is used to validate TLS on every request.
A certificate store initialized from the the bundle in #ca_bundle_path and
def self.ca_store @ca_store ||= begin store = OpenSSL::X509::Store.new store.add_file(ca_bundle_path) store end end
def self.enable_telemetry=(val)
def self.enable_telemetry=(val) @enable_telemetry = val end
def self.enable_telemetry?
def self.enable_telemetry? @enable_telemetry end
def self.log_level
Use of this configuration is only useful when `.logger` is _not_ set. When
`debug` and `info`, with `debug` being a little more verbose in places.
requests, responses, and errors that are received. Valid log levels are
$stderr about what it's doing. For example, it'll produce information about
When set prompts the library to log some extra information to $stdout and
def self.log_level @log_level end
def self.log_level=(val)
def self.log_level=(val) # Backwards compatibility for values that we briefly allowed if val == "debug" val = LEVEL_DEBUG elsif val == "info" val = LEVEL_INFO end if !val.nil? && ![LEVEL_DEBUG, LEVEL_ERROR, LEVEL_INFO].include?(val) raise ArgumentError, "log_level should only be set to `nil`, `debug` or `info`" end @log_level = val end
def self.logger
If `.logger` is set, the value of `.log_level` is ignored. The decision on
suitable).
standard library (hint, anything in `Rails.logger` will likely be
support the same interface as the `Logger` class that's part of Ruby's
Sets a logger to which logging output will be sent. The logger should
def self.logger @logger end
def self.logger=(val)
def self.logger=(val) @logger = val end
def self.max_network_retries
def self.max_network_retries @max_network_retries end
def self.max_network_retries=(val)
def self.max_network_retries=(val) @max_network_retries = val.to_i end
def self.set_app_info(name, partner_id: nil, url: nil, version: nil)
communicating with Stripe.
with API requests. Useful for plugin authors to identify their plugin when
Sets some basic information about the running application that's sent along
def self.set_app_info(name, partner_id: nil, url: nil, version: nil) @app_info = { name: name, partner_id: partner_id, url: url, version: version, } end
def self.uri_encode(params)
def self.uri_encode(params) Util.encode_parameters(params) end