Class: Sink::Models::ShippingAddress

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/sink/models/shipping_address.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#[], #deconstruct_keys, #inspect, #to_h, #to_s

Constructor Details

#initialize(data = {}) ⇒ ShippingAddress

Create a new instance of ShippingAddress from a Hash of raw data.

Parameters:

  • data (Hash{Symbol => Object}) (defaults to: {})

    . @option data [String] :address1 Valid USPS routable address. @option data [String] :city City @option data [String] :country Uppercase ISO 3166-1 alpha-3 three character abbreviation. @option data [String] :first_name Customer’s first name. This will be the first name printed on the physical card. @option data [String] :last_name Customer’s surname (family name). This will be the last name printed on the

    physical card.
    

    @option data [String] :postal_code Postal code (formerly zipcode). For US addresses, either five-digit zipcode or

    nine-digit "ZIP+4".
    

    @option data [String] :state Uppercase ISO 3166-2 two character abbreviation for US and CA. Optional with a

    limit of 24 characters for other countries.
    

    @option data [String, nil] :address2 Unit number (if applicable). @option data [String, nil] :email Email address to be contacted for expedited shipping process purposes. Required

    if `shipping_method` is `EXPEDITED`.
    

    @option data [String, nil] :line2_text Text to be printed on line two of the physical card. Use of this field requires

    additional permissions.
    

    @option data [String, nil] :phone_number Cardholder’s phone number in E.164 format to be contacted for expedited shipping

    process purposes. Required if `shipping_method` is `EXPEDITED`.
    


21
# File 'lib/sink/models/shipping_address.rb', line 21

def initialize(data = {}) = super

Instance Attribute Details

#address1String

Valid USPS routable address.

Returns:

  • (String)


9
# File 'lib/sink/models/shipping_address.rb', line 9

required :address1, String

#address2String

Unit number (if applicable).

Returns:

  • (String)


44
# File 'lib/sink/models/shipping_address.rb', line 44

optional :address2, String

#cityString

City

Returns:

  • (String)


14
# File 'lib/sink/models/shipping_address.rb', line 14

required :city, String

#countryString

Uppercase ISO 3166-1 alpha-3 three character abbreviation.

Returns:

  • (String)


19
# File 'lib/sink/models/shipping_address.rb', line 19

required :country, String

#emailString

Email address to be contacted for expedited shipping process purposes. Required if ‘shipping_method` is `EXPEDITED`.

Returns:

  • (String)


49
# File 'lib/sink/models/shipping_address.rb', line 49

optional :email, String

#first_nameString

Customer’s first name. This will be the first name printed on the physical card.

Returns:

  • (String)


24
# File 'lib/sink/models/shipping_address.rb', line 24

required :first_name, String

#last_nameString

Customer’s surname (family name). This will be the last name printed on the physical card.

Returns:

  • (String)


29
# File 'lib/sink/models/shipping_address.rb', line 29

required :last_name, String

#line2_textString

Text to be printed on line two of the physical card. Use of this field requires additional permissions.

Returns:

  • (String)


54
# File 'lib/sink/models/shipping_address.rb', line 54

optional :line2_text, String

#phone_numberString

Cardholder’s phone number in E.164 format to be contacted for expedited shipping process purposes. Required if ‘shipping_method` is `EXPEDITED`.

Returns:

  • (String)


59
# File 'lib/sink/models/shipping_address.rb', line 59

optional :phone_number, String

#postal_codeString

Postal code (formerly zipcode). For US addresses, either five-digit zipcode or nine-digit “ZIP+4”.

Returns:

  • (String)


34
# File 'lib/sink/models/shipping_address.rb', line 34

required :postal_code, String

#stateString

Uppercase ISO 3166-2 two character abbreviation for US and CA. Optional with a limit of 24 characters for other countries.

Returns:

  • (String)


39
# File 'lib/sink/models/shipping_address.rb', line 39

required :state, String