Class: Worldline::Acquiring::SDK::V1::Domain::ApiPaymentSummaryForResponse

Inherits:
Domain::DataObject
  • Object
show all
Defined in:
lib/worldline/acquiring/sdk/v1/domain/api_payment_summary_for_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Domain::DataObject

new_from_hash

Instance Attribute Details

#payment_idString

Returns the current value of payment_id.

Returns:

  • (String)

    the current value of payment_id



19
20
21
# File 'lib/worldline/acquiring/sdk/v1/domain/api_payment_summary_for_response.rb', line 19

def payment_id
  @payment_id
end

#referencesWorldline::Acquiring::SDK::V1::Domain::ApiReferencesForResponses

Returns the current value of references.

Returns:



19
20
21
# File 'lib/worldline/acquiring/sdk/v1/domain/api_payment_summary_for_response.rb', line 19

def references
  @references
end

#retry_afterString

Returns the current value of retry_after.

Returns:

  • (String)

    the current value of retry_after



19
20
21
# File 'lib/worldline/acquiring/sdk/v1/domain/api_payment_summary_for_response.rb', line 19

def retry_after
  @retry_after
end

#statusString

Returns the current value of status.

Returns:

  • (String)

    the current value of status



19
20
21
# File 'lib/worldline/acquiring/sdk/v1/domain/api_payment_summary_for_response.rb', line 19

def status
  @status
end

#status_timestampDateTime

Returns the current value of status_timestamp.

Returns:

  • (DateTime)

    the current value of status_timestamp



19
20
21
# File 'lib/worldline/acquiring/sdk/v1/domain/api_payment_summary_for_response.rb', line 19

def status_timestamp
  @status_timestamp
end

Instance Method Details

#from_hash(hash) ⇒ Object



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/worldline/acquiring/sdk/v1/domain/api_payment_summary_for_response.rb', line 42

def from_hash(hash)
  super
  if hash.has_key? 'paymentId'
    @payment_id = hash['paymentId']
  end
  if hash.has_key? 'references'
    raise TypeError, "value '%s' is not a Hash" % [hash['references']] unless hash['references'].is_a? Hash
    @references = Worldline::Acquiring::SDK::V1::Domain::ApiReferencesForResponses.new_from_hash(hash['references'])
  end
  if hash.has_key? 'retryAfter'
    @retry_after = hash['retryAfter']
  end
  if hash.has_key? 'status'
    @status = hash['status']
  end
  if hash.has_key? 'statusTimestamp'
    @status_timestamp = DateTime.parse(hash['statusTimestamp'])
  end
end

#to_hHash

Returns:

  • (Hash)


32
33
34
35
36
37
38
39
40
# File 'lib/worldline/acquiring/sdk/v1/domain/api_payment_summary_for_response.rb', line 32

def to_h
  hash = super
  hash['paymentId'] = @payment_id unless @payment_id.nil?
  hash['references'] = @references.to_h unless @references.nil?
  hash['retryAfter'] = @retry_after unless @retry_after.nil?
  hash['status'] = @status unless @status.nil?
  hash['statusTimestamp'] = @status_timestamp.iso8601(3) unless @status_timestamp.nil?
  hash
end