Exception: Balanced::UnassociatedCardError

Inherits:
StandardError show all
Defined in:
lib/balanced/error.rb

Overview

Raised when attempted to create a debit or hold for a card not associated to a customer.

Instance Attribute Summary

Attributes inherited from StandardError

#message

Attributes inherited from Error

#response

Instance Method Summary collapse

Methods inherited from Error

#body

Constructor Details

#initialize(card) ⇒ UnassociatedCardError

Returns a new instance of UnassociatedCardError.

Parameters:



66
67
68
69
# File 'lib/balanced/error.rb', line 66

def initialize(card)
  @card = card
  super(error_message)
end

Instance Method Details

#error_messageObject



71
72
73
# File 'lib/balanced/error.rb', line 71

def error_message
  "The Balanced::Card with uri=#{@card.attributes['uri']} is not associated to a customer"
end