Created
February 26, 2013 20:54
-
-
Save justinxreese/5042085 to your computer and use it in GitHub Desktop.
spree setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Spree | |
class PaymentMethod::Accpac < PaymentMethod | |
attr_accessible :preferred_client_id, :preferred_client_secret | |
#preference :client_id, :integer | |
#preference :client_secret, :string | |
def payment_profiles_supported? | |
false | |
end | |
def actions | |
%w{capture void} | |
end | |
# Indicates whether its possible to capture the payment | |
def can_capture?(payment) | |
['checkout', 'pending'].include?(payment.state) | |
end | |
# Indicates whether its possible to void the payment. | |
def can_void?(payment) | |
payment.state != 'void' | |
end | |
def capture(*args) | |
ActiveMerchant::Billing::Response.new(true, "", {}, {}) | |
end | |
def void(*args) | |
ActiveMerchant::Billing::Response.new(true, "", {}, {}) | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Configure Spree Preferences | |
# | |
# Note: Initializing preferences available within the Admin will overwrite any changes that were made through the user interface when you restart. | |
# If you would like users to be able to update a setting with the Admin it should NOT be set here. | |
# | |
# In order to initialize a setting do: | |
# config.setting_name = 'new value' | |
Spree.config do |config| | |
# Example: | |
# Uncomment to override the default site name. | |
# config.site_name = "Spree Demo Site" | |
end | |
Spree.user_class = "Spree::User" | |
Rails.application.config.spree.payment_methods = [Spree::PaymentMethod::Accpac] | |
require 'pry'; binding.pry |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment