Class: OnlinePayments::SDK::Domain::SubsequentPaymentRequest

Inherits:
OnlinePayments::SDK::DataObject show all
Defined in:
lib/onlinepayments/sdk/domain/subsequent_payment_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from OnlinePayments::SDK::DataObject

new_from_hash

Instance Attribute Details

#orderOnlinePayments::SDK::Domain::Order

Returns the current value of order.

Returns:



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

def order
  @order
end

#subsequentcard_payment_method_specific_inputOnlinePayments::SDK::Domain::SubsequentCardPaymentMethodSpecificInput

Returns the current value of subsequentcard_payment_method_specific_input.

Returns:



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

def subsequentcard_payment_method_specific_input
  @subsequentcard_payment_method_specific_input
end

Instance Method Details

#from_hash(hash) ⇒ Object



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

def from_hash(hash)
  super
  if hash.key? 'order'
    raise TypeError, "value '%s' is not a Hash" % [hash['order']] unless hash['order'].is_a? Hash
    @order = OnlinePayments::SDK::Domain::Order.new_from_hash(hash['order'])
  end
  if hash.key? 'subsequentcardPaymentMethodSpecificInput'
    raise TypeError, "value '%s' is not a Hash" % [hash['subsequentcardPaymentMethodSpecificInput']] unless hash['subsequentcardPaymentMethodSpecificInput'].is_a? Hash
    @subsequentcard_payment_method_specific_input = OnlinePayments::SDK::Domain::SubsequentCardPaymentMethodSpecificInput.new_from_hash(hash['subsequentcardPaymentMethodSpecificInput'])
  end
end

#to_hHash

Returns:

  • (Hash)


18
19
20
21
22
23
# File 'lib/onlinepayments/sdk/domain/subsequent_payment_request.rb', line 18

def to_h
  hash = super
  hash['order'] = @order.to_h if @order
  hash['subsequentcardPaymentMethodSpecificInput'] = @subsequentcard_payment_method_specific_input.to_h if @subsequentcard_payment_method_specific_input
  hash
end