Class: SixSaferpay::ResponsePaymentMeans
- Inherits:
-
Object
- Object
- SixSaferpay::ResponsePaymentMeans
- Defined in:
- lib/six_saferpay/models/response_payment_means.rb
Instance Attribute Summary collapse
-
#bank_account ⇒ Object
Returns the value of attribute bank_account.
-
#brand ⇒ Object
Returns the value of attribute brand.
-
#card ⇒ Object
Returns the value of attribute card.
-
#display_text ⇒ Object
Returns the value of attribute display_text.
-
#twint ⇒ Object
Returns the value of attribute twint.
-
#wallet ⇒ Object
Returns the value of attribute wallet.
Instance Method Summary collapse
-
#initialize(brand:, display_text:, wallet: nil, card: nil, bank_account: nil, twint: nil) ⇒ ResponsePaymentMeans
constructor
A new instance of ResponsePaymentMeans.
- #to_hash ⇒ Object (also: #to_h)
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(**bank_account.to_h) if bank_account @twint = SixSaferpay::Twint.new(**twint.to_h) if twint end |
Instance Attribute Details
#bank_account ⇒ Object
Returns the value of attribute bank_account.
4 5 6 |
# File 'lib/six_saferpay/models/response_payment_means.rb', line 4 def bank_account @bank_account end |
#brand ⇒ Object
Returns the value of attribute brand.
4 5 6 |
# File 'lib/six_saferpay/models/response_payment_means.rb', line 4 def brand @brand end |
#card ⇒ Object
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_text ⇒ Object
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 |
#twint ⇒ Object
Returns the value of attribute twint.
4 5 6 |
# File 'lib/six_saferpay/models/response_payment_means.rb', line 4 def twint @twint end |
#wallet ⇒ Object
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_hash ⇒ Object 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 |