Created
October 12, 2011 17:11
-
-
Save hexatridecimal/1281851 to your computer and use it in GitHub Desktop.
Internet Secure gateway code for active_merchant
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 ActiveMerchant #:nodoc: | |
module Billing #:nodoc: | |
class InternetSecureGateway < AuthorizeNetGateway | |
self.live_url = self.test_url = 'https://anet.internetsecure.com/process.cgi' | |
self.homepage_url = 'http://www.internetsecure.com/' | |
self.display_name = 'InternetSecure' | |
def test? | |
Base.gateway_mode == :test | |
end | |
private | |
def split(response) | |
response.split(',') | |
end | |
end | |
end |
Yep,
Tested using AuthorizeNet's sandbox with something like this:
def new_gateway
kind = Rails.env.production? ? 'InternetSecure' : 'AuthorizeNet'
ang = "ActiveMerchant::Billing::#{kind}Gateway".constantize
ang.new :login => APP.gateway.login_id,
:password => APP.gateway.transaction_key
end
Their sandbox is really nice for testing. The code is being used in production on a high profile site. Not sure about IS's recurring billing though. My guess is you would need to use their proprietary API for that, their AuthorizeNet gateway is very very sparse with what it does.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for posting this snippet! I'm curious, was this actually enough to get Elanon's InternetSecure gateway working with ActiveMerchant?
Also, did you ever look at integrating InternetSecure's support for storing recurring billing info on the merchant's server? (This allows the merchant to initiate each payment, similar to Authorize.net's CIM.)
Cheers.