Class: BunqRb::Payment

Inherits:
Object
  • Object
show all
Includes:
Shared
Defined in:
lib/bunq_rb/objects/payment.rb

Overview

Payment

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hsh = {}) ⇒ Payment

Returns a new instance of Payment.



10
11
12
13
14
15
16
# File 'lib/bunq_rb/objects/payment.rb', line 10

def initialize(hsh = {})
  @id = hsh["id"]
  @description = hsh["description"]
  @amount = Money.new(hsh["amount"]["value"].to_f * 100, hsh["amount"]["currency"])
  @created = Time.parse(hsh["created"])
  @updated = Time.parse(hsh["updated"])
end

Instance Attribute Details

#amountObject (readonly)

Returns the value of attribute amount.



8
9
10
# File 'lib/bunq_rb/objects/payment.rb', line 8

def amount
  @amount
end

#createdObject (readonly)

Returns the value of attribute created.



8
9
10
# File 'lib/bunq_rb/objects/payment.rb', line 8

def created
  @created
end

#descriptionObject (readonly)

Returns the value of attribute description.



8
9
10
# File 'lib/bunq_rb/objects/payment.rb', line 8

def description
  @description
end

#idObject (readonly)

Returns the value of attribute id.



8
9
10
# File 'lib/bunq_rb/objects/payment.rb', line 8

def id
  @id
end

#updatedObject (readonly)

Returns the value of attribute updated.



8
9
10
# File 'lib/bunq_rb/objects/payment.rb', line 8

def updated
  @updated
end

Class Method Details

.url(user_id, monetary_account_id) ⇒ Object



18
19
20
# File 'lib/bunq_rb/objects/payment.rb', line 18

def self.url(user_id, )
  "/v1/user/#{user_id}/monetary-account/#{}/payment"
end