Class: OnlinePayments::SDK::Domain::CompletePaymentResponse

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from OnlinePayments::SDK::DataObject

new_from_hash

Instance Attribute Details

#creation_outputOnlinePayments::SDK::Domain::PaymentCreationOutput

Returns the current value of creation_output.

Returns:



15
16
17
# File 'lib/onlinepayments/sdk/domain/complete_payment_response.rb', line 15

def creation_output
  @creation_output
end

#merchant_actionOnlinePayments::SDK::Domain::MerchantAction

Returns the current value of merchant_action.

Returns:



15
16
17
# File 'lib/onlinepayments/sdk/domain/complete_payment_response.rb', line 15

def merchant_action
  @merchant_action
end

#paymentOnlinePayments::SDK::Domain::PaymentResponse

Returns the current value of payment.

Returns:



15
16
17
# File 'lib/onlinepayments/sdk/domain/complete_payment_response.rb', line 15

def payment
  @payment
end

Instance Method Details

#from_hash(hash) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/onlinepayments/sdk/domain/complete_payment_response.rb', line 29

def from_hash(hash)
  super
  if hash.key? 'creationOutput'
    raise TypeError, "value '%s' is not a Hash" % [hash['creationOutput']] unless hash['creationOutput'].is_a? Hash
    @creation_output = OnlinePayments::SDK::Domain::PaymentCreationOutput.new_from_hash(hash['creationOutput'])
  end
  if hash.key? 'merchantAction'
    raise TypeError, "value '%s' is not a Hash" % [hash['merchantAction']] unless hash['merchantAction'].is_a? Hash
    @merchant_action = OnlinePayments::SDK::Domain::MerchantAction.new_from_hash(hash['merchantAction'])
  end
  if hash.key? 'payment'
    raise TypeError, "value '%s' is not a Hash" % [hash['payment']] unless hash['payment'].is_a? Hash
    @payment = OnlinePayments::SDK::Domain::PaymentResponse.new_from_hash(hash['payment'])
  end
end

#to_hHash

Returns:

  • (Hash)


21
22
23
24
25
26
27
# File 'lib/onlinepayments/sdk/domain/complete_payment_response.rb', line 21

def to_h
  hash = super
  hash['creationOutput'] = @creation_output.to_h if @creation_output
  hash['merchantAction'] = @merchant_action.to_h if @merchant_action
  hash['payment'] = @payment.to_h if @payment
  hash
end