Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial work on moving payment_gateway into gem extension.
- Loading branch information
Showing
3 changed files
with
34 additions
and
38 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,28 @@ | ||
#TDOD - May want to add code directly to this lib file later | ||
require 'active_merchant' | ||
|
||
# Mixin the payment_gateway method into the base controller so it can be accessed by the checkout process, etc. | ||
Creditcard.class_eval do | ||
# add gateway methods to the creditcard so we can authorize, capture, etc. | ||
include Spree::PaymentGateway | ||
end | ||
|
||
silence_warnings { require 'active_merchant/billing/authorize_net_cim' } | ||
|
||
#register all payment methods | ||
[ | ||
Gateway::Bogus, | ||
Gateway::AuthorizeNet, | ||
Gateway::AuthorizeNetCim, | ||
Gateway::Eway, | ||
Gateway::Linkpoint, | ||
Gateway::PayPal, | ||
Gateway::SagePay, | ||
Gateway::Beanstream, | ||
PaymentMethod::Check | ||
].each{|gw| | ||
begin | ||
gw.register | ||
rescue Exception => e | ||
$stderr.puts "Error registering gateway #{gw}: #{e}" | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require "spree_core" | ||
|
||
module SpreePaymentGateway | ||
class Engine < Rails::Engine | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.