Class/Module Index [+]

Quicksearch

ActiveMerchant::Billing::MerchantWareGateway

Public Class Methods

new(options = {}) click to toggle source

Creates a new MerchantWareGateway

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

Options

  • :login - The MerchantWARE SiteID.

  • :password - The MerchantWARE Key.

  • :name - The MerchantWARE Name.

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

Public Instance Methods

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

Authorize a credit card for a given amount.

Parameters

  • money - The amount to be authorized as an Integer value in cents.

  • credit_card - The CreditCard details for the transaction.

  • options

    • :order_id - A unique reference for this order (required).

    • :billing_address - The billing address for the cardholder.

# File lib/active_merchant/billing/gateways/merchant_ware.rb, line 50
def authorize(money, credit_card, options = {})
  request = build_purchase_request(:authorize, money, credit_card, options)
  commit(:authorize, request)
end
capture(money, authorization, options = {}) click to toggle source

Capture authorized funds from a credit card.

Parameters

  • money - The amount to be captured as anInteger value in cents.

  • authorization - The authorization string returned from the initial authorization.

# File lib/active_merchant/billing/gateways/merchant_ware.rb, line 73
def capture(money, authorization, options = {})
  request = build_capture_request(:capture, money, authorization, options)
  commit(:capture, request)
end
credit(money, identification, options = {}) click to toggle source

Refund an amount back a cardholder

Parameters

  • money - The amount to be refunded as an Integer value in cents.

  • identification - The credit card you want to refund or the authorization for the existing transaction you are refunding.

  • options

    • :order_id - A unique reference for this order (required when performing a non-referenced credit)

# File lib/active_merchant/billing/gateways/merchant_ware.rb, line 99
def credit(money, identification, options = {})
  if identification.is_a?(String)          
    deprecated CREDIT_DEPRECATION_MESSAGE
    refund(money, identification, options)
  else
    perform_credit(money, identification, options)
  end
end
purchase(money, credit_card, options = {}) click to toggle source

Authorize and immediately capture funds from a credit card.

Parameters

  • money - The amount to be authorized as anInteger value in cents.

  • credit_card - The CreditCard details for the transaction.

  • options

    • :order_id - A unique reference for this order (required).

    • :billing_address - The billing address for the cardholder.

# File lib/active_merchant/billing/gateways/merchant_ware.rb, line 63
def purchase(money, credit_card, options = {})
  request = build_purchase_request(:purchase, money, credit_card, options)
  commit(:purchase, request)
end
refund(money, reference, options = {}) click to toggle source
# File lib/active_merchant/billing/gateways/merchant_ware.rb, line 108
def refund(money, reference, options = {})
  perform_reference_credit(money, reference, options)
end
void(authorization, options = {}) click to toggle source

Void a transaction.

Parameters

  • authorization - The authorization string returned from the initial authorization or purchase.

# File lib/active_merchant/billing/gateways/merchant_ware.rb, line 82
def void(authorization, options = {})
  reference, options[:order_id] = split_reference(authorization)
  
  request = soap_request(:void) do |xml|
    add_reference(xml, reference)
  end
  commit(:void, request)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.