Class: ActiveMerchant::Billing::OrbitalGateway

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

Overview

For more information on Orbital, visit the integration center

Authentication Options

The Orbital Gateway supports two methods of authenticating incoming requests: Source IP authentication and Connection Username/Password authentication

In addition, these IP addresses/Connection Usernames must be affiliated with the Merchant IDs for which the client should be submitting transactions.

This does allow Third Party Hosting service organizations presenting on behalf of other merchants to submit transactions. However, each time a new customer is added, the merchant or Third-Party hosting organization needs to ensure that the new Merchant IDs or Chain IDs are affiliated with the hosting companies IPs or Connection Usernames.

If the merchant expects to have more than one merchant account with the Orbital Gateway, it should have its IP addresses/Connection Usernames affiliated at the Chain level hierarchy within the Orbital Gateway. Each time a new merchant ID is added, as long as it is placed within the same Chain, it will simply work. Otherwise, the additional MIDs will need to be affiliated with the merchant IPs or Connection Usernames respectively. For example, we generally affiliate all Salem accounts [BIN 000001] with their Company Number [formerly called MA #] number so all MIDs or Divisions under that Company will automatically be affiliated.

Constant Summary collapse

API_VERSION =
"4.6"
POST_HEADERS =
{
  "MIME-Version" => "1.0",
  "Content-Type" => "Application/PTI46",
  "Content-transfer-encoding" => "text",
  "Request-number" => '1',
  "Document-type" => "Request",
  "Interface-Version" => "Ruby|ActiveMerchant|Proprietary Gateway"
}
CURRENCY_CODES =
{ 
  "AUD" => '036',
  "CAD" => '124',
  "CZK" => '203',
  "DKK" => '208',
  "HKD" => '344',
  "ICK" => '352',
  "JPY" => '392',
  "MXN" => '484',
  "NZD" => '554',
  "NOK" => '578',
  "SGD" => '702',
  "SEK" => '752',
  "CHF" => '756',
  "GBP" => '826',
  "USD" => '840',
  "EUR" => '978'
}

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 = {}) ⇒ OrbitalGateway

Returns a new instance of OrbitalGateway.



80
81
82
83
84
85
# File 'lib/active_merchant/billing/gateways/orbital.rb', line 80

def initialize(options = {})
  requires!(options, :merchant_id)
  requires!(options, :login, :password) unless options[:ip_authentication]
  @options = options
  super
end

Instance Method Details

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

A – Authorization request



88
89
90
91
92
93
94
# File 'lib/active_merchant/billing/gateways/orbital.rb', line 88

def authorize(money, creditcard, options = {})
  order = build_new_order_xml('A', money, options) do |xml|
    add_creditcard(xml, creditcard, options[:currency])        
    add_address(xml, creditcard, options)   
  end
  commit(order)
end

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

MFC - Mark For Capture



106
107
108
# File 'lib/active_merchant/billing/gateways/orbital.rb', line 106

def capture(money, authorization, options = {})
  commit(build_mark_for_capture_xml(money, authorization, options))
end

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



118
119
120
121
# File 'lib/active_merchant/billing/gateways/orbital.rb', line 118

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

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

AC – Authorization and Capture



97
98
99
100
101
102
103
# File 'lib/active_merchant/billing/gateways/orbital.rb', line 97

def purchase(money, creditcard, options = {})
  order = build_new_order_xml('AC', money, options) do |xml|
    add_creditcard(xml, creditcard, options[:currency])
    add_address(xml, creditcard, options)   
  end
  commit(order)
end

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

R – Refund request



111
112
113
114
115
116
# File 'lib/active_merchant/billing/gateways/orbital.rb', line 111

def refund(money, authorization, options = {})
  order = build_new_order_xml('R', money, options.merge(:authorization => authorization)) do |xml|
    add_refund(xml, options[:currency])
  end
  commit(order)
end

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

setting money to nil will perform a full void



124
125
126
127
# File 'lib/active_merchant/billing/gateways/orbital.rb', line 124

def void(authorization, options = {})
  order = build_void_request_xml(authorization, options)
  commit(order)
end