solidus
solidus copied to clipboard
Add Bolt as a Payment Method Option
This PR adds bolt as a payment method option during solidus installation.
The install_generator.rb file has been updated to add Bolt as an optional payment method during solidus installation.
The Bolt option in the payment method installs the solidus_bolt gem.
Ref solidus_bolt#109
Checklist:
- [x] I have followed Pull Request guidelines
- [x] I have added a detailed description into each commit message
- [ ] I have updated Guides and README accordingly to this change (if needed)
- [ ] I have added tests to cover this change (if needed)
- [ ] I have attached screenshots to this PR for visual changes (if needed)
Successfully installed on:
| Rails | Ruby | Solidus Branch |
|---|---|---|
| 6.1.6.1 | 2.7.4 | v3.1 |
| 6.1.6.1 | 2.7.4 | v3.0 |
| 6.1.6.1 | 2.7.4 | v2.11 |
Change required to make in work:
In config/application.rb addded the following line
config.active_record.yaml_column_permitted_classes = [Symbol]
Otherwise got the following error on bin/rails generate solidus:install:
Psych::DisallowedClass: Tried to load unspecified class: Symbol
/Users/piyushswain/solidusio/solidus/sample/db/samples/payment_methods.rb:3:in `<main>'
/Users/piyushswain/solidusio/solidus/sample/lib/spree/sample.rb:17:in `load_sample'
/Users/piyushswain/solidusio/solidus/sample/lib/spree_sample.rb:12:in `load_samples'
/Users/piyushswain/solidusio/solidus/sample/lib/tasks/sample.rake:21:in `block (2 levels) in <main>'
@DanielePalombo
Failing on:
| Rails | Ruby | Solidus Branch |
|---|---|---|
| 7.0.3.1 | 2.7.4 | master |
Related Error:
on bin/rails generate solidus:install
uninitialized constant Spree::SocialConfiguration (NameError)
::Spree::SocialConfig = ::Spree::SocialConfiguration.new
@DanielePalombo
Failing on: Rails Ruby Solidus Branch 7.0.3.1 2.7.4 master
Related Error: on
bin/rails generate solidus:installuninitialized constant Spree::SocialConfiguration (NameError) ::Spree::SocialConfig = ::Spree::SocialConfiguration.new@DanielePalombo
It looks like solidus_social needs to be adapted so that it no references constants in initializers. See the Rails guides for context.
@piyushswain can you take care of it?
As it contains code referencing solidus_frontend, we need to move it to the solidus_frontend installer.
@waiting-for-dev Could you please explain a little more on why we need to move the bolt installation to the solidus_frontend installer.
From what I understand solidus installation should install any selected payment_method and solidus_frontend should install the new frontend.
I don't understand the reason why we need to move this to solidus_frontend.
Sure, @piyushswain. Sorry for not being clear enough. Since https://github.com/solidusio/solidus/pull/4490, the Solidus installer prompts the user to select solidus_frontend or solidus_starter_frontend as storefront. The solidus_bolt extension injects code to solidus_frontend, so the extension won't work when users select solidus_starter_frontend. As the installer delegates to the solidus frontend installer when that's selected, we need to add that logic there.
We're now recommending extensions not to add storefront code. We're still missing a discussion about how we should tackle this kind of built-in integration for the new recommended frontend, though.
Does it make sense?