Class: ActiveMerchant::Billing::OrbitalGateway
- Includes:
- Empty
- 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.
Defined Under Namespace
Constant Summary collapse
- API_VERSION =
'8.1'
- POST_HEADERS =
{ 'MIME-Version' => '1.1', 'Content-Type' => "application/PTI#{API_VERSION.delete('.')}", 'Content-transfer-encoding' => 'text', 'Request-number' => '1', 'Document-type' => 'Request', 'Interface-Version' => 'Ruby|ActiveMerchant|Proprietary Gateway' }
- SUCCESS =
'0'
- APPROVED =
[ '00', # Approved '08', # Approved authorization, honor with ID '11', # Approved authorization, VIP approval '24', # Validated '26', # Pre-noted '27', # No reason to decline '28', # Received and stored '29', # Provided authorization '31', # Request received '32', # BIN alert '34', # Approved for partial '91', # Approved low fraud '92', # Approved medium fraud '93', # Approved high fraud '94', # Approved fraud service unavailable 'E7', # Stored 'PA', # Partial approval 'P1' # ECP - AVS - Account Status Verification and/or AOA data is in a positive status. ]
- AVS_SUPPORTED_COUNTRIES =
%w[US CA UK GB]
- CURRENCY_CODES =
{ 'AUD' => '036', 'BRL' => '986', 'CAD' => '124', 'CLP' => '152', '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' }
- CURRENCY_EXPONENTS =
{ 'AUD' => '2', 'BRL' => '2', 'CAD' => '2', 'CLP' => '2', 'CZK' => '2', 'DKK' => '2', 'HKD' => '2', 'ICK' => '2', 'JPY' => '0', 'MXN' => '2', 'NZD' => '2', 'NOK' => '2', 'SGD' => '2', 'SEK' => '2', 'CHF' => '2', 'GBP' => '2', 'USD' => '2', 'EUR' => '2' }
- ECOMMERCE_TRANSACTION =
INDUSTRY TYPES
'EC'
- RECURRING_PAYMENT_TRANSACTION =
'RC'
- MAIL_ORDER_TELEPHONE_ORDER_TRANSACTION =
'MO'
- INTERACTIVE_VOICE_RESPONSE =
'IV'
- AUTH_ONLY =
Auth Only No Capture
'A'
- AUTH_AND_CAPTURE =
AC - Auth and Capture = ‘AC’
'AC'
- FORCE_AUTH_ONLY =
F - Force Auth No Capture and no online authorization = ‘F’
'F'
- FORCE_AUTH_AND_CAPTURE =
FR - Force Auth No Capture and no online authorization = ‘FR’ FC - Force Auth and Capture no online authorization = ‘FC’
'FC'
- REFUND =
Refund and Capture no online authorization
'R'
- TAX_NOT_PROVIDED =
Tax Inds
0
- TAX_INCLUDED =
1
- NON_TAXABLE_TRANSACTION =
2
- CREATE =
Customer Profile Actions
'C'
- RETRIEVE =
'R'
- UPDATE =
'U'
- DELETE =
'D'
- RECURRING =
'R'
- DEFERRED =
'D'
- ACTIVE =
Status Profile Status Flag This field is used to set the status of a Customer Profile.
'A'
- INACTIVE =
'I'
- MANUAL_SUSPEND =
'MS'
- NO_MAPPING_TO_ORDER_DATA =
CustomerProfileOrderOverrideInd Defines if any Order Data can be pre-populated from the Customer Reference Number (CustomerRefNum)
'NO'
- USE_CRN_FOR_ORDER_ID =
'OI'
- USE_CRN_FOR_COMMENTS =
'OD'
- USE_CRN_FOR_ORDER_ID_AND_COMMENTS =
'OA'
- AUTO_GENERATE =
CustomerProfileFromOrderInd Method to use to Generate the Customer Profile Number When Customer Profile Action Type = Create, defines what the Customer Profile Number will be:
'A'
- USE_CUSTOMER_REF_NUM =
Auto-Generate the CustomerRefNum
'S'
- USE_ORDER_ID =
Use CustomerRefNum field
'O'
- USE_COMMENTS =
Use OrderID field
'D'
- SENSITIVE_FIELDS =
Use Comments field
%i[account_num cc_account_num]
- ACCOUNT_TYPE =
Bank account types to be used for check processing
{ 'savings' => 'S', 'checking' => 'C' }
- ECP_AUTH_METHODS =
Fixed possible values for orbital ECP attributes Auth methods for electronic checks can be: Written, Internet, Telephonic, Account Receivable, Point of Purchase. Default auth method for ECP is Internet (I). Bank payment delivery can be either ACH (Automated Clearing House) or Best Possible. Default Bank Payment Delivery is Best Possible (B). Action codes to be used for Early Warning System and additional validations. Valid combinations of Message Type and Action Code to be used are:
A W1 AC W1 FC W4 R W6 FC W8 A W3 AC W3 FC W5 R W7
Default Action code for ECP is nil. Electronic check to be processed on same day (Y) or next day (N). Default ECP Same Day Index is Yes (Y).
%w[W I T A P]
- ECP_BANK_PAYMENT =
%w[A B]
- ECP_ACTION_CODES =
%w[LO ND NC W1 W3 W4 W5 W6 W7 W8 W9]
- ECP_SAME_DAY =
%w[Y N]
Constants inherited from Gateway
Gateway::CREDIT_DEPRECATION_MESSAGE, Gateway::RECURRING_DEPRECATION_MESSAGE, Gateway::STANDARD_ERROR_CODE
Instance Attribute Summary
Attributes inherited from Gateway
Instance Method Summary collapse
-
#add_customer_profile(creditcard, options = {}) ⇒ Object
Customer Profiles :customer_ref_num should be set unless you’re happy with Orbital providing one.
-
#authorize(money, payment_source, options = {}) ⇒ Object
A – Authorization request.
-
#capture(money, authorization, options = {}) ⇒ Object
MFC - Mark For Capture.
- #credit(money, authorization, options = {}) ⇒ Object
- #delete_customer_profile(customer_ref_num) ⇒ Object
-
#initialize(options = {}) ⇒ OrbitalGateway
constructor
A new instance of OrbitalGateway.
-
#purchase(money, payment_source, options = {}) ⇒ Object
AC – Authorization and Capture.
-
#refund(money, authorization, options = {}) ⇒ Object
R – Refund request.
- #retrieve_customer_profile(customer_ref_num) ⇒ Object
- #scrub(transcript) ⇒ Object
- #supports_scrubbing? ⇒ Boolean
- #update_customer_profile(creditcard, options = {}) ⇒ Object
- #verify(creditcard, options = {}) ⇒ Object
- #void(authorization, options = {}, deprecated = {}) ⇒ Object
Methods inherited from Gateway
#add_field_to_post_if_present, #add_fields_to_post_if_present, #card_brand, card_brand, #generate_unique_id, inherited, #supported_countries, supported_countries, supported_countries=, supports?, #supports_network_tokenization?, #test?
Methods included from CreditCardFormatting
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.
218 219 220 221 222 223 |
# File 'lib/active_merchant/billing/gateways/orbital.rb', line 218 def initialize( = {}) requires!(, :merchant_id) requires!(, :login, :password) unless [:ip_authentication] super @options[:merchant_id] = @options[:merchant_id].to_s end |
Instance Method Details
#add_customer_profile(creditcard, options = {}) ⇒ Object
Customer Profiles
:customer_ref_num should be set unless you’re 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
308 309 310 311 312 |
# File 'lib/active_merchant/billing/gateways/orbital.rb', line 308 def add_customer_profile(creditcard, = {}) [:customer_profile_action] = CREATE order = build_customer_request_xml(creditcard, ) commit(order, :add_customer_profile) end |
#authorize(money, payment_source, options = {}) ⇒ Object
A – Authorization request
226 227 228 229 230 231 232 233 234 235 236 |
# File 'lib/active_merchant/billing/gateways/orbital.rb', line 226 def (money, payment_source, = {}) order = build_new_order_xml(AUTH_ONLY, money, payment_source, ) do |xml| add_payment_source(xml, payment_source, ) add_address(xml, payment_source, ) if @options[:customer_profiles] add_customer_data(xml, payment_source, ) add_managed_billing(xml, ) end end commit(order, :authorize, [:trace_number]) end |
#capture(money, authorization, options = {}) ⇒ Object
MFC - Mark For Capture
259 260 261 |
# File 'lib/active_merchant/billing/gateways/orbital.rb', line 259 def capture(money, , = {}) commit(build_mark_for_capture_xml(money, , ), :capture) end |
#credit(money, authorization, options = {}) ⇒ Object
272 273 274 275 |
# File 'lib/active_merchant/billing/gateways/orbital.rb', line 272 def credit(money, , = {}) ActiveMerchant.deprecated CREDIT_DEPRECATION_MESSAGE refund(money, , ) end |
#delete_customer_profile(customer_ref_num) ⇒ Object
326 327 328 329 330 |
# File 'lib/active_merchant/billing/gateways/orbital.rb', line 326 def delete_customer_profile(customer_ref_num) = { customer_profile_action: DELETE, customer_ref_num: customer_ref_num } order = build_customer_request_xml(nil, ) commit(order, :delete_customer_profile) end |
#purchase(money, payment_source, options = {}) ⇒ Object
AC – Authorization and Capture
246 247 248 249 250 251 252 253 254 255 256 |
# File 'lib/active_merchant/billing/gateways/orbital.rb', line 246 def purchase(money, payment_source, = {}) order = build_new_order_xml([:force_capture] ? FORCE_AUTH_AND_CAPTURE : AUTH_AND_CAPTURE, money, payment_source, ) do |xml| add_payment_source(xml, payment_source, ) add_address(xml, payment_source, ) if @options[:customer_profiles] add_customer_data(xml, payment_source, ) add_managed_billing(xml, ) end end commit(order, :purchase, [:trace_number]) end |
#refund(money, authorization, options = {}) ⇒ Object
R – Refund request
264 265 266 267 268 269 270 |
# File 'lib/active_merchant/billing/gateways/orbital.rb', line 264 def refund(money, , = {}) order = build_new_order_xml(REFUND, money, nil, .merge(authorization: )) do |xml| add_refund(xml, [:currency]) xml.tag! :CustomerRefNum, [:customer_ref_num] if @options[:customer_profiles] && [:profile_txn] end commit(order, :refund, [:trace_number]) end |
#retrieve_customer_profile(customer_ref_num) ⇒ Object
320 321 322 323 324 |
# File 'lib/active_merchant/billing/gateways/orbital.rb', line 320 def retrieve_customer_profile(customer_ref_num) = { customer_profile_action: RETRIEVE, customer_ref_num: customer_ref_num } order = build_customer_request_xml(nil, ) commit(order, :retrieve_customer_profile) end |
#scrub(transcript) ⇒ Object
336 337 338 339 340 341 342 343 344 345 346 347 |
# File 'lib/active_merchant/billing/gateways/orbital.rb', line 336 def scrub(transcript) transcript. gsub(%r((<OrbitalConnectionUsername>).+(</OrbitalConnectionUsername>)), '\1[FILTERED]\2'). gsub(%r((<OrbitalConnectionPassword>).+(</OrbitalConnectionPassword>)), '\1[FILTERED]\2'). gsub(%r((<AccountNum>).+(</AccountNum>)), '\1[FILTERED]\2'). # the response sometimes contains a new line that cuts off the end of the closing tag gsub(%r((<CCAccountNum>).+(</CC)), '\1[FILTERED]\2'). gsub(%r((<CardSecVal>).+(</CardSecVal>)), '\1[FILTERED]\2'). gsub(%r((<MerchantID>).+(</MerchantID>)), '\1[FILTERED]\2'). gsub(%r((<CustomerMerchantID>).+(</CustomerMerchantID>)), '\1[FILTERED]\2'). gsub(%r((<CustomerProfileMessage>).+(</CustomerProfileMessage>)), '\1[FILTERED]\2') end |
#supports_scrubbing? ⇒ Boolean
332 333 334 |
# File 'lib/active_merchant/billing/gateways/orbital.rb', line 332 def supports_scrubbing? true end |
#update_customer_profile(creditcard, options = {}) ⇒ Object
314 315 316 317 318 |
# File 'lib/active_merchant/billing/gateways/orbital.rb', line 314 def update_customer_profile(creditcard, = {}) [:customer_profile_action] = UPDATE order = build_customer_request_xml(creditcard, ) commit(order, :update_customer_profile) end |
#verify(creditcard, options = {}) ⇒ Object
238 239 240 241 242 243 |
# File 'lib/active_merchant/billing/gateways/orbital.rb', line 238 def verify(creditcard, = {}) MultiResponse.run(:use_first_response) do |r| r.process { (100, creditcard, ) } r.process(:ignore_result) { void(r.) } end end |
#void(authorization, options = {}, deprecated = {}) ⇒ Object
277 278 279 280 281 282 283 284 285 |
# File 'lib/active_merchant/billing/gateways/orbital.rb', line 277 def void(, = {}, deprecated = {}) if !.kind_of?(Hash) ActiveMerchant.deprecated('Calling the void method with an amount parameter is deprecated and will be removed in a future version.') return void(, deprecated.merge(amount: )) end order = build_void_request_xml(, ) commit(order, :void, [:trace_number]) end |