Class: Ingenico::Connect::SDK::Domain::Payment::Payment

Inherits:
Definitions::AbstractOrderStatus show all
Defined in:
lib/ingenico/connect/sdk/domain/payment/payment.rb

Direct Known Subclasses

PaymentResponse

Instance Attribute Summary collapse

Attributes inherited from Definitions::AbstractOrderStatus

#id

Instance Method Summary collapse

Methods inherited from Ingenico::Connect::SDK::DataObject

new_from_hash

Instance Attribute Details

#hosted_checkout_specific_outputIngenico::Connect::SDK::Domain::Payment::HostedCheckoutSpecificOutput



18
19
20
# File 'lib/ingenico/connect/sdk/domain/payment/payment.rb', line 18

def hosted_checkout_specific_output
  @hosted_checkout_specific_output
end

#payment_outputIngenico::Connect::SDK::Domain::Payment::PaymentOutput



18
19
20
# File 'lib/ingenico/connect/sdk/domain/payment/payment.rb', line 18

def payment_output
  @payment_output
end

#statusString



18
19
20
# File 'lib/ingenico/connect/sdk/domain/payment/payment.rb', line 18

def status
  @status
end

#status_outputIngenico::Connect::SDK::Domain::Payment::PaymentStatusOutput



18
19
20
# File 'lib/ingenico/connect/sdk/domain/payment/payment.rb', line 18

def status_output
  @status_output
end

Instance Method Details

#from_hash(hash) ⇒ Object



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/ingenico/connect/sdk/domain/payment/payment.rb', line 38

def from_hash(hash)
  super
  if hash.has_key? 'hostedCheckoutSpecificOutput'
    raise TypeError, "value '%s' is not a Hash" % [hash['hostedCheckoutSpecificOutput']] unless hash['hostedCheckoutSpecificOutput'].is_a? Hash
    @hosted_checkout_specific_output = Ingenico::Connect::SDK::Domain::Payment::HostedCheckoutSpecificOutput.new_from_hash(hash['hostedCheckoutSpecificOutput'])
  end
  if hash.has_key? 'paymentOutput'
    raise TypeError, "value '%s' is not a Hash" % [hash['paymentOutput']] unless hash['paymentOutput'].is_a? Hash
    @payment_output = Ingenico::Connect::SDK::Domain::Payment::PaymentOutput.new_from_hash(hash['paymentOutput'])
  end
  if hash.has_key? 'status'
    @status = hash['status']
  end
  if hash.has_key? 'statusOutput'
    raise TypeError, "value '%s' is not a Hash" % [hash['statusOutput']] unless hash['statusOutput'].is_a? Hash
    @status_output = Ingenico::Connect::SDK::Domain::Payment::PaymentStatusOutput.new_from_hash(hash['statusOutput'])
  end
end

#to_hHash



29
30
31
32
33
34
35
36
# File 'lib/ingenico/connect/sdk/domain/payment/payment.rb', line 29

def to_h
  hash = super
  hash['hostedCheckoutSpecificOutput'] = @hosted_checkout_specific_output.to_h unless @hosted_checkout_specific_output.nil?
  hash['paymentOutput'] = @payment_output.to_h unless @payment_output.nil?
  hash['status'] = @status unless @status.nil?
  hash['statusOutput'] = @status_output.to_h unless @status_output.nil?
  hash
end