Class: ActiveMerchant::Billing::IdealBaseGateway

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

Overview

Implementation contains some simplifications

  • does not support multiple subID per merchant

  • language is fixed to ‘nl’

Direct Known Subclasses

IdealRabobankGateway

Constant Summary collapse

AUTHENTICATION_TYPE =

These constants will never change for most users

'SHA1_RSA'
LANGUAGE =
'nl'
SUB_ID =
'0'
API_VERSION =
'1.1.0'

Constants inherited from Gateway

Gateway::CREDIT_DEPRECATION_MESSAGE, Gateway::CURRENCIES_WITHOUT_FRACTIONS, Gateway::DEBIT_CARDS

Instance Attribute Summary collapse

Attributes inherited from Gateway

#options

Instance Method Summary collapse

Methods inherited from Gateway

#card_brand, card_brand, inherited, supports?

Methods included from CreditCardFormatting

#format

Constructor Details

#initialize(options = {}) ⇒ IdealBaseGateway

Returns a new instance of IdealBaseGateway.



24
25
26
27
28
29
30
31
# File 'lib/active_merchant/billing/gateways/ideal/ideal_base.rb', line 24

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

  @options[:pem_password] = options[:password]
  @url = test? ? test_url : live_url
  super
end

Instance Attribute Details

#urlObject (readonly)

Returns the value of attribute url.



22
23
24
# File 'lib/active_merchant/billing/gateways/ideal/ideal_base.rb', line 22

def url
  @url
end

Instance Method Details

#capture(transaction, options = {}) ⇒ Object

Check status of transaction and confirm payment transaction_id must be a valid transaction_id from a prior setup.



42
43
44
45
# File 'lib/active_merchant/billing/gateways/ideal/ideal_base.rb', line 42

def capture(transaction, options = {})
  options[:transaction_id] = transaction
  commit(build_status_request(options))
end

#issuersObject

Get list of issuers from response.issuer_list



48
49
50
# File 'lib/active_merchant/billing/gateways/ideal/ideal_base.rb', line 48

def issuers
  commit(build_directory_request)
end

#setup_purchase(money, options = {}) ⇒ Object

Setup transaction. Get redirect_url from response.service_url



34
35
36
37
38
# File 'lib/active_merchant/billing/gateways/ideal/ideal_base.rb', line 34

def setup_purchase(money, options = {})
  requires!(options, :issuer_id, :return_url, :order_id, :currency, :description, :entrance_code)

  commit(build_transaction_request(money, options))
end

#test?Boolean

Returns:

  • (Boolean)


52
53
54
# File 'lib/active_merchant/billing/gateways/ideal/ideal_base.rb', line 52

def test?
  @options[:test] || Base.gateway_mode == :test
end