Class: Spree::Integrations::Delhivery

Inherits:
Spree::Integration
  • Object
show all
Defined in:
app/models/spree/integrations/delhivery.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.icon_pathObject

--- FIX ENDS HERE ---



29
30
31
# File 'app/models/spree/integrations/delhivery.rb', line 29

def self.icon_path
  "integration_icons/delhivery.png" # Make sure this image exists in your assets folder
end

.integration_groupObject

This method is required for the Admin Index page sorting



24
25
26
# File 'app/models/spree/integrations/delhivery.rb', line 24

def self.integration_group
  "Shipping"
end

.integration_nameObject



19
20
21
# File 'app/models/spree/integrations/delhivery.rb', line 19

def self.integration_name
  "Delhivery"
end

Instance Method Details

#api_urlObject



39
40
41
42
43
44
45
# File 'app/models/spree/integrations/delhivery.rb', line 39

def api_url
  if preferred_production_mode
    "https://track.delhivery.com"
  else
    "https://staging-express.delhivery.com"
  end
end

#preferred_api_tokenObject

  1. Helper to get the token (used in your Client)


34
35
36
37
# File 'app/models/spree/integrations/delhivery.rb', line 34

def preferred_api_token
# You can add logic here to decrypt if you want extra security
  preferences[:api_token]
end