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)

    the current value of acceptance_system_application_id



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

def acceptance_system_application_id
  @acceptance_system_application_id
end

#authorization_dateDateTime

Returns the current value of authorization_date.

Returns:

  • (DateTime)

    the current value of authorization_date



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

def authorization_date
  @authorization_date
end

Instance Method Details

#from_hash(hash) ⇒ Object



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

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
end

#to_hHash

Returns:

  • (Hash)


20
21
22
23
24
25
# File 'lib/onlinepayments/sdk/domain/acceptance.rb', line 20

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
end