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

Inherits:
DataObject
  • Object
show all
Defined in:
lib/onlinepayments/sdk/domain/subsequent_payment_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataObject

new_from_hash

Instance Attribute Details

#omnichannel_subsequent_specific_inputOnlinePayments::SDK::Domain::OmnichannelSubsequentSpecificInput

Returns the current value of omnichannel_subsequent_specific_input.

Returns:



17
18
19
# File 'lib/onlinepayments/sdk/domain/subsequent_payment_request.rb', line 17

def omnichannel_subsequent_specific_input
  @omnichannel_subsequent_specific_input
end

#orderOnlinePayments::SDK::Domain::Order

Returns the current value of order.

Returns:



17
18
19
# File 'lib/onlinepayments/sdk/domain/subsequent_payment_request.rb', line 17

def order
  @order
end

#subsequent_payment_product5001_specific_inputOnlinePayments::SDK::Domain::SubsequentPaymentProduct5001SpecificInput

Returns the current value of subsequent_payment_product5001_specific_input.

Returns:



17
18
19
# File 'lib/onlinepayments/sdk/domain/subsequent_payment_request.rb', line 17

def subsequent_payment_product5001_specific_input
  @subsequent_payment_product5001_specific_input
end

#subsequentcard_payment_method_specific_inputOnlinePayments::SDK::Domain::SubsequentCardPaymentMethodSpecificInput

Returns the current value of subsequentcard_payment_method_specific_input.

Returns:



17
18
19
# File 'lib/onlinepayments/sdk/domain/subsequent_payment_request.rb', line 17

def subsequentcard_payment_method_specific_input
  @subsequentcard_payment_method_specific_input
end

Instance Method Details

#from_hash(hash) ⇒ Object



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

def from_hash(hash)
  super
  if hash.has_key? 'omnichannelSubsequentSpecificInput'
    raise TypeError, "value '%s' is not a Hash" % [hash['omnichannelSubsequentSpecificInput']] unless hash['omnichannelSubsequentSpecificInput'].is_a? Hash
    @omnichannel_subsequent_specific_input = OnlinePayments::SDK::Domain::OmnichannelSubsequentSpecificInput.new_from_hash(hash['omnichannelSubsequentSpecificInput'])
  end
  if hash.has_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.has_key? 'subsequentPaymentProduct5001SpecificInput'
    raise TypeError, "value '%s' is not a Hash" % [hash['subsequentPaymentProduct5001SpecificInput']] unless hash['subsequentPaymentProduct5001SpecificInput'].is_a? Hash
    @subsequent_payment_product5001_specific_input = OnlinePayments::SDK::Domain::SubsequentPaymentProduct5001SpecificInput.new_from_hash(hash['subsequentPaymentProduct5001SpecificInput'])
  end
  if hash.has_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)


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

def to_h
  hash = super
  hash['omnichannelSubsequentSpecificInput'] = @omnichannel_subsequent_specific_input.to_h unless @omnichannel_subsequent_specific_input.nil?
  hash['order'] = @order.to_h unless @order.nil?
  hash['subsequentPaymentProduct5001SpecificInput'] = @subsequent_payment_product5001_specific_input.to_h unless @subsequent_payment_product5001_specific_input.nil?
  hash['subsequentcardPaymentMethodSpecificInput'] = @subsequentcard_payment_method_specific_input.to_h unless @subsequentcard_payment_method_specific_input.nil?
  hash
end