Sha256: 4ae817c847338182f41dfab20aa11082847fc76370f4318f1b972b9b08b1d68f

Contents?: true

Size: 747 Bytes

Versions: 1

Compression:

Stored size: 747 Bytes

Contents

module Spree
  module Calculator::Shipping
    module Usps
      class FirstClassMailParcel < Spree::Calculator::Shipping::Usps::Base
        WEIGHT_LIMITS = { "US" => 13 }

        def self.geo_group
          :domestic
        end

        def self.service_code
          "#{SERVICE_CODE_PREFIX[geo_group]}:0" #First-Class MailĀ® Parcel
        end

        def self.description
          I18n.t("usps.first_class_mail_parcel")
        end

        protected
        def max_weight_for_country(country)
          #if weight in ounces > 13, then First Class Mail is not available for the order
          # https://www.usps.com/ship/first-class-international.htm
          return WEIGHT_LIMITS[country.iso]
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
solidus_active_shipping-1.0.0 app/models/spree/calculator/shipping/usps/first_class_mail_parcel.rb