Implementation of ClearSale Start to Spree. To see the docs, click here.
This gem needs the customer's document (CPF/CNPJ), which is represented by the setting Spree::ClearSaleConfig[:doc_customer_attr]. It's recommended use the gem spree_zaez_brazilian_fields for that.
This gem does not support guest checkout. So disable this option in a config file:
Spree::Config[:allow_guest_checkout] = false
In /admin/orders, the column considered risky of the order is overrided for the ClearSale score.
Installation
Add spree_zaez_clearsale to your Gemfile:
gem 'spree_zaez_clearsale', github: 'zaeznet/spree_zaez_clearsale'
Bundle your dependencies and run the installation generator:
bundle
bundle exec rails g spree_zaez_clearsale:install
Settings
To configure the ClearSale, go to /admin/clear_sale_settings/edit (or access by the menu in configurations > ClearSale Settings). To set the settings through a config file, you can assign values to the settings like so:
Spree::ClearSaleConfig[:token] = 'asd-123'
See all settings in /lib/spree/clear_sale_configuration.rb
If your customer has the attribute birth date (using the gem spree_zaez_brazilian_fields for example), you could set by the setting:
Spree::ClearSaleConfig[:birth_date_customer_attr]
Deface
Backend
* replace_considered_risky_column -> spree/admin/orders/index.html.erb
* replace_considered_risky_label -> spree/admin/orders/index.html.erb
* add_clear_sale_iframe_to_order_menu -> spree/admin/shared/_order_tabs.html.erb
* add_clear_sale_settings_tab -> spree/admin/shared/sub_menu/_configuration.html.erb
Frontend
* add_constructor_to_form -> spree/address/_form.html.erb
Testing
First bundle your dependencies, then run rake
. 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 rake test_app
.
bundle
bundle exec rake
Copyright (c) 2015 Zaez Inovação Digital, released under the New BSD License