class Ingenico::Connect::SDK::Domain::Payment::CancelPaymentResponse

@attr [Ingenico::Connect::SDK::Domain::Payment::CancelPaymentCardPaymentMethodSpecificOutput] card_payment_method_specific_output @attr [Ingenico::Connect::SDK::Domain::Payment::CancelPaymentMobilePaymentMethodSpecificOutput] mobile_payment_method_specific_output @attr [Ingenico::Connect::SDK::Domain::Payment::Payment] payment

Attributes

card_payment_method_specific_output[RW]
mobile_payment_method_specific_output[RW]
payment[RW]

Public Instance Methods

from_hash(hash) click to toggle source
# File lib/ingenico/connect/sdk/domain/payment/cancel_payment_response.rb, line 34
def from_hash(hash)
  super
  if hash.has_key? 'cardPaymentMethodSpecificOutput'
    raise TypeError, "value '%s' is not a Hash" % [hash['cardPaymentMethodSpecificOutput']] unless hash['cardPaymentMethodSpecificOutput'].is_a? Hash
    @card_payment_method_specific_output = Ingenico::Connect::SDK::Domain::Payment::CancelPaymentCardPaymentMethodSpecificOutput.new_from_hash(hash['cardPaymentMethodSpecificOutput'])
  end
  if hash.has_key? 'mobilePaymentMethodSpecificOutput'
    raise TypeError, "value '%s' is not a Hash" % [hash['mobilePaymentMethodSpecificOutput']] unless hash['mobilePaymentMethodSpecificOutput'].is_a? Hash
    @mobile_payment_method_specific_output = Ingenico::Connect::SDK::Domain::Payment::CancelPaymentMobilePaymentMethodSpecificOutput.new_from_hash(hash['mobilePaymentMethodSpecificOutput'])
  end
  if hash.has_key? 'payment'
    raise TypeError, "value '%s' is not a Hash" % [hash['payment']] unless hash['payment'].is_a? Hash
    @payment = Ingenico::Connect::SDK::Domain::Payment::Payment.new_from_hash(hash['payment'])
  end
end
to_h() click to toggle source

@return (Hash)

Calls superclass method Ingenico::Connect::SDK::DataObject#to_h
# File lib/ingenico/connect/sdk/domain/payment/cancel_payment_response.rb, line 26
def to_h
  hash = super
  hash['cardPaymentMethodSpecificOutput'] = @card_payment_method_specific_output.to_h unless @card_payment_method_specific_output.nil?
  hash['mobilePaymentMethodSpecificOutput'] = @mobile_payment_method_specific_output.to_h unless @mobile_payment_method_specific_output.nil?
  hash['payment'] = @payment.to_h unless @payment.nil?
  hash
end