Class: Calculator::SEDEX

Inherits:
CorreiosBaseCalculator
  • Object
show all
Defined in:
app/models/spree/calculator/sedex.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.descriptionObject



3
4
5
# File 'app/models/spree/calculator/sedex.rb', line 3

def self.description
  "SEDEX"
end

Instance Method Details

#shipping_codeObject



15
16
17
18
19
20
21
# File 'app/models/spree/calculator/sedex.rb', line 15

def shipping_code
  if has_contract?
    40096
  else
    40010
  end
end

#shipping_methodObject



7
8
9
10
11
12
13
# File 'app/models/spree/calculator/sedex.rb', line 7

def shipping_method
  if preferred_token.present? && preferred_password.present?
    :sedex_com_contrato_1
  else
    :sedex
  end
end