Skip to content

Commit

Permalink
Add Bolt as an alternative payment method option
Browse files Browse the repository at this point in the history
  • Loading branch information
elia committed Oct 19, 2022
1 parent 21c1549 commit 374c8f2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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'
4 changes: 4 additions & 0 deletions core/lib/generators/solidus/install/install_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class InstallGenerator < Rails::Generators::AppBase

PAYMENT_METHODS = %w[
paypal
bolt
none
]

Expand Down Expand Up @@ -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
Expand All @@ -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
)
Expand Down

0 comments on commit 374c8f2

Please sign in to comment.