Class: ActiveMerchant::Billing::OrbitalGateway

Inherits:
Gateway
  • Object
show all
Defined in:
lib/active_merchant/billing/gateways/orbital.rb,
lib/active_merchant/billing/gateways/orbital/avs_result.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.

Defined Under Namespace

Classes: AVSResult

Constant Summary collapse

API_VERSION =
"5.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"
}
AVS_SUPPORTED_COUNTRIES =
['US', 'CA', 'UK', 'GB']
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.



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

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

Instance Method Details

#add_customer_profile(creditcard, options = {}) ⇒ Object

Customer Profiles

:customer_ref_num should be set unless your happy with Orbital providing one

:customer_profile_order_override_ind can be set to map the CustomerRefNum to OrderID or Comments. Defaults to ‘NO’ - no mapping

'NO' - No mapping to order data
'OI' - Use <CustomerRefNum> for <OrderID>
'OD' - Use <CustomerRefNum> for <Comments>
'OA' - Use <CustomerRefNum> for <OrderID> and <Comments>

:order_default_description can be set optionally. 64 char max.

:order_default_amount can be set optionally. integer as cents.

:status defaults to Active

'A' - Active
'I' - Inactive
'MS'  - Manual Suspend


156
157
158
159
160
# File 'lib/active_merchant/billing/gateways/orbital.rb', line 156

def add_customer_profile(creditcard, options = {})
  options.merge!(:customer_profile_action => 'C')
  order = build_customer_request_xml(creditcard, options)
  commit(order, :add_customer_profile)
end

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

A – Authorization request



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

def authorize(money, creditcard, options = {})
  order = build_new_order_xml('A', money, options) do |xml|
    add_creditcard(xml, creditcard, options[:currency]) unless creditcard.nil? && options[:profile_txn]
    add_address(xml, creditcard, options)
    add_customer_data(xml, options) if @options[:customer_profiles]
  end
  commit(order, :authorize)
end

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

MFC - Mark For Capture



110
111
112
# File 'lib/active_merchant/billing/gateways/orbital.rb', line 110

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

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



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

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

#delete_customer_profile(customer_ref_num) ⇒ Object



174
175
176
177
178
# File 'lib/active_merchant/billing/gateways/orbital.rb', line 174

def delete_customer_profile(customer_ref_num)
  options = {:customer_profile_action => 'D', :customer_ref_num => customer_ref_num}
  order = build_customer_request_xml(nil, options)
  commit(order, :delete_customer_profile)
end

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

AC – Authorization and Capture



100
101
102
103
104
105
106
107
# File 'lib/active_merchant/billing/gateways/orbital.rb', line 100

def purchase(money, creditcard, options = {})
  order = build_new_order_xml('AC', money, options) do |xml|
    add_creditcard(xml, creditcard, options[:currency]) unless creditcard.nil? && options[:profile_txn]
    add_address(xml, creditcard, options)
    add_customer_data(xml, options) if @options[:customer_profiles]
  end
  commit(order, :purchase)
end

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

R – Refund request



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

def refund(money, authorization, options = {})
  order = build_new_order_xml('R', money, options.merge(:authorization => authorization)) do |xml|
    add_refund(xml, options[:currency])
    xml.tag! :CustomerRefNum, options[:customer_ref_num] if @options[:customer_profiles] && options[:profile_txn]
  end
  commit(order, :refund)
end

#retrieve_customer_profile(customer_ref_num) ⇒ Object



168
169
170
171
172
# File 'lib/active_merchant/billing/gateways/orbital.rb', line 168

def retrieve_customer_profile(customer_ref_num)
  options = {:customer_profile_action => 'R', :customer_ref_num => customer_ref_num}
  order = build_customer_request_xml(nil, options)
  commit(order, :retrieve_customer_profile)
end

#update_customer_profile(creditcard, options = {}) ⇒ Object



162
163
164
165
166
# File 'lib/active_merchant/billing/gateways/orbital.rb', line 162

def update_customer_profile(creditcard, options = {})
  options.merge!(:customer_profile_action => 'U')
  order = build_customer_request_xml(creditcard, options)
  commit(order, :update_customer_profile)
end

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

setting money to nil will perform a full void



129
130
131
132
# File 'lib/active_merchant/billing/gateways/orbital.rb', line 129

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