Class: ActiveMerchant::Billing::IridiumGateway

Inherits:
Gateway
  • Object
show all
Defined in:
lib/active_merchant/billing/gateways/iridium.rb

Overview

For more information on the Iridium Gateway please download the documentation from their Merchant Management System.

The login and password are not the username and password you use to login to the Iridium Merchant Management System. Instead, you will use the API username and password you were issued separately.

Direct Known Subclasses

CardSaveGateway

Constant Summary collapse

CURRENCY_CODES =
{
  "AUD" => '036',
  "CAD" => '124',
  "EUR" => '978',
  "GBP" => '826',
  "MXN" => '484',
  "NZD" => '554',
  "USD" => '840',
}

Constants inherited from Gateway

Gateway::CREDIT_DEPRECATION_MESSAGE, Gateway::CURRENCIES_WITHOUT_FRACTIONS, Gateway::DEBIT_CARDS

Instance Attribute Summary

Attributes inherited from Gateway

#options

Instance Method Summary collapse

Methods inherited from Gateway

#card_brand, card_brand, inherited, supports?, #test?

Methods included from CreditCardFormatting

#format

Constructor Details

#initialize(options = {}) ⇒ IridiumGateway

Returns a new instance of IridiumGateway.



36
37
38
39
# File 'lib/active_merchant/billing/gateways/iridium.rb', line 36

def initialize(options = {})
  requires!(options, :login, :password)
  super
end

Instance Method Details

#authorize(money, payment_source, options = {}) ⇒ Object



41
42
43
44
45
46
47
48
49
# File 'lib/active_merchant/billing/gateways/iridium.rb', line 41

def authorize(money, payment_source, options = {})
  setup_address_hash(options)

  if payment_source.respond_to?(:number)
    commit(build_purchase_request('PREAUTH', money, payment_source, options), options)
  else
    commit(build_reference_request('PREAUTH', money, payment_source, options), options)
  end
end

#capture(money, authorization, options = {}) ⇒ Object



61
62
63
# File 'lib/active_merchant/billing/gateways/iridium.rb', line 61

def capture(money, authorization, options = {})
  commit(build_reference_request('COLLECTION', money, authorization, options), options)
end

#credit(money, authorization, options = {}) ⇒ Object



65
66
67
68
# File 'lib/active_merchant/billing/gateways/iridium.rb', line 65

def credit(money, authorization, options={})
  deprecated CREDIT_DEPRECATION_MESSAGE
  refund(money, authorization, options)
end

#purchase(money, payment_source, options = {}) ⇒ Object



51
52
53
54
55
56
57
58
59
# File 'lib/active_merchant/billing/gateways/iridium.rb', line 51

def purchase(money, payment_source, options = {})
  setup_address_hash(options)

  if payment_source.respond_to?(:number)
    commit(build_purchase_request('SALE', money, payment_source, options), options)
  else
    commit(build_reference_request('SALE', money, payment_source, options), options)
  end
end

#refund(money, authorization, options = {}) ⇒ Object



70
71
72
# File 'lib/active_merchant/billing/gateways/iridium.rb', line 70

def refund(money, authorization, options={})
  commit(build_reference_request('REFUND', money, authorization, options), options)
end

#void(authorization, options = {}) ⇒ Object



74
75
76
# File 'lib/active_merchant/billing/gateways/iridium.rb', line 74

def void(authorization, options={})
  commit(build_reference_request('VOID', nil, authorization, options), options)
end