Class: ActiveMerchant::Billing::RealexGateway

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

Overview

Realex us the leading CC gateway in Ireland see www.realexpayments.com Contributed by John Ward ([email protected]) see thinedgeofthewedge.blogspot.com

Realex works using the following login - The unique id of the merchant password - The secret is used to digitally sign the request account - This is an optional third part of the authentication process and is used if the merchant wishes do distuinguish cc traffic from the different sources by using a different account. This must be created in advance

the Realex team decided to make the orderid unique per request, so if validation fails you can not correct and resend using the same order id

Constant Summary collapse

URL =
'https://epage.payandshop.com/epage-remote.cgi'
CARD_MAPPING =
{
  'master'            => 'MC',
  'visa'              => 'VISA',
  'american_express'  => 'AMEX',
  'diners_club'       => 'DINERS',
  'switch'            => 'SWITCH',
  'solo'              => 'SWITCH',
  'laser'             => 'LASER'
}
BANK_ERROR =
REALEX_ERROR  = "Gateway is in maintenance. Please try again later."
ERROR =
CLIENT_DEACTIVATED = "Gateway Error"

Constants inherited from Gateway

Gateway::DEBIT_CARDS

Constants included from PostsData

PostsData::MAX_RETRIES, PostsData::OPEN_TIMEOUT, PostsData::READ_TIMEOUT

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

generate_unique_id

Methods included from CreditCardFormatting

#format

Methods included from RequiresParameters

#requires!

Methods included from PostsData

included, #retry_exceptions, #ssl_post

Constructor Details

#initialize(options = {}) ⇒ RealexGateway

Returns a new instance of RealexGateway.



45
46
47
48
49
# File 'lib/active_merchant/billing/gateways/realex.rb', line 45

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

Instance Method Details

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



51
52
53
54
55
56
# File 'lib/active_merchant/billing/gateways/realex.rb', line 51

def purchase(money, credit_card, options = {})
  requires!(options, :order_id)
  
  request = build_purchase_or_authorization_request(:purchase, money, credit_card, options) 
  commit(request)
end