class SixSaferpay::Payer

Attributes

billing_address[RW]
delivery_address[RW]
id[RW]
ip_address[RW]
ip_location[RW]
language_code[RW]

Public Class Methods

new( id: nil, ip_address: nil, ip_location: nil, language_code: nil, delivery_address: nil, billing_address: nil ) click to toggle source
# File lib/six_saferpay/models/payer.rb, line 14
def initialize(
               id: nil,
               ip_address: nil,
               ip_location: nil,
               language_code: nil,
               delivery_address: nil,
               billing_address: nil
              )
  @id = id
  @ip_address = ip_address
  @ip_location = ip_location
  @language_code = language_code
  @delivery_address = SixSaferpay::DeliveryAddress.new(delivery_address.to_h) if delivery_address
  @billing_address = SixSaferpay::BillingAddress.new(billing_address.to_h) if billing_address
end

Public Instance Methods

to_h()
Alias for: to_hash
to_hash() click to toggle source
# File lib/six_saferpay/models/payer.rb, line 30
def to_hash
  hash = Hash.new
  hash.merge!(id: @id) if @id
  hash.merge!(ip_address: @ip_address) if @ip_address
  hash.merge!(ip_location: @ip_location) if @ip_location
  hash.merge!(language_code: @language_code) if @language_code
  hash.merge!(delivery_address: @delivery_address.to_h) if @delivery_address
  hash.merge!(billing_address: @billing_address.to_h) if @billing_address
  hash
end
Also aliased as: to_h