Class: ActiveMerchant::Billing::IdealRabobankGateway
- Inherits:
-
IdealBaseGateway
- Object
- Gateway
- IdealBaseGateway
- ActiveMerchant::Billing::IdealRabobankGateway
- Defined in:
- lib/active_merchant/billing/gateways/ideal_rabobank.rb
Overview
First, make sure you have everything setup correctly and all of your dependencies in place with:
require 'rubygems'
require 'active_merchant'
ActiveMerchant expects the amounts to be given as an Integer in cents. In this case, 10 EUR becomes 1000.
Create certificates for authentication:
The PEM file expected should contain both the certificate and the generated PEM file. Some sample shell commands to generate the certificates:
openssl genrsa -aes128 -out priv.pem -passout pass:[YOUR PASSWORD] 1024
openssl req -x509 -new -key priv.pem -passin pass:[YOUR PASSWORD] -days 3000 -out cert.cer
cat cert.cer priv.pem > ideal.pem
Following the steps above, upload cert.cer to the ideal web interface and pass the path of ideal.pem to the :pem option.
Configure the gateway using your iDEAL bank account info and security settings:
Create gateway:
gateway = ActiveMerchant::Billing::IdealRabobankGateway.new(
:login => '123456789', # 9 digit merchant number
:pem => File.read(Rails.root + 'config/ideal.pem'),
:password => 'password' # password for the PEM key
)
Get list of issuers to fill selection list on your payment form:
response = gateway.issuers
list = response.issuer_list
Request transaction:
= {
:issuer_id => '0001',
:expiration_period => 'PT10M',
:return_url => 'http://www.return.url',
:order_id => '1234567890123456',
:currency => 'EUR',
:description => 'Een omschrijving',
:entrance_code => '1234'
}
response = gateway.setup_purchase(amount, )
transaction_id = response.transaction['transactionID']
redirect_url = response.service_url
Mandatory status request will confirm transaction:
response = gateway.capture(transaction_id)
Implementation contains some simplifications
-
does not support multiple subID per merchant
-
language is fixed to ‘nl’
Constant Summary
Constants inherited from IdealBaseGateway
ActiveMerchant::Billing::IdealBaseGateway::API_VERSION, ActiveMerchant::Billing::IdealBaseGateway::AUTHENTICATION_TYPE, ActiveMerchant::Billing::IdealBaseGateway::LANGUAGE, ActiveMerchant::Billing::IdealBaseGateway::SUB_ID
Constants inherited from Gateway
Gateway::CREDIT_DEPRECATION_MESSAGE, Gateway::CURRENCIES_WITHOUT_FRACTIONS, Gateway::DEBIT_CARDS
Instance Attribute Summary
Attributes inherited from Gateway
Method Summary
Methods inherited from IdealBaseGateway
#capture, #initialize, #issuers, #setup_purchase
Methods inherited from Gateway
#card_brand, card_brand, inherited, #initialize, supports?, #test?
Methods included from CreditCardFormatting
Constructor Details
This class inherits a constructor from ActiveMerchant::Billing::IdealBaseGateway