class Ingenico::Connect::SDK::Domain::Payment::CompletePaymentRequest

@attr [Ingenico::Connect::SDK::Domain::Payment::CompletePaymentCardPaymentMethodSpecificInput] card_payment_method_specific_input @attr [Ingenico::Connect::SDK::Domain::Payment::Merchant] merchant @attr [Ingenico::Connect::SDK::Domain::Payment::Order] order

Attributes

card_payment_method_specific_input[RW]
merchant[RW]
order[RW]

Public Instance Methods

from_hash(hash) click to toggle source
# File lib/ingenico/connect/sdk/domain/payment/complete_payment_request.rb, line 34
def from_hash(hash)
  super
  if hash.has_key? 'cardPaymentMethodSpecificInput'
    raise TypeError, "value '%s' is not a Hash" % [hash['cardPaymentMethodSpecificInput']] unless hash['cardPaymentMethodSpecificInput'].is_a? Hash
    @card_payment_method_specific_input = Ingenico::Connect::SDK::Domain::Payment::CompletePaymentCardPaymentMethodSpecificInput.new_from_hash(hash['cardPaymentMethodSpecificInput'])
  end
  if hash.has_key? 'merchant'
    raise TypeError, "value '%s' is not a Hash" % [hash['merchant']] unless hash['merchant'].is_a? Hash
    @merchant = Ingenico::Connect::SDK::Domain::Payment::Merchant.new_from_hash(hash['merchant'])
  end
  if hash.has_key? 'order'
    raise TypeError, "value '%s' is not a Hash" % [hash['order']] unless hash['order'].is_a? Hash
    @order = Ingenico::Connect::SDK::Domain::Payment::Order.new_from_hash(hash['order'])
  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/complete_payment_request.rb, line 26
def to_h
  hash = super
  hash['cardPaymentMethodSpecificInput'] = @card_payment_method_specific_input.to_h unless @card_payment_method_specific_input.nil?
  hash['merchant'] = @merchant.to_h unless @merchant.nil?
  hash['order'] = @order.to_h unless @order.nil?
  hash
end