solidus_mollie 0.1.0 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +21 -23
  3. data/README.md +90 -56
  4. data/app/controllers/solidus_mollie/callbacks_controller.rb +43 -0
  5. data/app/decorators/solidus_mollie/spree/checkout_controller_decorator.rb +60 -0
  6. data/app/models/solidus_mollie/client.rb +66 -0
  7. data/app/models/solidus_mollie/mollie_source.rb +31 -0
  8. data/app/models/solidus_mollie/payment_method.rb +106 -0
  9. data/app/models/solidus_mollie/response.rb +33 -0
  10. data/app/services/solidus_mollie/create_order_payment.rb +76 -0
  11. data/app/services/solidus_mollie/process_webhook.rb +68 -0
  12. data/app/views/spree/checkout/payment/_mollie.html.erb +5 -0
  13. data/config/locales/en.yml +5 -6
  14. data/config/routes.rb +6 -15
  15. data/db/migrate/20260620143922_create_solidus_mollie_sources.rb +15 -0
  16. data/lib/generators/solidus_mollie/install/install_generator.rb +24 -16
  17. data/lib/generators/solidus_mollie/install/templates/initializer.rb +5 -4
  18. data/lib/solidus_mollie/engine.rb +24 -14
  19. data/lib/solidus_mollie/factories.rb +16 -0
  20. data/lib/solidus_mollie/version.rb +1 -1
  21. data/lib/solidus_mollie.rb +9 -1
  22. metadata +50 -84
  23. data/.circleci/config.yml +0 -41
  24. data/.gem_release.yml +0 -5
  25. data/.github/stale.yml +0 -17
  26. data/.github_changelog_generator +0 -2
  27. data/.gitignore +0 -20
  28. data/.rspec +0 -2
  29. data/.rubocop.yml +0 -5
  30. data/CHANGELOG.md +0 -1
  31. data/Gemfile +0 -33
  32. data/Rakefile +0 -6
  33. data/app/assets/javascripts/spree/backend/solidus_mollie.js +0 -2
  34. data/app/assets/javascripts/spree/frontend/solidus_mollie.js +0 -2
  35. data/app/assets/stylesheets/spree/backend/solidus_mollie.css +0 -4
  36. data/app/assets/stylesheets/spree/frontend/solidus_mollie.css +0 -4
  37. data/app/controllers/spree/api/mollie_controller.rb +0 -31
  38. data/app/controllers/spree/mollie_controller.rb +0 -53
  39. data/app/decorators/models/line_item_decorator.rb +0 -21
  40. data/app/decorators/models/payment_create_decorator.rb +0 -22
  41. data/app/models/spree/gateway/mollie_gateway.rb +0 -155
  42. data/app/models/spree/mollie/order_serializer.rb +0 -169
  43. data/app/models/spree/mollie/payment_state_updater.rb +0 -62
  44. data/app/models/spree/mollie_logger.rb +0 -16
  45. data/app/models/spree/mollie_payment_source.rb +0 -57
  46. data/app/models/spree/payment_method/mollie.rb +0 -26
  47. data/app/views/spree/admin/payments/source_forms/_mollie.html.erb +0 -8
  48. data/app/views/spree/admin/payments/source_views/_mollie.html.erb +0 -27
  49. data/app/views/spree/api/payments/show.json.jbuilder +0 -5
  50. data/app/views/spree/api/payments/source_views/_mollie.json.jbuilder +0 -2
  51. data/bin/console +0 -17
  52. data/bin/rails +0 -7
  53. data/bin/rails-engine +0 -13
  54. data/bin/rails-sandbox +0 -16
  55. data/bin/rake +0 -7
  56. data/bin/sandbox +0 -86
  57. data/bin/setup +0 -8
  58. data/db/migrate/20201110194821_create_solidus_mollie_payment_source.rb +0 -14
  59. data/lib/solidus_mollie/configuration.rb +0 -21
  60. data/lib/solidus_mollie/testing_support/factories.rb +0 -4
  61. data/solidus_mollie.code-workspace +0 -8
  62. data/solidus_mollie.gemspec +0 -35
  63. data/spec/solidus_mollie_gateway_spec.rb +0 -5
  64. data/spec/spec_helper.rb +0 -31
