class Minfraud::Components::Addressable
This is a parent class for the Billing
and Shipping
components.
Attributes
The first line of the user's billing / shipping address.
@return [String, nil]
The second line of the user's billing / shipping address.
@return [String, nil]
The city of the user's billing / shipping address.
@return [String, nil]
The company of the end user as provided in their billing / shipping information.
@return [String, nil]
The two character ISO 3166-1 alpha-2 country code of the user's billing / shipping address.
@see en.wikipedia.org/wiki/ISO_3166-1_alpha-2
@return [String, nil]
The first name of the end user as provided in their billing / shipping information.
@return [String, nil]
The last name of the end user as provided in their billing / shipping information.
@return [String, nil]
The country code for the phone number associated with the user's billing / shipping address. If you provide this information then you must provide at least one digit.
@return [String, nil]
The phone number without the country code for the user's billing / shipping address. Punctuation characters will be stripped. After stripping punctuation characters, the number must contain only digits.
@return [String, nil]
The postal code of the user's billing / shipping address.
@return [String, nil]
The ISO 3166-2 subdivision code for the user's billing / shipping address.
@see en.wikipedia.org/wiki/ISO_3166-2
@return [String, nil]
Public Class Methods
@param params [Hash] Hash of parameters. Each key/value should
correspond to one of the available attributes.
# File lib/minfraud/components/addressable.rb, line 79 def initialize(params = {}) @first_name = params[:first_name] @last_name = params[:last_name] @company = params[:company] @address = params[:address] @address_2 = params[:address_2] @city = params[:city] @region = params[:region] @country = params[:country] @postal = params[:postal] @phone_number = params[:phone_number] @phone_country_code = params[:phone_country_code] validate end
Private Instance Methods
# File lib/minfraud/components/addressable.rb, line 97 def validate return if !Minfraud.enable_validation validate_string('first_name', 255, @first_name) validate_string('last_name', 255, @last_name) validate_string('company', 255, @company) validate_string('address', 255, @address) validate_string('address_2', 255, @address_2) validate_string('city', 255, @city) validate_subdivision_code('region', @region) validate_country_code('country', @country) validate_string('postal', 255, @postal) validate_string('phone_number', 255, @phone_number) validate_telephone_country_code('phone_country_code', @phone_country_code) end