Class/Module Index [+]

Quicksearch

ActiveMerchant::Billing::InspireGateway

Constants

URL

Public Class Methods

new(options = {}) click to toggle source

Creates a new InspireGateway

The gateway requires that a valid login and password be passed in the options hash.

Options

  • :login -- The Inspire Username.

  • :password -- The Inspire Passowrd.

See the Inspire Integration Guide for details. (default: false)

# File lib/active_merchant/billing/gateways/inspire.rb, line 21
def initialize(options = {})
  requires!(options, :login, :password)
  @options = options
  super
end

Public Instance Methods

authorize(money, creditcard, options = {}) click to toggle source

Pass :store => true in the options to store the payment info at Inspire Gateway and get a generated customer_vault_id in the response. Pass :store => some_number_or_string to specify the customer_vault_id InspireGateway should use (make sure it’s unique).

# File lib/active_merchant/billing/gateways/inspire.rb, line 33
def authorize(money, creditcard, options = {})
  post = {}
  add_invoice(post, options)
  add_payment_source(post, creditcard,options)        
  add_address(post, creditcard, options)        
  add_customer_data(post, options)
  
  commit('auth', money, post)
end
capture(money, authorization, options = {}) click to toggle source
# File lib/active_merchant/billing/gateways/inspire.rb, line 53
def capture(money, authorization, options = {})
  post ={}
  post[:transactionid] = authorization
  commit('capture', money, post)
end
delete(vault_id) click to toggle source
# File lib/active_merchant/billing/gateways/inspire.rb, line 79
def delete(vault_id)
  post = {}
  post[:customer_vault] = "delete_customer"
  add_customer_vault_id(post, vault_id)         
  commit(nil, nil, post)
end
Also aliased as: unstore
purchase(money, payment_source, options = {}) click to toggle source
# File lib/active_merchant/billing/gateways/inspire.rb, line 43
def purchase(money, payment_source, options = {})
  post = {}
  add_invoice(post, options)
  add_payment_source(post, payment_source, options)        
  add_address(post, payment_source, options)   
  add_customer_data(post, options)
       
  commit('sale', money, post)
end
store(creditcard, options = {}) click to toggle source

To match the other stored-value gateways, like TrustCommerce, store and unstore need to be defined

# File lib/active_merchant/billing/gateways/inspire.rb, line 88
def store(creditcard, options = {})
  billing_id = options.delete(:billing_id).to_s || true
  authorize(100, creditcard, options.merge(:store => billing_id))
end
unstore(vault_id) click to toggle source
Alias for: delete
update(vault_id, creditcard, options = {}) click to toggle source

Update the values (such as CC expiration) stored at InspireGateway. The CC number must be supplied in the CreditCard object.

# File lib/active_merchant/billing/gateways/inspire.rb, line 68
def update(vault_id, creditcard, options = {})
  post = {}
  post[:customer_vault] = "update_customer"
  add_customer_vault_id(post, vault_id)
  add_creditcard(post, creditcard, options)        
  add_address(post, creditcard, options)   
  add_customer_data(post, options)
       
  commit(nil, nil, post)
end
void(authorization, options = {}) click to toggle source
# File lib/active_merchant/billing/gateways/inspire.rb, line 59
def void(authorization, options = {})
  post ={}
  post[:transactionid] = authorization
  commit('void', nil, post)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.