Class: OnlinePayments::SDK::Domain::Acceptance

Inherits:
DataObject
  • Object
show all
Defined in:
lib/onlinepayments/sdk/domain/acceptance.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataObject

new_from_hash

Instance Attribute Details

#acceptance_system_application_idString?

Returns the current value of acceptance_system_application_id.

Returns:

  • (String, nil)

    the current value of acceptance_system_application_id



14
15
16
# File 'lib/onlinepayments/sdk/domain/acceptance.rb', line 14

def acceptance_system_application_id
  @acceptance_system_application_id
end

#authorization_dateDateTime?

Returns the current value of authorization_date.

Returns:

  • (DateTime, nil)

    the current value of authorization_date



14
15
16
# File 'lib/onlinepayments/sdk/domain/acceptance.rb', line 14

def authorization_date
  @authorization_date
end

#authorization_message_referenceString?

Returns the current value of authorization_message_reference.

Returns:

  • (String, nil)

    the current value of authorization_message_reference



14
15
16
# File 'lib/onlinepayments/sdk/domain/acceptance.rb', line 14

def authorization_message_reference
  @authorization_message_reference
end

Instance Method Details

#from_hash(hash) ⇒ Object



31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/onlinepayments/sdk/domain/acceptance.rb', line 31

def from_hash(hash)
  super
  if hash.has_key? 'acceptanceSystemApplicationId'
    @acceptance_system_application_id = hash['acceptanceSystemApplicationId']
  end
  if hash.has_key? 'authorizationDate'
    @authorization_date = DateTime.parse(hash['authorizationDate'])
  end
  if hash.has_key? 'authorizationMessageReference'
    @authorization_message_reference = hash['authorizationMessageReference']
  end
end

#to_hHash

Returns:

  • (Hash)


23
24
25
26
27
28
29
# File 'lib/onlinepayments/sdk/domain/acceptance.rb', line 23

def to_h
  hash = super
  hash['acceptanceSystemApplicationId'] = @acceptance_system_application_id unless @acceptance_system_application_id.nil?
  hash['authorizationDate'] = @authorization_date.iso8601(3) unless @authorization_date.nil?
  hash['authorizationMessageReference'] = @authorization_message_reference unless @authorization_message_reference.nil?
  hash
end