diff --git a/core/lib/generators/solidus/install/app_templates/payment_method/bolt.rb b/core/lib/generators/solidus/install/app_templates/payment_method/bolt.rb new file mode 100644 index 00000000000..fdb6d602fec --- /dev/null +++ b/core/lib/generators/solidus/install/app_templates/payment_method/bolt.rb @@ -0,0 +1,13 @@ +unless Bundler.locked_gems.dependencies['solidus_frontend'] + say_status :warning, "Support for frontends other than `solidus_frontend` by `solidus_bolt` is still in progress.", :yellow +end + +unless Bundler.locked_gems.dependencies['solidus_auth_devise'] + say_status :warning, "Running solidus_bolt without solidus_auth_devise is not supported.", :yellow +end + +unless Bundler.locked_gems.dependencies['solidus_bolt'] + bundle_command 'add solidus_bolt' +end + +generate 'solidus_bolt:install' diff --git a/core/lib/generators/solidus/install/install_generator.rb b/core/lib/generators/solidus/install/install_generator.rb index 00c66735f98..6c0d40c672f 100644 --- a/core/lib/generators/solidus/install/install_generator.rb +++ b/core/lib/generators/solidus/install/install_generator.rb @@ -30,6 +30,7 @@ class InstallGenerator < Rails::Generators::AppBase PAYMENT_METHODS = %w[ paypal + bolt none ] @@ -319,6 +320,8 @@ def detect_authentication_to_install def detect_payment_method_to_install return 'paypal' if Bundler.locked_gems.dependencies['solidus_paypal_commerce_platform'] + return 'bolt' if Bundler.locked_gems.dependencies['solidus_bolt'] + options[:payment_method] || (options[:auto_accept] && @selected_frontend == 'classic' ? 'paypal' : 'none') || (@selected_frontend != 'classic' && 'none') || # bail out if it's not classic @@ -329,6 +332,7 @@ def detect_payment_method_to_install Which payment method would you like to use? - [#{set_color 'paypal', :bold}] Install `solidus_paypal_commerce_platform` (#{set_color :default, :bold}). + - [#{set_color 'bolt', :bold}] Install `solidus_bolt`. - [#{set_color 'none', :bold}] Skip installing a payment method. TEXT )