Class: Worldline::Connect::SDK::V1::Domain::PaymentApprovalResponse

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Domain::DataObject

new_from_hash

Instance Attribute Details

#card_payment_method_specific_outputWorldline::Connect::SDK::V1::Domain::ApprovePaymentCardPaymentMethodSpecificOutput

Returns the current value of card_payment_method_specific_output.

Returns:



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

def card_payment_method_specific_output
  @card_payment_method_specific_output
end

#mobile_payment_method_specific_outputWorldline::Connect::SDK::V1::Domain::ApprovePaymentMobilePaymentMethodSpecificOutput

Returns the current value of mobile_payment_method_specific_output.

Returns:



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

def mobile_payment_method_specific_output
  @mobile_payment_method_specific_output
end

#paymentWorldline::Connect::SDK::V1::Domain::Payment

Returns the current value of payment.

Returns:



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

def payment
  @payment
end

#payment_method_specific_outputObject

Deprecated.

Use cardPaymentMethodSpecificOutput instead



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

def payment_method_specific_output
  @payment_method_specific_output
end

Instance Method Details

#from_hash(hash) ⇒ Object



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/worldline/connect/sdk/v1/domain/payment_approval_response.rb', line 41

def from_hash(hash)
  super
  if hash.has_key? 'cardPaymentMethodSpecificOutput'
    raise TypeError, "value '%s' is not a Hash" % [hash['cardPaymentMethodSpecificOutput']] unless hash['cardPaymentMethodSpecificOutput'].is_a? Hash
    @card_payment_method_specific_output = Worldline::Connect::SDK::V1::Domain::ApprovePaymentCardPaymentMethodSpecificOutput.new_from_hash(hash['cardPaymentMethodSpecificOutput'])
  end
  if hash.has_key? 'mobilePaymentMethodSpecificOutput'
    raise TypeError, "value '%s' is not a Hash" % [hash['mobilePaymentMethodSpecificOutput']] unless hash['mobilePaymentMethodSpecificOutput'].is_a? Hash
    @mobile_payment_method_specific_output = Worldline::Connect::SDK::V1::Domain::ApprovePaymentMobilePaymentMethodSpecificOutput.new_from_hash(hash['mobilePaymentMethodSpecificOutput'])
  end
  if hash.has_key? 'payment'
    raise TypeError, "value '%s' is not a Hash" % [hash['payment']] unless hash['payment'].is_a? Hash
    @payment = Worldline::Connect::SDK::V1::Domain::Payment.new_from_hash(hash['payment'])
  end
  if hash.has_key? 'paymentMethodSpecificOutput'
    raise TypeError, "value '%s' is not a Hash" % [hash['paymentMethodSpecificOutput']] unless hash['paymentMethodSpecificOutput'].is_a? Hash
    @payment_method_specific_output = Worldline::Connect::SDK::V1::Domain::ApprovePaymentCardPaymentMethodSpecificOutput.new_from_hash(hash['paymentMethodSpecificOutput'])
  end
end

#to_hHash

Returns:

  • (Hash)


32
33
34
35
36
37
38
39
# File 'lib/worldline/connect/sdk/v1/domain/payment_approval_response.rb', line 32

def to_h
  hash = super
  hash['cardPaymentMethodSpecificOutput'] = @card_payment_method_specific_output.to_h unless @card_payment_method_specific_output.nil?
  hash['mobilePaymentMethodSpecificOutput'] = @mobile_payment_method_specific_output.to_h unless @mobile_payment_method_specific_output.nil?
  hash['payment'] = @payment.to_h unless @payment.nil?
  hash['paymentMethodSpecificOutput'] = @payment_method_specific_output.to_h unless @payment_method_specific_output.nil?
  hash
end