Class: PayPal::SDK::REST::DataTypes::BillingInfo

Inherits:
Base show all
Defined in:
lib/paypal-sdk/rest/data_types.rb

Constant Summary

Constants inherited from Core::API::DataTypes::Base

Core::API::DataTypes::Base::ContentKey, Core::API::DataTypes::Base::HashOptions

Instance Attribute Summary

Attributes inherited from Base

#error, #header, #request_id

Class Method Summary collapse

Methods inherited from Base

#http_header, #merge!, #raise_error!, raise_on_api_error, #success?

Methods inherited from Core::API::DataTypes::Base

add_attribute, add_member, array_of, #convert_array, #convert_object, define_alias_methods, #hash_key, #initialize, #member_names, members, #members, #merge!, object_of, #set, #skip_value?, snakecase, #to_hash, #value_to_hash

Methods included from Core::Logging

#log_event, #logger, logger, logger=

Constructor Details

This class inherits a constructor from PayPal::SDK::Core::API::DataTypes::Base

Class Method Details

.load_membersObject



1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
# File 'lib/paypal-sdk/rest/data_types.rb', line 1821

def self.load_members
  object_of :email, String
  object_of :first_name, String
  object_of :last_name, String
  object_of :business_name, String
  object_of :address, InvoiceAddress
  object_of :language, String
  object_of :additional_info, String
  object_of :notification_channel, String
  object_of :phone, Phone

  define_method "address=" do |value|
    if value.is_a?(Address)
      value = value.to_hash
    end
    object = convert_object(value, InvoiceAddress)
    instance_variable_set("@address", object)
  end

  define_method "address" do |&block|
    default_value = PayPal::SDK::Core::Util::OrderedHash.new
    value = instance_variable_get("@address") || ( default_value && (send("address=", default_value)))
    value = convert_object(value.to_hash, Address)
    value
  end

  define_method "invoice_address=" do |value|
    object = convert_object(value, InvoiceAddress)
    instance_variable_set("@address", object)
  end

  define_method "invoice_address" do |&block|
    default_value = PayPal::SDK::Core::Util::OrderedHash.new
    value = instance_variable_get("@address") || ( default_value && (send("address=", default_value)))
    value
  end
end