Class: SixSaferpay::RequestPaymentMeans
- Inherits:
-
Object
- Object
- SixSaferpay::RequestPaymentMeans
- Defined in:
- lib/six_saferpay/models/request_payment_means.rb
Instance Attribute Summary collapse
-
#bank_account ⇒ Object
Returns the value of attribute bank_account.
-
#card ⇒ Object
Returns the value of attribute card.
-
#fd_alias ⇒ Object
Returns the value of attribute fd_alias.
-
#saferpay_fields ⇒ Object
Returns the value of attribute saferpay_fields.
Instance Method Summary collapse
-
#initialize(card: nil, bank_account: nil, fd_alias: nil, saferpay_fields: nil) ⇒ RequestPaymentMeans
constructor
A new instance of RequestPaymentMeans.
- #to_hash ⇒ Object (also: #to_h)
Constructor Details
#initialize(card: nil, bank_account: nil, fd_alias: nil, saferpay_fields: nil) ⇒ RequestPaymentMeans
Returns a new instance of RequestPaymentMeans.
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/six_saferpay/models/request_payment_means.rb', line 10 def initialize(card: nil, bank_account: nil, fd_alias: nil, saferpay_fields: nil ) @card = SixSaferpay::RequestCard.new(**card.to_h) if card @bank_account = SixSaferpay::BankAccount.new(**bank_account.to_h) if bank_account @fd_alias = SixSaferpay::PaymentMeansAlias.new(**fd_alias.to_h) if fd_alias @saferpay_fields = SixSaferpay::SaferpayFields.new(**saferpay_fields.to_h) if saferpay_fields end |
Instance Attribute Details
#bank_account ⇒ Object
Returns the value of attribute bank_account.
4 5 6 |
# File 'lib/six_saferpay/models/request_payment_means.rb', line 4 def bank_account @bank_account end |
#card ⇒ Object
Returns the value of attribute card.
4 5 6 |
# File 'lib/six_saferpay/models/request_payment_means.rb', line 4 def card @card end |
#fd_alias ⇒ Object
Returns the value of attribute fd_alias.
4 5 6 |
# File 'lib/six_saferpay/models/request_payment_means.rb', line 4 def fd_alias @fd_alias end |
#saferpay_fields ⇒ Object
Returns the value of attribute saferpay_fields.
4 5 6 |
# File 'lib/six_saferpay/models/request_payment_means.rb', line 4 def saferpay_fields @saferpay_fields end |
Instance Method Details
#to_hash ⇒ Object Also known as: to_h
21 22 23 24 25 26 27 28 |
# File 'lib/six_saferpay/models/request_payment_means.rb', line 21 def to_hash hash = Hash.new hash.merge!(card: @card.to_h) if @card hash.merge!(bank_account: @bank_account.to_h) if @bank_account hash.merge!(fd_alias: @fd_alias.to_h) if @fd_alias hash.merge!(saferpay_fields: @saferpay_fields.to_h) if @saferpay_fields hash end |