Class: AbnAmro::Internetkassa
- Inherits:
-
Object
- Object
- AbnAmro::Internetkassa
- Defined in:
- lib/abn-amro/internetkassa.rb,
lib/abn-amro/internetkassa/helpers.rb,
lib/abn-amro/internetkassa/response.rb,
lib/abn-amro/internetkassa/response_codes.rb
Defined Under Namespace
Modules: Helpers Classes: Response
Constant Summary collapse
- MANDATORY_VALUES =
%w{ merchant_id order_id amount currency language }
- DEFAULT_VALUES =
{ :currency => 'EUR', :language => 'nl_NL' }
- PRODUCTION_URL =
"https://internetkassa.abnamro.nl/ncol/prod/orderstandard.asp"
- TEST_URL =
"https://internetkassa.abnamro.nl/ncol/test/orderstandard.asp"
Class Attribute Summary collapse
-
.pspid ⇒ Object
(also: merchant_id)
Returns the value of attribute pspid.
-
.shasign ⇒ Object
(also: passphrase)
Returns the value of attribute shasign.
-
.test ⇒ Object
Returns the value of attribute test.
Instance Attribute Summary collapse
-
#accept_url ⇒ Object
Returns the value of attribute accept_url.
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#cancel_url ⇒ Object
Returns the value of attribute cancel_url.
-
#currency ⇒ Object
Returns the value of attribute currency.
-
#decline_url ⇒ Object
Returns the value of attribute decline_url.
-
#description ⇒ Object
Returns the value of attribute description.
-
#endpoint_params ⇒ Object
Returns the value of attribute endpoint_params.
-
#exception_url ⇒ Object
Returns the value of attribute exception_url.
-
#language ⇒ Object
Returns the value of attribute language.
-
#order_id ⇒ Object
Returns the value of attribute order_id.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#url_variable ⇒ Object
Returns the value of attribute url_variable.
Class Method Summary collapse
Instance Method Summary collapse
- #data ⇒ Object
-
#endpoint_url=(url) ⇒ Object
Shortcut which sets the accept_url, decline_url, cancel_url, exception_url, and cancel_url to the specified
url
. -
#initialize(params = {}) ⇒ Internetkassa
constructor
A new instance of Internetkassa.
Constructor Details
#initialize(params = {}) ⇒ Internetkassa
Returns a new instance of Internetkassa.
36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/abn-amro/internetkassa.rb', line 36 def initialize(params = {}) @params = {} DEFAULT_VALUES.merge(params).each do |k,v| if respond_to?("#{k}=") send("#{k}=", v) else @params[k] = v end end end |
Class Attribute Details
.pspid ⇒ Object Also known as: merchant_id
Returns the value of attribute pspid.
8 9 10 |
# File 'lib/abn-amro/internetkassa.rb', line 8 def pspid @pspid end |
.shasign ⇒ Object Also known as: passphrase
Returns the value of attribute shasign.
8 9 10 |
# File 'lib/abn-amro/internetkassa.rb', line 8 def shasign @shasign end |
.test ⇒ Object
Returns the value of attribute test.
8 9 10 |
# File 'lib/abn-amro/internetkassa.rb', line 8 def test @test end |
Instance Attribute Details
#accept_url ⇒ Object
Returns the value of attribute accept_url.
33 34 35 |
# File 'lib/abn-amro/internetkassa.rb', line 33 def accept_url @accept_url end |
#amount ⇒ Object
Returns the value of attribute amount.
32 33 34 |
# File 'lib/abn-amro/internetkassa.rb', line 32 def amount @amount end |
#cancel_url ⇒ Object
Returns the value of attribute cancel_url.
33 34 35 |
# File 'lib/abn-amro/internetkassa.rb', line 33 def cancel_url @cancel_url end |
#currency ⇒ Object
Returns the value of attribute currency.
32 33 34 |
# File 'lib/abn-amro/internetkassa.rb', line 32 def currency @currency end |
#decline_url ⇒ Object
Returns the value of attribute decline_url.
33 34 35 |
# File 'lib/abn-amro/internetkassa.rb', line 33 def decline_url @decline_url end |
#description ⇒ Object
Returns the value of attribute description.
32 33 34 |
# File 'lib/abn-amro/internetkassa.rb', line 32 def description @description end |
#endpoint_params ⇒ Object
Returns the value of attribute endpoint_params.
34 35 36 |
# File 'lib/abn-amro/internetkassa.rb', line 34 def endpoint_params @endpoint_params end |
#exception_url ⇒ Object
Returns the value of attribute exception_url.
33 34 35 |
# File 'lib/abn-amro/internetkassa.rb', line 33 def exception_url @exception_url end |
#language ⇒ Object
Returns the value of attribute language.
32 33 34 |
# File 'lib/abn-amro/internetkassa.rb', line 32 def language @language end |
#order_id ⇒ Object
Returns the value of attribute order_id.
32 33 34 |
# File 'lib/abn-amro/internetkassa.rb', line 32 def order_id @order_id end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
30 31 32 |
# File 'lib/abn-amro/internetkassa.rb', line 30 def params @params end |
#url_variable ⇒ Object
Returns the value of attribute url_variable.
34 35 36 |
# File 'lib/abn-amro/internetkassa.rb', line 34 def url_variable @url_variable end |
Class Method Details
.service_url ⇒ Object
20 21 22 |
# File 'lib/abn-amro/internetkassa.rb', line 20 def service_url test? ? TEST_URL : PRODUCTION_URL end |
.test? ⇒ Boolean
16 17 18 |
# File 'lib/abn-amro/internetkassa.rb', line 16 def test? @test end |
Instance Method Details
#data ⇒ Object
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/abn-amro/internetkassa.rb', line 54 def data verify_values! @params.merge( :PSPID => merchant_id, :orderID => @order_id, :amount => @amount, :currency => @currency, :language => @language, :COM => @description, :SHASign => signature, :PARAMVAR => @url_variable, :PARAMPLUS => url_encoded_endpoint_params, :accepturl => @accept_url, :declineurl => @decline_url, :exceptionurl => @exception_url, :cancelurl => @cancel_url ).delete_if { |key, value| value.nil? || value.to_s.empty? } end |
#endpoint_url=(url) ⇒ Object
Shortcut which sets the accept_url, decline_url, cancel_url, exception_url, and cancel_url to the specified url
.
50 51 52 |
# File 'lib/abn-amro/internetkassa.rb', line 50 def endpoint_url=(url) @accept_url = @decline_url = @exception_url = @cancel_url = url end |