Class: ActiveMerchant::Billing::RealexGateway
- Defined in:
- lib/active_merchant/billing/gateways/realex.rb
Overview
Realex is 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::CREDIT_DEPRECATION_MESSAGE, Gateway::CURRENCIES_WITHOUT_FRACTIONS, Gateway::DEBIT_CARDS
Instance Attribute Summary
Attributes inherited from Gateway
Instance Method Summary collapse
- #authorize(money, creditcard, options = {}) ⇒ Object
- #capture(money, authorization, options = {}) ⇒ Object
- #credit(money, authorization, options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ RealexGateway
constructor
A new instance of RealexGateway.
- #purchase(money, credit_card, options = {}) ⇒ Object
- #refund(money, authorization, options = {}) ⇒ Object
- #void(authorization, options = {}) ⇒ Object
Methods inherited from Gateway
#card_brand, card_brand, inherited, supports?, #test?
Methods included from CreditCardFormatting
Constructor Details
#initialize(options = {}) ⇒ RealexGateway
Returns a new instance of RealexGateway.
45 46 47 48 49 50 |
# File 'lib/active_merchant/billing/gateways/realex.rb', line 45 def initialize( = {}) requires!(, :login, :password) [:refund_hash] = Digest::SHA1.hexdigest([:rebate_secret]) if .has_key?(:rebate_secret) @options = super end |
Instance Method Details
#authorize(money, creditcard, options = {}) ⇒ Object
59 60 61 62 63 64 |
# File 'lib/active_merchant/billing/gateways/realex.rb', line 59 def (money, creditcard, = {}) requires!(, :order_id) request = (:authorization, money, creditcard, ) commit(request) end |
#capture(money, authorization, options = {}) ⇒ Object
66 67 68 69 |
# File 'lib/active_merchant/billing/gateways/realex.rb', line 66 def capture(money, , = {}) request = build_capture_request(, ) commit(request) end |
#credit(money, authorization, options = {}) ⇒ Object
76 77 78 79 |
# File 'lib/active_merchant/billing/gateways/realex.rb', line 76 def credit(money, , = {}) deprecated CREDIT_DEPRECATION_MESSAGE refund(money, , ) end |
#purchase(money, credit_card, options = {}) ⇒ Object
52 53 54 55 56 57 |
# File 'lib/active_merchant/billing/gateways/realex.rb', line 52 def purchase(money, credit_card, = {}) requires!(, :order_id) request = (:purchase, money, credit_card, ) commit(request) end |
#refund(money, authorization, options = {}) ⇒ Object
71 72 73 74 |
# File 'lib/active_merchant/billing/gateways/realex.rb', line 71 def refund(money, , = {}) request = build_refund_request(money, , ) commit(request) end |
#void(authorization, options = {}) ⇒ Object
81 82 83 84 |
# File 'lib/active_merchant/billing/gateways/realex.rb', line 81 def void(, = {}) request = build_void_request(, ) commit(request) end |