Skip to content

Commit

Permalink
Add Bolt as a Payment Method Option
Browse files Browse the repository at this point in the history
This commit adds bolt as a payment method option during solidus installation.
  • Loading branch information
piyushswain committed Jul 21, 2022
1 parent a227230 commit 5fb1b68
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions core/lib/generators/solidus/install/install_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class InstallGenerator < Rails::Generators::Base

PAYMENT_METHODS = {
'paypal' => 'solidus_paypal_commerce_platform',
'bolt' => 'solidus_bolt',
'none' => nil,
}

Expand Down Expand Up @@ -117,18 +118,6 @@ def plugin_install_preparation
@plugin_generators_to_run = []
end

def install_auth_plugin
if options[:with_authentication] && (options[:auto_accept] || !no?("
Solidus has a default authentication extension that uses Devise.
You can find more info at https://github.com/solidusio/solidus_auth_devise.
Would you like to install it? (Y/n)"))

@plugins_to_be_installed << 'solidus_auth_devise'
@plugin_generators_to_run << 'solidus:auth:install'
end
end

def install_payment_method
name = options[:payment_method]

Expand All @@ -148,6 +137,21 @@ def install_payment_method
end
end

def install_auth_plugin
# Doesn't need to add solidus_auth_devise if solidus_bolt is being installed as it already has the gem
return if @plugins_to_be_installed.include? 'solidus_bolt'

if options[:with_authentication] && (options[:auto_accept] || !no?("
Solidus has a default authentication extension that uses Devise.
You can find more info at https://github.com/solidusio/solidus_auth_devise.
Would you like to install it? (Y/n)"))

@plugins_to_be_installed << 'solidus_auth_devise'
@plugin_generators_to_run << 'solidus:auth:install'
end
end

def include_seed_data
append_file "db/seeds.rb", <<-RUBY.strip_heredoc
Expand Down

0 comments on commit 5fb1b68

Please sign in to comment.