Class: SixSaferpay::ResponsePaymentMeans

Inherits:
Object
  • Object
show all
Defined in:
lib/six_saferpay/models/response_payment_means.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(brand:, display_text:, wallet: nil, card: nil, bank_account: nil, twint: nil) ⇒ ResponsePaymentMeans

Returns a new instance of ResponsePaymentMeans.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/six_saferpay/models/response_payment_means.rb', line 12

def initialize(brand:,
               display_text:,
               wallet: nil,
               card: nil,
               bank_account: nil,
               twint: nil
              )
  @brand = SixSaferpay::Brand.new(**brand.to_h) if brand
  @display_text = display_text
  @wallet = wallet
  @card = SixSaferpay::ResponseCard.new(**card.to_h) if card
  @bank_account = SixSaferpay::BankAccount.new(**.to_h) if 
  @twint = SixSaferpay::Twint.new(**twint.to_h) if twint
end

Instance Attribute Details

#bank_accountObject

Returns the value of attribute bank_account.



4
5
6
# File 'lib/six_saferpay/models/response_payment_means.rb', line 4

def 
  @bank_account
end

#brandObject

Returns the value of attribute brand.



4
5
6
# File 'lib/six_saferpay/models/response_payment_means.rb', line 4

def brand
  @brand
end

#cardObject

Returns the value of attribute card.



4
5
6
# File 'lib/six_saferpay/models/response_payment_means.rb', line 4

def card
  @card
end

#display_textObject

Returns the value of attribute display_text.



4
5
6
# File 'lib/six_saferpay/models/response_payment_means.rb', line 4

def display_text
  @display_text
end

#twintObject

Returns the value of attribute twint.



4
5
6
# File 'lib/six_saferpay/models/response_payment_means.rb', line 4

def twint
  @twint
end

#walletObject

Returns the value of attribute wallet.



4
5
6
# File 'lib/six_saferpay/models/response_payment_means.rb', line 4

def wallet
  @wallet
end

Instance Method Details

#to_hashObject Also known as: to_h



27
28
29
30
31
32
33
34
35
36
# File 'lib/six_saferpay/models/response_payment_means.rb', line 27

def to_hash
  hash = Hash.new
  hash.merge!(brand: @brand.to_h)
  hash.merge!(display_text: @display_text)
  hash.merge!(wallet: @wallet) if @wallet
  hash.merge!(card: @card.to_h) if @card
  hash.merge!(bank_account: @bank_account.to_h) if @bank_account
  hash.merge!(twint: @twint.to_h) if @twint
  hash
end