require 'fifthgear' module Fifthgear class CodeMaps Countries = { "AFG" => 1, "ALA" => 2, "ALB" => 3, "DZA" => 4, "ASM" => 5, "AND" => 6, "AGO" => 7, "AIA" => 8, "ATA" => 9, "ATG" => 10, "ARG" => 11, "ARM" => 12, "ABW" => 13, "AUS" => 14, "AUT" => 15, "AZE" => 16, "BHS" => 17, "BHR" => 18, "BGD" => 19, "BRB" => 20, "BLR" => 21, "BEL" => 22, "BLZ" => 23, "BEN" => 24, "BMU" => 25, "BTN" => 26, "BOL" => 27, "BIH" => 28, "BWA" => 29, "BVT" => 30, "BRA" => 31, "IOT" => 32, "BRN" => 33, "BGR" => 34, "BFA" => 35, "BDI" => 36, "KHM" => 37, "CMR" => 38, "CAN" => 39, "CPV" => 40, "CYM" => 41, "CAF" => 42, "TCD" => 43, "CHL" => 44, "CHN" => 45, "CXR" => 46, "CCK" => 47, "COL" => 48, "COM" => 49, "COG" => 50, "COD" => 51, "COK" => 52, "CRI" => 53, "CIV" => 54, "HRV" => 55, "CUB" => 56, "CYP" => 57, "CZE" => 58, "DNK" => 59, "DJI" => 60, "DMA" => 61, "DOM" => 62, "ECU" => 63, "EGY" => 64, "SLV" => 65, "GNQ" => 66, "ERI" => 67, "EST" => 68, "ETH" => 69, "FLK" => 70, "FRO" => 71, "FJI" => 72, "FIN" => 73, "FRA" => 74, "GUF" => 75, "PYF" => 76, "ATF" => 77, "GAB" => 78, "GMB" => 79, "GEO" => 80, "DEU" => 81, "GHA" => 82, "GIB" => 83, "GRC" => 84, "GRL" => 85, "GRD" => 86, "GLP" => 87, "GUM" => 88, "GTM" => 89, "GGY" => 90, "GIN" => 91, "GNB" => 92, "GUY" => 93, "HTI" => 94, "HMD" => 95, "VAT" => 96, "HND" => 97, "HKG" => 98, "HUN" => 99, "ISL" => 100, "IND" => 101, "IDN" => 102, "IRN" => 103, "IRQ" => 104, "IRL" => 105, "IMN" => 106, "ISR" => 107, "ITA" => 108, "JAM" => 109, "JPN" => 110, "JEY" => 111, "JOR" => 112, "KAZ" => 113, "KEN" => 114, "KIR" => 115, "PRK" => 116, "KOR" => 117, "KWT" => 118, "KGZ" => 119, "LAO" => 120, "LVA" => 121, "LBN" => 122, "LSO" => 123, "LBR" => 124, "LBY" => 125, "LIE" => 126, "LTU" => 127, "LUX" => 128, "MAC" => 129, "MKD" => 130, "MDG" => 131, "MWI" => 132, "MYS" => 133, "MDV" => 134, "MLI" => 135, "MLT" => 136, "MHL" => 137, "MTQ" => 138, "MRT" => 139, "MUS" => 140, "MYT" => 141, "MEX" => 142, "FSM" => 143, "MDA" => 144, "MCO" => 145, "MNG" => 146, "MNE" => 147, "MSR" => 148, "MAR" => 149, "MOZ" => 150, "MMR" => 151, "NAM" => 152, "NRU" => 153, "NPL" => 154, "NLD" => 155, "ANT" => 156, "NCL" => 157, "NZL" => 158, "NIC" => 159, "NER" => 160, "NGA" => 161, "NIU" => 162, "NFK" => 163, "MNP" => 164, "NOR" => 165, "OMN" => 166, "PAK" => 167, "PLW" => 168, "PSE" => 169, "PAN" => 170, "PNG" => 171, "PRY" => 172, "PER" => 173, "PHL" => 174, "PCN" => 175, "POL" => 176, "PRT" => 177, "PRI" => 178, "QAT" => 179, "REU" => 180, "ROM" => 181, "RUS" => 182, "RWA" => 183, "SHN" => 184, "KNA" => 185, "LCA" => 186, "SPM" => 187, "VCT" => 188, "WSM" => 189, "SMR" => 190, "STP" => 191, "SAU" => 192, "SEN" => 193, "SRB" => 194, "SYC" => 195, "SLE" => 196, "SGP" => 197, "SVK" => 198, "SVN" => 199, "SLB" => 200, "SOM" => 201, "ZAF" => 202, "SGS" => 203, "ESP" => 204, "LKA" => 205, "SDN" => 206, "SUR" => 207, "SJM" => 208, "SWZ" => 209, "SWE" => 210, "CHE" => 211, "SYR" => 212, "TWN" => 213, "TJK" => 214, "TZA" => 215, "THA" => 216, "TLS" => 217, "TGO" => 218, "TKL" => 219, "TON" => 220, "TTO" => 221, "TUN" => 222, "TUR" => 223, "TKM" => 224, "TCA" => 225, "TUV" => 226, "UGA" => 227, "UKR" => 228, "ARE" => 229, "GBR" => 230, "USA" => 231, "UMI" => 232, "URY" => 233, "UZB" => 234, "VUT" => 235, "VEN" => 236, "VNM" => 237, "VGB" => 238, "VIR" => 239, "WLF" => 240, "ESH" => 241, "YEM" => 242, "ZMB" => 243, "ZWE" => 244 } StatesOrProvinces = { "PR" => 0, "AS" => 1, "FM" => 2, "GU" => 3, "MH" => 4, "MP" => 5, "PW" => 6, "VI" => 7, "UM" => 8, "AL" => 9, "AK" => 10, "AZ" => 11, "AR" => 12, "CA" => 13, "CO" => 14, "CT" => 15, "DE" => 16, "DC" => 17, "FL" => 18, "GA" => 19, "HI" => 20, "ID" => 21, "IL" => 22, "IN" => 23, "IA" => 24, "KS" => 25, "KY" => 26, "LA" => 27, "ME" => 28, "MD" => 29, "MA" => 30, "MI" => 31, "MN" => 32, "MS" => 33, "MO" => 34, "MT" => 35, "NE" => 36, "NV" => 37, "NH" => 38, "NJ" => 39, "NM" => 40, "NY" => 41, "NC" => 42, "ND" => 43, "OH" => 44, "OK" => 45, "OR" => 46, "PA" => 47, "RI" => 48, "SC" => 49, "SD" => 50, "TN" => 51, "TX" => 52, "UT" => 53, "VT" => 54, "VA" => 55, "WA" => 56, "WV" => 57, "WI" => 58, "WY" => 59, "AE" => 60, "AA" => 61, "AP" => 62, "AB" => 63, "BC" => 64, "MB" => 65, "NB" => 66, "NL" => 67, "NT" => 68, "NS" => 69, "ON" => 70, "PE" => 71, "QC" => 72, "SK" => 73, "YT" => 74, "NU" => 75, "Other" => 76 } def self.state_or_province_code(state) StatesOrProvinces[state] || StatesOrProvinces["Other"] end Shipping = { fedex_smart_post: {label: "FedEx SmartPost", code: "SF1"}, fedex_2day: {label: "FedEx 2-day", code: "F11"}, fedex_overnight: {label: "FedEx Overnight", code: "F06"}, usps_priority: {label: "USPS Priority", code: "P03"}, ldmk_express: {label: "LDMK Express (2-4)", code: "Z99"}, ldmk_standard: {label: "LDMK Standard (3-8)", code: "Z98"} } end end