class Beaver::PaymentMethodsRequest

PaymentMethodsRequest Model.

Attributes

credit_card[RW]

Credit card structure to be used for updating credit card information. @return [CreditCard4]

custom_data[RW]

Payment bank structure to be used for updating payment bank information. No field is allowed for update now. @return [Object]

payment_bank_us[RW]

Payment bank structure to be used for updating payment bank information. No field is allowed for update now. @return [Object]

rbits[RW]

Payment bank structure to be used for updating payment bank information. No field is allowed for update now. @return [List of EmbeddedRbit]

type[RW]

Payment bank structure to be used for updating payment bank information. No field is allowed for update now. @return [Type3Enum]

Public Class Methods

from_hash(hash) click to toggle source

Creates an instance of the object from a hash.

# File lib/beaver/models/payment_methods_request.rb, line 57
def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  credit_card = CreditCard4.from_hash(hash['credit_card']) if
    hash['credit_card']
  payment_bank_us = hash['payment_bank_us']
  type = hash['type']
  custom_data = hash['custom_data']
  # Parameter is an array, so we need to iterate through it
  rbits = nil
  unless hash['rbits'].nil?
    rbits = []
    hash['rbits'].each do |structure|
      rbits << (EmbeddedRbit.from_hash(structure) if structure)
    end
  end

  # Create object from extracted values.
  PaymentMethodsRequest.new(credit_card,
                            payment_bank_us,
                            type,
                            custom_data,
                            rbits)
end
names() click to toggle source

A mapping from model property names to API property names.

# File lib/beaver/models/payment_methods_request.rb, line 34
def self.names
  @_hash = {} if @_hash.nil?
  @_hash['credit_card'] = 'credit_card'
  @_hash['payment_bank_us'] = 'payment_bank_us'
  @_hash['type'] = 'type'
  @_hash['custom_data'] = 'custom_data'
  @_hash['rbits'] = 'rbits'
  @_hash
end
new(credit_card = nil, payment_bank_us = nil, type = nil, custom_data = nil, rbits = nil) click to toggle source
# File lib/beaver/models/payment_methods_request.rb, line 44
def initialize(credit_card = nil,
               payment_bank_us = nil,
               type = nil,
               custom_data = nil,
               rbits = nil)
  @credit_card = credit_card
  @payment_bank_us = payment_bank_us
  @type = type
  @custom_data = custom_data
  @rbits = rbits
end