class Beaver::PaymentMethodForPayments
PaymentMethodForPayments
Model.
Attributes
TODO: Write general description for this method @return [CreditCard2]
TODO: Write general description for this method @return [Object]
Encoded payment data. Currently is used for POS payment tokens but in future may be used for other types of encoded payment information @return [String]
TODO: Write general description for this method @return [PaymentBankUsReq]
TODO: Write general description for this method @return [String]
TODO: Write general description for this method @return [Token]
Encoded payment data. Currently is used for POS payment tokens but in future may be used for other types of encoded payment information @return [Type9Enum]
Public Class Methods
Creates an instance of the object from a hash.
# File lib/beaver/models/payment_method_for_payments.rb, line 69 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. type = hash['type'] credit_card = CreditCard2.from_hash(hash['credit_card']) if hash['credit_card'] custom_data = hash['custom_data'] payment_bank_us = PaymentBankUsReq.from_hash(hash['payment_bank_us']) if hash['payment_bank_us'] payment_method_id = hash['payment_method_id'] token = Token.from_hash(hash['token']) if hash['token'] encoded_payment_method = hash['encoded_payment_method'] # Create object from extracted values. PaymentMethodForPayments.new(type, credit_card, custom_data, payment_bank_us, payment_method_id, token, encoded_payment_method) end
A mapping from model property names to API property names.
# File lib/beaver/models/payment_method_for_payments.rb, line 40 def self.names @_hash = {} if @_hash.nil? @_hash['credit_card'] = 'credit_card' @_hash['custom_data'] = 'custom_data' @_hash['payment_bank_us'] = 'payment_bank_us' @_hash['payment_method_id'] = 'payment_method_id' @_hash['token'] = 'token' @_hash['encoded_payment_method'] = 'encoded_payment_method' @_hash['type'] = 'type' @_hash end
# File lib/beaver/models/payment_method_for_payments.rb, line 52 def initialize(type = nil, credit_card = nil, custom_data = nil, payment_bank_us = nil, payment_method_id = nil, token = nil, encoded_payment_method = nil) @credit_card = credit_card @custom_data = custom_data @payment_bank_us = payment_bank_us @payment_method_id = payment_method_id @token = token @encoded_payment_method = encoded_payment_method @type = type end