Class: Worldline::Connect::SDK::V1::Domain::CompletePaymentRequest

Inherits:
Domain::DataObject show all
Defined in:
lib/worldline/connect/sdk/v1/domain/complete_payment_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Domain::DataObject

new_from_hash

Instance Attribute Details

#card_payment_method_specific_inputWorldline::Connect::SDK::V1::Domain::CompletePaymentCardPaymentMethodSpecificInput

Returns the current value of card_payment_method_specific_input.

Returns:



18
19
20
# File 'lib/worldline/connect/sdk/v1/domain/complete_payment_request.rb', line 18

def card_payment_method_specific_input
  @card_payment_method_specific_input
end

#merchantWorldline::Connect::SDK::V1::Domain::Merchant

Returns the current value of merchant.

Returns:



18
19
20
# File 'lib/worldline/connect/sdk/v1/domain/complete_payment_request.rb', line 18

def merchant
  @merchant
end

#orderWorldline::Connect::SDK::V1::Domain::Order

Returns the current value of order.

Returns:



18
19
20
# File 'lib/worldline/connect/sdk/v1/domain/complete_payment_request.rb', line 18

def order
  @order
end

Instance Method Details

#from_hash(hash) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/worldline/connect/sdk/v1/domain/complete_payment_request.rb', line 35

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 = Worldline::Connect::SDK::V1::Domain::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 = Worldline::Connect::SDK::V1::Domain::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 = Worldline::Connect::SDK::V1::Domain::Order.new_from_hash(hash['order'])
  end
end

#to_hHash

Returns:

  • (Hash)


27
28
29
30
31
32
33
# File 'lib/worldline/connect/sdk/v1/domain/complete_payment_request.rb', line 27

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