Skip to content

Commit

Permalink
Remove PayPal as an option during the installation process
Browse files Browse the repository at this point in the history
PayPal has stopped supporting its Ruby SDK [1]. From its README:

> This SDK is deprecated. You can continue to use it, but no new
features or support requests will be accepted. For alternatives, please
visit the current SDK homepage on the PayPal Developer Portal

From the PR [2] that introduced the deprecation message:

> There is no team at PayPal that supports this repo right now (and, in
> fact, the documentation for SDK has been removed from the PayPal docs
> site).
>
> My team is in the process of creating replacement SDKs for integrating
> with PayPal, but until those are available our official recommendation
> is to do one of the following:
>
> A) Use the API directly
> B) Continue using the current SDK, but know that no further updates
> will be made outside of necessary security updates

On top of that, the SDK is locked to paypalhttp_ruby lesser than 2 [3],
but Ruby 3 is only supported since that version [4]. That combines to
make it impossible to use Ruby > 3 + Solidus + PayPal extension.

If PayPal restarts giving support to Ruby, we'll add it again as an
option in the installer for solidus_frontend [5].

[1] - https://github.com/paypal/Checkout-Ruby-SDK
[2] - https://github.com/paypal/Checkout-Ruby-SDK/pull/34#issuecomment-1190523120
[3] - https://github.com/paypal/Checkout-Ruby-SDK/blob/7170ecd5656d9e9f96a4d0ce0ee31b59b3a8268b/paypal-checkout-sdk.gemspec#L22
[4] - paypal/paypalhttp_ruby#12 (comment)
[5] - https://github.com/solidusio/solidus_frontend/blob/master/lib/generators/solidus_frontend/install/install_generator.rb
  • Loading branch information
waiting-for-dev committed Aug 8, 2022
1 parent 2289410 commit 1bf1963
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 31 deletions.
3 changes: 1 addition & 2 deletions bin/sandbox
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ unbundled bin/rails generate solidus:install \
--auto-accept \
--user_class=Spree::User \
--enforce_available_locales=true \
--with_authentication=false \
--payment-method=none
--with_authentication=false
$@

unbundled bin/rails generate solidus:auth:install \
Expand Down
29 changes: 0 additions & 29 deletions core/lib/generators/solidus/install/install_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ module Solidus
class InstallGenerator < Rails::Generators::Base
CORE_MOUNT_ROUTE = "mount Spree::Core::Engine"

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

class_option :migrate, type: :boolean, default: true, banner: 'Run Solidus migrations'
class_option :seed, type: :boolean, default: true, banner: 'Load seed data (migrations must be run)'
class_option :sample, type: :boolean, default: true, banner: 'Load sample data (migrations must be run)'
Expand All @@ -24,11 +19,6 @@ class InstallGenerator < Rails::Generators::Base
class_option :lib_name, type: :string, default: 'spree'
class_option :with_authentication, type: :boolean, default: true
class_option :enforce_available_locales, type: :boolean, default: nil
class_option :payment_method,
type: :string,
enum: PAYMENT_METHODS.keys,
default: PAYMENT_METHODS.keys.first,
desc: "Indicates which payment method to install."

def self.source_paths
paths = superclass.source_paths
Expand Down Expand Up @@ -129,25 +119,6 @@ def install_auth_plugin
end
end

def install_payment_method
name = options[:payment_method]

unless options[:auto_accept]
available_names = PAYMENT_METHODS.keys

name = ask("
You can select a payment method to be included in the installation process.
Please select a payment method name:", limited_to: available_names, default: available_names.first)
end

gem_name = PAYMENT_METHODS.fetch(name)

if gem_name
@plugins_to_be_installed << gem_name
@plugin_generators_to_run << "#{gem_name}:install"
end
end

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

0 comments on commit 1bf1963

Please sign in to comment.