solidus icon indicating copy to clipboard operation
solidus copied to clipboard

Add Bolt as a Payment Method Option

Open piyushswain opened this issue 3 years ago • 4 comments

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)

piyushswain avatar Jun 15 '22 08:06 piyushswain

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

piyushswain avatar Jul 25 '22 04:07 piyushswain

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

piyushswain avatar Jul 25 '22 04:07 piyushswain

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

It looks like solidus_social needs to be adapted so that it no references constants in initializers. See the Rails guides for context.

waiting-for-dev avatar Jul 27 '22 03:07 waiting-for-dev

@piyushswain can you take care of it?

DanielePalombo avatar Jul 27 '22 05:07 DanielePalombo

As it contains code referencing solidus_frontend, we need to move it to the solidus_frontend installer.

waiting-for-dev avatar Aug 17 '22 04:08 waiting-for-dev

@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.

piyushswain avatar Aug 17 '22 07:08 piyushswain

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?

waiting-for-dev avatar Aug 17 '22 08:08 waiting-for-dev