Class: OnlinePayments::SDK::Domain::PayoutCardPaymentMethodSpecificOutput

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataObject

new_from_hash

Instance Attribute Details

#acceptanceOnlinePayments::SDK::Domain::Acceptance

Returns the current value of acceptance.

Returns:



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

def acceptance
  @acceptance
end

#authorisation_codeString

Returns the current value of authorisation_code.

Returns:

  • (String)

    the current value of authorisation_code



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

def authorisation_code
  @authorisation_code
end

#cardOnlinePayments::SDK::Domain::CardEssentials

Returns the current value of card.

Returns:



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

def card
  @card
end

#payment_product_idInteger

Returns the current value of payment_product_id.

Returns:

  • (Integer)

    the current value of payment_product_id



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

def payment_product_id
  @payment_product_id
end

Instance Method Details

#from_hash(hash) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/onlinepayments/sdk/domain/payout_card_payment_method_specific_output.rb', line 35

def from_hash(hash)
  super
  if hash.has_key? 'acceptance'
    raise TypeError, "value '%s' is not a Hash" % [hash['acceptance']] unless hash['acceptance'].is_a? Hash
    @acceptance = OnlinePayments::SDK::Domain::Acceptance.new_from_hash(hash['acceptance'])
  end
  if hash.has_key? 'authorisationCode'
    @authorisation_code = hash['authorisationCode']
  end
  if hash.has_key? 'card'
    raise TypeError, "value '%s' is not a Hash" % [hash['card']] unless hash['card'].is_a? Hash
    @card = OnlinePayments::SDK::Domain::CardEssentials.new_from_hash(hash['card'])
  end
  if hash.has_key? 'paymentProductId'
    @payment_product_id = hash['paymentProductId']
  end
end

#to_hHash

Returns:

  • (Hash)


26
27
28
29
30
31
32
33
# File 'lib/onlinepayments/sdk/domain/payout_card_payment_method_specific_output.rb', line 26

def to_h
  hash = super
  hash['acceptance'] = @acceptance.to_h unless @acceptance.nil?
  hash['authorisationCode'] = @authorisation_code unless @authorisation_code.nil?
  hash['card'] = @card.to_h unless @card.nil?
  hash['paymentProductId'] = @payment_product_id unless @payment_product_id.nil?
  hash
end