Class: EPlat::Mapping::Bigcommerce::V3::Order::ShippingAddress

Inherits:
EPlat::Mapping::Base show all
Defined in:
lib/e_plat/mapping/bigcommerce/v_3/order/shipping_address.rb

Direct Known Subclasses

BillingAddress

Constant Summary

Constants inherited from EPlat::Mapping::Base

EPlat::Mapping::Base::DEFAULT_VALUES

Instance Attribute Summary

Attributes inherited from EPlat::Mapping::Base

#resource, #virtual_collection

Instance Method Summary collapse

Methods inherited from EPlat::Mapping::Base

#aliases, #e_plat_key_to, #initialize, #inspect, #keys_aliased_to_native_keys, #mappable_keys, #mappings, #native_key_to, #native_setter, #to_e_plat_keys, #to_native_keys, #via_native_attributes_where_possible, virtual_collection

Methods included from RequestBodyRoot

#include_root_in_request_body?

Constructor Details

This class inherits a constructor from EPlat::Mapping::Base

Instance Method Details

#native_attribute_aliasesObject



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/e_plat/mapping/bigcommerce/v_3/order/shipping_address.rb', line 30

def native_attribute_aliases
    super.concat([
        {
            alias_attribute: {native_key: "street_1", e_plat_key: "address1"}
        },
        {
            alias_attribute: {native_key: "street_2", e_plat_key: "address2"}
        },
        {
            existing_entry: {native_key: "city", e_plat_key: "city"}
        },
        {
            existing_entry: {native_key: "company", e_plat_key: "company"}
        },
        {
            existing_entry: {native_key: "country", e_plat_key: "country"}
        },
        {
            existing_entry: {native_key: "first_name", e_plat_key: "first_name"}
        },
        {
            existing_entry: {native_key: "last_name", e_plat_key: "last_name"}
        },
        {
            existing_entry: {native_key: "phone", e_plat_key: "phone"}
        },
        {
            alias_attribute: {native_key: "state", e_plat_key: "province"}
        },
        {
            existing_entry: {native_key: "zip", e_plat_key: "zip"}
        },
        {
            alias_attribute: {native_key: "country_iso2", e_plat_key: "country_code"}
        }
        # NOTE: BigCommerce doesn't provide fields for province_code, latitude, longitude, or a direct mapping for name
    ])
end

#native_attributesObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/e_plat/mapping/bigcommerce/v_3/order/shipping_address.rb', line 12

def native_attributes
    super.concat([
        "first_name",
        "last_name",
        "company",
        "street_1",
        "street_2",
        "city",
        "state",
        "zip",
        "country",
        "country_iso2",
        "phone",
        "email",
        "form_fields"
    ])
end

#native_top_keyObject



8
9
10
# File 'lib/e_plat/mapping/bigcommerce/v_3/order/shipping_address.rb', line 8

def native_top_key
    "data"
end