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 Utils

#deprecated, generate_unique_id

Methods included from CreditCardFormatting

#format

Methods included from RequiresParameters

#requires!

Methods included from PostsData

included, #raw_ssl_request, #ssl_get, #ssl_post, #ssl_request

Constructor Details

#initialize(options = {}) ⇒ OrbitalGateway

Returns a new instance of OrbitalGateway.



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

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

Instance Method Details

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

A – Authorization request



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

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



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

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

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



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

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

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

AC – Authorization and Capture



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

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



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

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(money, authorization, options = {}) ⇒ Object

setting money to nil will perform a full void



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

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