Class: Buckaroo::Ideal::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/buckaroo-ideal/config.rb

Overview

Configuration singleton for storing settings required for making transactions.

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.autoclose_popupBoolean

If the POPUP style is being used, you can autoclose the popup after a transaction. You will have to provide information about the transaction to the user on the page he will arrive on.

Returns:

  • (Boolean)

    Autoclose the popup after a transaction



63
64
65
# File 'lib/buckaroo-ideal/config.rb', line 63

def autoclose_popup
  @autoclose_popup
end

.error_urlString

Returns The URL the user will be redirected to after an error occured during the transaction.

Returns:

  • (String)

    The URL the user will be redirected to after an error occured during the transaction



45
46
47
# File 'lib/buckaroo-ideal/config.rb', line 45

def error_url
  @error_url
end

.gateway_urlString

The gateway URL that is used to post form data to.

Returns:

  • (String)

    The gateway URL



12
13
14
# File 'lib/buckaroo-ideal/config.rb', line 12

def gateway_url
  @gateway_url
end

.merchant_keyString

The merchant-key is supllied by Buckaroo. Every application MUST have it’s own merchant key.

Returns:

  • (String)

    The merchant-key for the application



18
19
20
# File 'lib/buckaroo-ideal/config.rb', line 18

def merchant_key
  @merchant_key
end

.reject_urlString

Returns The URL the user will be redirected to after a failed transaction.

Returns:

  • (String)

    The URL the user will be redirected to after a failed transaction



41
42
43
# File 'lib/buckaroo-ideal/config.rb', line 41

def reject_url
  @reject_url
end

.return_methodString

Returns The HTTP method that will be used to return the user back to the application after a transaction.

Returns:

  • (String)

    The HTTP method that will be used to return the user back to the application after a transaction



49
50
51
# File 'lib/buckaroo-ideal/config.rb', line 49

def return_method
  @return_method
end

.secret_keyString

The secret_key should only be known by your application and Buckaroo. It is used to sign orders and validate transactions.

Returns:

  • (String)

    The shared secret key that is used to sign transaction requests



25
26
27
# File 'lib/buckaroo-ideal/config.rb', line 25

def secret_key
  @secret_key
end

.styleString

There are 2 styles that you can use to integrate Buckaroo iDEAL:

  • POPUP - The transaction is performed in a popup

  • PAGE - The transaction is performed in the original window

Returns:

  • (String)

    The style that is being used



56
57
58
# File 'lib/buckaroo-ideal/config.rb', line 56

def style
  @style
end

.success_urlString

Returns The URL the user will be redirected to after a successful transaction.

Returns:

  • (String)

    The URL the user will be redirected to after a successful transaction



37
38
39
# File 'lib/buckaroo-ideal/config.rb', line 37

def success_url
  @success_url
end

.test_modeBoolean

If test_mode is enabled, transactions will be registered by Buckaroo, but clients will not be forwared to the iDEAL page of their bank.

Clients will be redirected back to the success_url of your application

Returns:

  • (Boolean)

    Test mode on/off



33
34
35
# File 'lib/buckaroo-ideal/config.rb', line 33

def test_mode
  @test_mode
end

Class Method Details

.configure(settings = {}) ⇒ Object

Configure the integration with Buckaroo



82
83
84
85
86
# File 'lib/buckaroo-ideal/config.rb', line 82

def configure(settings = {})
  defaults.merge(settings).each do |key, value|
    set key, value
  end
end

.defaultsObject

Default settings



66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/buckaroo-ideal/config.rb', line 66

def defaults
  {
    :gateway_url     =>  'https://payment.buckaroo.nl/gateway/ideal_payment.asp',
    :merchant_key    =>  nil,
    :secret_key      =>  nil,
    :test_mode       =>  false,
    :success_url     =>  nil,
    :reject_url      =>  nil,
    :error_url       =>  nil,
    :return_method   => 'POST',
    :style           => 'PAGE',
    :autoclose_popup => false
  }
end

.resetObject

Reset the configuration to the default values



89
90
91
# File 'lib/buckaroo-ideal/config.rb', line 89

def reset
  configure({})
end