Class: MuckCommerce::Configuration
- Inherits:
-
Object
- Object
- MuckCommerce::Configuration
- Defined in:
- lib/muck-commerce/config.rb
Instance Attribute Summary collapse
-
#achholder_types ⇒ Object
Returns the value of attribute achholder_types.
-
#achtypes ⇒ Object
Returns the value of attribute achtypes.
-
#cim_gateway ⇒ Object
Returns the value of attribute cim_gateway.
-
#commerce_run_production_as_test ⇒ Object
Returns the value of attribute commerce_run_production_as_test.
-
#credit_card_types ⇒ Object
Returns the value of attribute credit_card_types.
-
#enable_coupons ⇒ Object
Returns the value of attribute enable_coupons.
-
#enable_orders ⇒ Object
Returns the value of attribute enable_orders.
-
#enable_paypal_express ⇒ Object
Returns the value of attribute enable_paypal_express.
-
#enable_subscriptions ⇒ Object
Returns the value of attribute enable_subscriptions.
-
#gateway(enable_live_test_gateway = false, gateway = nil, cim_gateway = nil, login = nil, password = nil, signature = nil, production_test = false) ⇒ Object
Configures the gateway for payment transactions.
-
#gateway_login ⇒ Object
Returns the value of attribute gateway_login.
-
#gateway_password ⇒ Object
Returns the value of attribute gateway_password.
-
#gateway_signature ⇒ Object
Returns the value of attribute gateway_signature.
-
#payment_methods ⇒ Object
Returns the value of attribute payment_methods.
-
#paypal_login ⇒ Object
Returns the value of attribute paypal_login.
-
#paypal_password ⇒ Object
Returns the value of attribute paypal_password.
-
#paypal_signature ⇒ Object
Returns the value of attribute paypal_signature.
-
#require_cvv_value ⇒ Object
Returns the value of attribute require_cvv_value.
Instance Method Summary collapse
- #cim_enabled? ⇒ Boolean
- #disable_live_test_gateway ⇒ Object
- #enable_live_test_gateway(gateway = nil, cim_gateway = nil, login = nil, password = nil, signature = nil) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/muck-commerce/config.rb', line 19 def initialize self.enable_orders = false self.enable_subscriptions = true self.enable_coupons = false self.credit_card_types = [] self.commerce_run_production_as_test = false self.enable_paypal_express = false self.gateway = 'authorize_net' self.cim_gateway = 'authorize_net_cim' self.payment_methods = [[ "Credit card", "CC" ], [ "ACH/E-Check", "ACH" ]] self.credit_card_types = [[ "Visa", "visa" ], [ "MasterCard", "master" ], [ "Discover", "discover" ], [ "American Express", "american_express" ]] self.achholder_types = [[ "Business", "Business" ], [ "Personal", "Personal" ]] self.achtypes = [[ "Checking", "Checking" ], [ "Savings", "Savings" ]] self.require_cvv_value = true end |
Instance Attribute Details
#achholder_types ⇒ Object
Returns the value of attribute achholder_types.
14 15 16 |
# File 'lib/muck-commerce/config.rb', line 14 def achholder_types @achholder_types end |
#achtypes ⇒ Object
Returns the value of attribute achtypes.
14 15 16 |
# File 'lib/muck-commerce/config.rb', line 14 def achtypes @achtypes end |
#cim_gateway ⇒ Object
Returns the value of attribute cim_gateway.
14 15 16 |
# File 'lib/muck-commerce/config.rb', line 14 def cim_gateway @cim_gateway end |
#commerce_run_production_as_test ⇒ Object
Returns the value of attribute commerce_run_production_as_test.
14 15 16 |
# File 'lib/muck-commerce/config.rb', line 14 def commerce_run_production_as_test @commerce_run_production_as_test end |
#credit_card_types ⇒ Object
Returns the value of attribute credit_card_types.
14 15 16 |
# File 'lib/muck-commerce/config.rb', line 14 def credit_card_types @credit_card_types end |
#enable_coupons ⇒ Object
Returns the value of attribute enable_coupons.
14 15 16 |
# File 'lib/muck-commerce/config.rb', line 14 def enable_coupons @enable_coupons end |
#enable_orders ⇒ Object
Returns the value of attribute enable_orders.
14 15 16 |
# File 'lib/muck-commerce/config.rb', line 14 def enable_orders @enable_orders end |
#enable_paypal_express ⇒ Object
Returns the value of attribute enable_paypal_express.
14 15 16 |
# File 'lib/muck-commerce/config.rb', line 14 def enable_paypal_express @enable_paypal_express end |
#enable_subscriptions ⇒ Object
Returns the value of attribute enable_subscriptions.
14 15 16 |
# File 'lib/muck-commerce/config.rb', line 14 def enable_subscriptions @enable_subscriptions end |
#gateway(enable_live_test_gateway = false, gateway = nil, cim_gateway = nil, login = nil, password = nil, signature = nil, production_test = false) ⇒ Object
Configures the gateway for payment transactions.
Notes: For most uses the default options are fine and the gateway can be configured by simply calling: MuckCommerce.configuration.gateway as shown below.
Parameters:
enable_live_test_gateway: Normally tests are run against the local bogus gateway. However, tests
can use the live test gateway by setting this value to true. The tests
found in test/remote make use of this option.
gateway: Override the gateway.
cim_gateway: Override the cim_gateway
login: Override the login.
password: Override the password.
signature: Override the signature.
production_test: If set to true then the system will use the test gateway even in production.
Useful if you want to test the production site before going live
66 67 68 |
# File 'lib/muck-commerce/config.rb', line 66 def gateway @gateway end |
#gateway_login ⇒ Object
Returns the value of attribute gateway_login.
14 15 16 |
# File 'lib/muck-commerce/config.rb', line 14 def gateway_login @gateway_login end |
#gateway_password ⇒ Object
Returns the value of attribute gateway_password.
14 15 16 |
# File 'lib/muck-commerce/config.rb', line 14 def gateway_password @gateway_password end |
#gateway_signature ⇒ Object
Returns the value of attribute gateway_signature.
14 15 16 |
# File 'lib/muck-commerce/config.rb', line 14 def gateway_signature @gateway_signature end |
#payment_methods ⇒ Object
Returns the value of attribute payment_methods.
14 15 16 |
# File 'lib/muck-commerce/config.rb', line 14 def payment_methods @payment_methods end |
#paypal_login ⇒ Object
Returns the value of attribute paypal_login.
14 15 16 |
# File 'lib/muck-commerce/config.rb', line 14 def paypal_login @paypal_login end |
#paypal_password ⇒ Object
Returns the value of attribute paypal_password.
14 15 16 |
# File 'lib/muck-commerce/config.rb', line 14 def paypal_password @paypal_password end |
#paypal_signature ⇒ Object
Returns the value of attribute paypal_signature.
14 15 16 |
# File 'lib/muck-commerce/config.rb', line 14 def paypal_signature @paypal_signature end |
#require_cvv_value ⇒ Object
Returns the value of attribute require_cvv_value.
14 15 16 |
# File 'lib/muck-commerce/config.rb', line 14 def require_cvv_value @require_cvv_value end |
Instance Method Details
#cim_enabled? ⇒ Boolean
44 45 46 |
# File 'lib/muck-commerce/config.rb', line 44 def cim_enabled? @cim_enabled end |
#disable_live_test_gateway ⇒ Object
40 41 42 |
# File 'lib/muck-commerce/config.rb', line 40 def disable_live_test_gateway gateway end |
#enable_live_test_gateway(gateway = nil, cim_gateway = nil, login = nil, password = nil, signature = nil) ⇒ Object
35 36 37 38 |
# File 'lib/muck-commerce/config.rb', line 35 def enable_live_test_gateway(gateway = nil, cim_gateway = nil, login = nil, password = nil, signature = nil) gateway(true, gateway, cim_gateway, login, password, signature) self.credit_card_types = [[ "Visa", "visa" ], [ "MasterCard", "master" ], [ "Discover", "discover" ], [ "American Express", "american_express" ]] end |