data/bin/console DELETED
@@ -1,17 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- # frozen_string_literal: true
4
-
5
- require "bundler/setup"
6
- require "solidus_mollie"
7
-
8
- # You can add fixtures and/or initialization code here to make experimenting
9
- # with your gem easier. You can also use a different console, if you like.
10
- $LOAD_PATH.unshift(*Dir["#{__dir__}/../app/*"])
11
-
12
- # (If you use this, don't forget to add pry to your Gemfile!)
13
- # require "pry"
14
- # Pry.start
15
-
16
- require "irb"
17
- IRB.start(__FILE__)
data/bin/rails DELETED
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- if %w[g generate].include? ARGV.first
4
- exec "#{__dir__}/rails-engine", *ARGV
5
- else
6
- exec "#{__dir__}/rails-sandbox", *ARGV
7
- end
data/bin/rails-engine DELETED
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # This command will automatically be run when you run "rails" with Rails gems
3
- # installed from the root of your application.
4
-
5
- ENGINE_ROOT = File.expand_path('..', __dir__)
6
- ENGINE_PATH = File.expand_path('../lib/solidus_mollie/engine', __dir__)
7
-
8
- # Set up gems listed in the Gemfile.
9
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
10
- require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
11
-
12
- require 'rails/all'
13
- require 'rails/engine/commands'
data/bin/rails-sandbox DELETED
@@ -1,16 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- app_root = 'sandbox'
4
-
5
- unless File.exist? "#{app_root}/bin/rails"
6
- warn 'Creating the sandbox app...'
7
- Dir.chdir "#{__dir__}/.." do
8
- system "#{__dir__}/sandbox" or begin
9
- warn 'Automatic creation of the sandbox app failed'
10
- exit 1
11
- end
12
- end
13
- end
14
-
15
- Dir.chdir app_root
16
- exec 'bin/rails', *ARGV
data/bin/rake DELETED
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- require "rubygems"
5
- require "bundler/setup"
6
-
7
- load Gem.bin_path("rake", "rake")
data/bin/sandbox DELETED
@@ -1,86 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- set -e
4
-
5
- case "$DB" in
6
- postgres|postgresql)
7
- RAILSDB="postgresql"
8
- ;;
9
- mysql)
10
- RAILSDB="mysql"
11
- ;;
12
- sqlite|'')
13
- RAILSDB="sqlite3"
14
- ;;
15
- *)
16
- echo "Invalid DB specified: $DB"
17
- exit 1
18
- ;;
19
- esac
20
-
21
- if [ ! -z $SOLIDUS_BRANCH ]
22
- then
23
- BRANCH=$SOLIDUS_BRANCH
24
- else
25
- BRANCH="master"
26
- fi
27
-
28
- extension_name="solidus_mollie"
29
-
30
- # Stay away from the bundler env of the containing extension.
31
- function unbundled {
32
- ruby -rbundler -e'b = proc {system *ARGV}; Bundler.respond_to?(:with_unbundled_env) ? Bundler.with_unbundled_env(&b) : Bundler.with_clean_env(&b)' -- $@
33
- }
34
-
35
- rm -rf ./sandbox
36
- unbundled bundle exec rails new sandbox --database="$RAILSDB" \
37
- --skip-bundle \
38
- --skip-git \
39
- --skip-keeps \
40
- --skip-rc \
41
- --skip-spring \
42
- --skip-test \
43
- --skip-javascript
44
-
45
- if [ ! -d "sandbox" ]; then
46
- echo 'sandbox rails application failed'
47
- exit 1
48
- fi
49
-
50
- cd ./sandbox
51
- cat <<RUBY >> Gemfile
52
- gem 'solidus', github: 'solidusio/solidus', branch: '$BRANCH'
53
- gem 'solidus_auth_devise', '>= 2.1.0'
54
- gem 'rails-i18n'
55
- gem 'solidus_i18n'
56
-
57
- gem '$extension_name', path: '..'
58
-
59
- group :test, :development do
60
- platforms :mri do
61
- gem 'pry-byebug'
62
- end
63
- end
64
- RUBY
65
-
66
- unbundled bundle install --gemfile Gemfile
67
-
68
- unbundled bundle exec rake db:drop db:create
69
-
70
- unbundled bundle exec rails generate solidus:install \
71
- --auto-accept \
72
- --user_class=Spree::User \
73
- --enforce_available_locales=true \
74
- --with-authentication=false \
75
- --payment-method=none \
76
- $@
77
-
78
- unbundled bundle exec rails generate solidus:auth:install
79
- unbundled bundle exec rails generate ${extension_name}:install
80
-
81
- echo
82
- echo "🚀 Sandbox app successfully created for $extension_name!"
83
- echo "🚀 Using $RAILSDB and Solidus $BRANCH"
84
- echo "🚀 Use 'export DB=[postgres|mysql|sqlite]' to control the DB adapter"
85
- echo "🚀 Use 'export SOLIDUS_BRANCH=<BRANCH-NAME>' to control the Solidus version"
86
- echo "🚀 This app is intended for test purposes."
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- gem install bundler --conservative
7
- bundle update
8
- bin/rake clobber
@@ -1,14 +0,0 @@
1
- class CreateSolidusMolliePaymentSource < ActiveRecord::Migration[6.0]
2
- def change
3
- create_table :solidus_mollie_payment_sources do |t|
4
- t.timestamps
5
- t.string :payment_id
6
- t.string :payment_method_name
7
- t.string :issuer
8
- t.string :status
9
- t.string :payment_url
10
- t.integer :payment_method_id
11
- t.integer :user_id
12
- end
13
- end
14
- end
@@ -1,21 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module SolidusMollie
4
- class Configuration
5
- # Define here the settings for this extension, e.g.:
6
- #
7
- # attr_accessor :my_setting
8
- end
9
-
10
- class << self
11
- def configuration
12
- @configuration ||= Configuration.new
13
- end
14
-
15
- alias config configuration
16
-
17
- def configure
18
- yield configuration
19
- end
20
- end
21
- end
@@ -1,4 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- FactoryBot.define do
4
- end
@@ -1,8 +0,0 @@
1
- {
2
- "folders": [
3
- {
4
- "path": "."
5
- }
6
- ],
7
- "settings": {}
8
- }
@@ -1,35 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'lib/solidus_mollie/version'
4
-
5
- Gem::Specification.new do |spec|
6
- spec.name = 'solidus_mollie'
7
- spec.version = SolidusMollie::VERSION
8
- spec.authors = ['Victor ter Hark', 'Dermot Tynan']
9
- spec.email = 'dtynan@kalopa.com'
10
-
11
- spec.summary = 'Accept payments through Mollie using Solidus Storefront'
12
- spec.homepage = 'https://github.com/kalopa/solidus_mollie'
13
- spec.license = 'BSD-3-Clause'
14
-
15
- spec.metadata['homepage_uri'] = spec.homepage
16
- spec.metadata['source_code_uri'] = 'https://github.com/kalopa/solidus_mollie'
17
- spec.metadata['changelog_uri'] = 'https://github.com/kalopa/solidus_mollie/releases'
18
-
19
- spec.required_ruby_version = Gem::Requirement.new('~> 2.5')
20
-
21
- # Specify which files should be added to the gem when it is released.
22
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
23
- files = Dir.chdir(__dir__) { `git ls-files -z`.split("\x0") }
24
-
25
- spec.files = files.grep_v(%r{^(test|spec|features)/})
26
- spec.test_files = files.grep(%r{^(test|spec|features)/})
27
- spec.bindir = "exe"
28
- spec.executables = files.grep(%r{^exe/}) { |f| File.basename(f) }
29
- spec.require_paths = ["lib"]
30
-
31
- spec.add_dependency 'solidus_core', ['>= 4.6.0', '< 5.0']
32
- spec.add_dependency 'solidus_support', '~> 0.15'
33
- spec.add_runtime_dependency 'mollie-api-ruby', '~> 4.19.0'
34
- spec.add_development_dependency 'solidus_dev_support', '~> 2.12'
35
- end
@@ -1,5 +0,0 @@
1
- RSpec.describe SpreeMollieGateway do
2
- it 'has a version number' do
3
- expect(SolidusMollie::VERSION).not_to be nil
4
- end
5
- end
data/spec/spec_helper.rb DELETED
@@ -1,31 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Configure Rails Environment
4
- ENV['RAILS_ENV'] = 'test'
5
-
6
- # Run Coverage report
7
- require 'solidus_dev_support/rspec/coverage'
8
-
9
- # Create the dummy app if it's still missing.
10
- dummy_env = "#{__dir__}/dummy/config/environment.rb"
11
- system 'bin/rake extension:test_app' unless File.exist? dummy_env
12
- require dummy_env
13
-
14
- # Requires factories and other useful helpers defined in spree_core.
15
- require 'solidus_dev_support/rspec/feature_helper'
16
-
17
- # Requires supporting ruby files with custom matchers and macros, etc,
18
- # in spec/support/ and its subdirectories.
19
- Dir["#{__dir__}/support/**/*.rb"].sort.each { |f| require f }
20
-
21
- # Requires factories defined in lib/solidus_mollie/testing_support/factories.rb
22
- SolidusDevSupport::TestingSupport::Factories.load_for(SolidusMollie::Engine)
23
-
24
- RSpec.configure do |config|
25
- config.infer_spec_type_from_file_location!
26
- config.use_transactional_fixtures = false
27
-
28
- if Spree.solidus_gem_version < Gem::Version.new('2.11')
29
- config.extend Spree::TestingSupport::AuthorizationHelpers::Request, type: :system
30
- end
31
- end