Class: OnlinePayments::SDK::Domain::MandateResponse

Inherits:
OnlinePayments::SDK::DataObject show all
Defined in:
lib/onlinepayments/sdk/domain/mandate_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from OnlinePayments::SDK::DataObject

new_from_hash

Instance Attribute Details

#aliasString

Returns the current value of alias.

Returns:

  • (String)

    the current value of alias



17
18
19
# File 'lib/onlinepayments/sdk/domain/mandate_response.rb', line 17

def alias
  @alias
end

#customerOnlinePayments::SDK::Domain::MandateCustomerResponse

Returns the current value of customer.

Returns:



17
18
19
# File 'lib/onlinepayments/sdk/domain/mandate_response.rb', line 17

def customer
  @customer
end

#customer_referenceString

Returns the current value of customer_reference.

Returns:

  • (String)

    the current value of customer_reference



17
18
19
# File 'lib/onlinepayments/sdk/domain/mandate_response.rb', line 17

def customer_reference
  @customer_reference
end

#mandate_pdfString

Returns the current value of mandate_pdf.

Returns:

  • (String)

    the current value of mandate_pdf



17
18
19
# File 'lib/onlinepayments/sdk/domain/mandate_response.rb', line 17

def mandate_pdf
  @mandate_pdf
end

#recurrence_typeString

Returns the current value of recurrence_type.

Returns:

  • (String)

    the current value of recurrence_type



17
18
19
# File 'lib/onlinepayments/sdk/domain/mandate_response.rb', line 17

def recurrence_type
  @recurrence_type
end

#statusString

Returns the current value of status.

Returns:

  • (String)

    the current value of status



17
18
19
# File 'lib/onlinepayments/sdk/domain/mandate_response.rb', line 17

def status
  @status
end

#unique_mandate_referenceString

Returns the current value of unique_mandate_reference.

Returns:

  • (String)

    the current value of unique_mandate_reference



17
18
19
# File 'lib/onlinepayments/sdk/domain/mandate_response.rb', line 17

def unique_mandate_reference
  @unique_mandate_reference
end

Instance Method Details

#from_hash(hash) ⇒ Object



39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/onlinepayments/sdk/domain/mandate_response.rb', line 39

def from_hash(hash)
  super
  @alias = hash['alias'] if hash.key? 'alias'
  if hash.key? 'customer'
    raise TypeError, "value '%s' is not a Hash" % [hash['customer']] unless hash['customer'].is_a? Hash
    @customer = OnlinePayments::SDK::Domain::MandateCustomerResponse.new_from_hash(hash['customer'])
  end
  @customer_reference = hash['customerReference'] if hash.key? 'customerReference'
  @mandate_pdf = hash['mandatePdf'] if hash.key? 'mandatePdf'
  @recurrence_type = hash['recurrenceType'] if hash.key? 'recurrenceType'
  @status = hash['status'] if hash.key? 'status'
  @unique_mandate_reference = hash['uniqueMandateReference'] if hash.key? 'uniqueMandateReference'
end

#to_hHash

Returns:

  • (Hash)


27
28
29
30
31
32
33
34
35
36
37
# File 'lib/onlinepayments/sdk/domain/mandate_response.rb', line 27

def to_h
  hash = super
  hash['alias'] = @alias unless @alias.nil?
  hash['customer'] = @customer.to_h if @customer
  hash['customerReference'] = @customer_reference unless @customer_reference.nil?
  hash['mandatePdf'] = @mandate_pdf unless @mandate_pdf.nil?
  hash['recurrenceType'] = @recurrence_type unless @recurrence_type.nil?
  hash['status'] = @status unless @status.nil?
  hash['uniqueMandateReference'] = @unique_mandate_reference unless @unique_mandate_reference.nil?
  hash
end