Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

solidus_me

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

solidus_me

  • 3.2.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Solidus Me

CircleCI codecov

Gem para cotar empresas e valores de entrega junto à Api do Melhor Envio.

Installation

Adicionar solidus_me ao Gemfile:

gem 'solidus_me'

Executar:

bundle
bin/rails generate solidus_me:install

Executar o comando para instalar a gem de dependências solidus_brasilian_adaptations:

bin/rails generate solidus_brazilian_adaptations:install

Após, seguir o tutorial da gem soluds_brazilian_adaptations

Adicionar no arquivo /config/initilizers/spree.rb

Spree.config do |config|
+++
config.stock.estimator_class = "SolidusMe::ShippingEstimator"
+++
end

No painel do admin será adiconado o item do Melhor Envio no menu lateral. Nesta página deverão ser preenchidos os seguintes campos para autenticação do aplicativo:

CEP de origem:
Client ID:
Client Secret:
Redirect Url:
State:

Após salvar, o link completo para autenticação do aplicativo ficará disponível abaixo. A gem disponibiliza um endpoint (HOST/admin/melhor_envio/authorize) para receber o code e realizar a autenticação automaticamente. Uma vez autorizado, são gerados os refresh_token e access_token, e o sistema estará pronto para cotação dos fretes junto ao Melhor Envio.

Por padrão, os serviços de entrega são os SEDEX, PAC e MiniEnvios dos CORREIOS. Porém, os serviços podem ser customizados de acordo com a necessidade. Basta adicioná-los aos preferences da Spree::Store:

# Por exemplo
Spree::Store.first.update(preferences: { melhor_envio: { services: ["SEDEX", "PAC", "Mini Envios", ".Com", ".Package"] } })

Usage

Development

Testing the extension

First bundle your dependencies, then run bin/rake. bin/rake will default to building the dummy app if it does not exist, then it will run specs. The dummy app can be regenerated by using bin/rake extension:test_app.

bin/rake

To run Rubocop static code analysis run

bundle exec rubocop

When testing your application's integration with this extension you may use its factories. You can load Solidus core factories along with this extension's factories using this statement:

SolidusDevSupport::TestingSupport::Factories.load_for(SolidusMe::Engine)

Running the sandbox

To run this extension in a sandboxed Solidus application, you can run bin/sandbox. The path for the sandbox app is ./sandbox and bin/rails will forward any Rails commands to sandbox/bin/rails.

Here's an example:

$ bin/rails server
=> Booting Puma
=> Rails 6.0.2.1 application starting in development
* Listening on tcp://127.0.0.1:3000
Use Ctrl-C to stop

Releasing new versions

Please refer to the dedicated page in the Solidus wiki.

License

Copyright (c) 2023 ulysses-bull, released under the New BSD License.

FAQs

Package last updated on 28 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc