Class: VaultedBilling::Configuration
- Inherits:
-
Object
- Object
- VaultedBilling::Configuration
- Defined in:
- lib/vaulted_billing/configuration.rb
Overview
This configuration holds the default values to use when instantiating VaultedBilling gateways. This configuration is accessed via VaultedBilling.config, or set en mass via a Hash with VaultedBilling.set_config(…).
Defined Under Namespace
Classes: GatewayConfiguration
Instance Attribute Summary collapse
-
#ca_file ⇒ Object
Returns the value of attribute ca_file.
-
#logger ⇒ Object
(also: #logger?)
Returns the value of attribute logger.
-
#test_mode ⇒ Object
Returns the value of attribute test_mode.
Instance Method Summary collapse
-
#authorize_net_cim ⇒ Object
Returns a VaultedBilling::Configuration::GatewayConfiguration instance to be used for defining default settings for the Authorize.net CIM gateway.
-
#bogus ⇒ Object
Returns a VaultedBilling::Configuration::GatewayConfiguration instance to be used for defining default settings for the Bogus gateway.
-
#initialize(options = {}) ⇒ Configuration
constructor
Possible options are as follows:.
-
#ipcommerce ⇒ Object
Returns a VaultedBilling::Configuration::GatewayConfiguration instance to be used for defining default settings for the IP Commerce gateway.
-
#nmi_customer_vault ⇒ Object
Returns a VaultedBilling::Configuration::GatewayConfiguration instance to be used for defining default settings for the NMI Customer Vault gateway.
Constructor Details
#initialize(options = {}) ⇒ Configuration
Possible options are as follows:
-
authorize_net_cim - A hash of GatewayConfiguration options for the Authorize.net CIM
-
bogus - A hash of GatewayConfiguration options for the Bogus gateway
-
nmi_customer_vault - A hash of GatewayConfiguration options for the NMI Customer Vault
-
test_mode - A boolean indicating whether or not the system defaults to using the test end points on the gateways.
52 53 54 55 56 57 58 59 60 |
# File 'lib/vaulted_billing/configuration.rb', line 52 def initialize( = {}) = .with_indifferent_access self.test_mode = .has_key?(:test_mode) ? [:test_mode] : true @_authorize_net_cim = GatewayConfiguration.new([:authorize_net_cim]) if [:authorize_net_cim] @_ipcommerce = GatewayConfiguration.new([:ipcommerce]) if [:ipcommerce] @_nmi_customer_vault = GatewayConfiguration.new([:nmi_customer_vault]) if [:nmi_customer_vault] @_bogus = GatewayConfiguration.new([:bogus]) if [:bogus] @ca_file = File.('../../ext/cacert.pem', __FILE__) end |
Instance Attribute Details
#ca_file ⇒ Object
Returns the value of attribute ca_file.
40 41 42 |
# File 'lib/vaulted_billing/configuration.rb', line 40 def ca_file @ca_file end |
#logger ⇒ Object Also known as: logger?
Returns the value of attribute logger.
37 38 39 |
# File 'lib/vaulted_billing/configuration.rb', line 37 def logger @logger end |
#test_mode ⇒ Object
Returns the value of attribute test_mode.
42 43 44 |
# File 'lib/vaulted_billing/configuration.rb', line 42 def test_mode @test_mode end |
Instance Method Details
#authorize_net_cim ⇒ Object
Returns a VaultedBilling::Configuration::GatewayConfiguration instance to be used for defining default settings for the Authorize.net CIM gateway.
67 68 69 |
# File 'lib/vaulted_billing/configuration.rb', line 67 def @_authorize_net_cim ||= GatewayConfiguration.new end |
#bogus ⇒ Object
Returns a VaultedBilling::Configuration::GatewayConfiguration instance to be used for defining default settings for the Bogus gateway.
94 95 96 |
# File 'lib/vaulted_billing/configuration.rb', line 94 def bogus @_bogus ||= GatewayConfiguration.new end |
#ipcommerce ⇒ Object
Returns a VaultedBilling::Configuration::GatewayConfiguration instance to be used for defining default settings for the IP Commerce gateway.
76 77 78 |
# File 'lib/vaulted_billing/configuration.rb', line 76 def ipcommerce @_ipcommerce ||= GatewayConfiguration.new end |
#nmi_customer_vault ⇒ Object
Returns a VaultedBilling::Configuration::GatewayConfiguration instance to be used for defining default settings for the NMI Customer Vault gateway.
85 86 87 |
# File 'lib/vaulted_billing/configuration.rb', line 85 def nmi_customer_vault @_nmi_customer_vault ||= GatewayConfiguration.new end |