Class: OnlinePayments::SDK::Domain::CompletePaymentRequest

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataObject

new_from_hash

Instance Attribute Details

#card_payment_method_specific_inputOnlinePayments::SDK::Domain::CompletePaymentCardPaymentMethodSpecificInput

Returns the current value of card_payment_method_specific_input.

Returns:



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

def card_payment_method_specific_input
  @card_payment_method_specific_input
end

#orderOnlinePayments::SDK::Domain::Order

Returns the current value of order.

Returns:



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

def order
  @order
end

Instance Method Details

#from_hash(hash) ⇒ Object



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

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 = OnlinePayments::SDK::Domain::CompletePaymentCardPaymentMethodSpecificInput.new_from_hash(hash['cardPaymentMethodSpecificInput'])
  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
end

#to_hHash

Returns:

  • (Hash)


20
21
22
23
24
25
# File 'lib/onlinepayments/sdk/domain/complete_payment_request.rb', line 20

def to_h
  hash = super
  hash['cardPaymentMethodSpecificInput'] = @card_payment_method_specific_input.to_h unless @card_payment_method_specific_input.nil?
  hash['order'] = @order.to_h unless @order.nil?
  hash
end