class BlueBank::Payment

Attributes

account[R]
client[R]
id[R]

Public Class Methods

new(id:, account:, client:, json: nil) click to toggle source
# File lib/blue_bank/payment.rb, line 3
def initialize(id:, account:, client:, json: nil)
  @id, @account, @client, @json = id, account, client, json
end

Public Instance Methods

instructed?() click to toggle source
# File lib/blue_bank/payment.rb, line 11
def instructed?
  status == "Completed"
end
pending?() click to toggle source
# File lib/blue_bank/payment.rb, line 7
def pending?
  status == "Pending"
end
reload!() click to toggle source
# File lib/blue_bank/payment.rb, line 15
def reload!
  @json = nil
  !!json
end
status() click to toggle source
# File lib/blue_bank/payment.rb, line 20
def status
  json.fetch("paymentStatus")
end

Private Instance Methods

json() click to toggle source
# File lib/blue_bank/payment.rb, line 26
def json
  @json ||= client.get("/accounts/#{account.id}/payments/#{id}").first
end