Class: MollieNLIDeal::PaymentRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/mollienl-ideal/payment_request.rb

Direct Known Subclasses

PaymentResult

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(values = nil) ⇒ PaymentRequest

Returns a new instance of PaymentRequest.



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/mollienl-ideal/payment_request.rb', line 5

def initialize(values=nil)
  return if values.nil?

  if values.kind_of?(Hash)
    values.each { |key, value| self.send key.to_s + "=", value }
  elsif values.kind_of?(REXML::Element)
    @transaction_id = values.get_text("transaction_id").to_s
    @amount = values.get_text("amount").to_s.to_i
    @currency = values.get_text("currency").to_s
    @url = URI.unescape(values.get_text("URL").to_s) 
    @message = values.get_text("message").to_s
  end
end

Instance Attribute Details

#amountObject

Returns the value of attribute amount.



3
4
5
# File 'lib/mollienl-ideal/payment_request.rb', line 3

def amount
  @amount
end

#currencyObject

Returns the value of attribute currency.



3
4
5
# File 'lib/mollienl-ideal/payment_request.rb', line 3

def currency
  @currency
end

#messageObject

Returns the value of attribute message.



3
4
5
# File 'lib/mollienl-ideal/payment_request.rb', line 3

def message
  @message
end

#transaction_idObject

Returns the value of attribute transaction_id.



3
4
5
# File 'lib/mollienl-ideal/payment_request.rb', line 3

def transaction_id
  @transaction_id
end

#urlObject

Returns the value of attribute url.



3
4
5
# File 'lib/mollienl-ideal/payment_request.rb', line 3

def url
  @url
end