Class: FdxV660Api::PayeeEntityErrorException

Inherits:
APIException
  • Object
show all
Defined in:
lib/fdx_v660_api/exceptions/payee_entity_error_exception.rb

Overview

Payee to whom funds can be transferred. Can be extended to support additional types of payees

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(reason, response) ⇒ PayeeEntityErrorException

The constructor.

Parameters:

  • reason (String)

    The reason for raising an exception.

  • response (HttpResponse)

    The HttpReponse of the API call.



21
22
23
24
25
# File 'lib/fdx_v660_api/exceptions/payee_entity_error_exception.rb', line 21

def initialize(reason, response)
  super(reason, response)
  hash = APIHelper.json_deserialize(@response.raw_body)
  unbox(hash)
end

Instance Attribute Details

#merchantMerchantEntity1

When payee is a merchant, typically a business from which goods or services are rendered, this field will be populated

Returns:



16
17
18
# File 'lib/fdx_v660_api/exceptions/payee_entity_error_exception.rb', line 16

def merchant
  @merchant
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



43
44
45
46
# File 'lib/fdx_v660_api/exceptions/payee_entity_error_exception.rb', line 43

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} merchant: #{@merchant.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



37
38
39
40
# File 'lib/fdx_v660_api/exceptions/payee_entity_error_exception.rb', line 37

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} merchant: #{@merchant}>"
end

#unbox(hash) ⇒ Object

Populates this object by extracting properties from a hash. response body.

Parameters:

  • hash (Hash)

    The deserialized response sent by the server in the



30
31
32
33
34
# File 'lib/fdx_v660_api/exceptions/payee_entity_error_exception.rb', line 30

def unbox(hash)
  return nil unless hash

  @merchant = MerchantEntity1.from_hash(hash['merchant']) if hash['merchant']
end