spree_cod_payment 2.1.1 → 2.1.5

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4b037c3edc83e783753618c61bb200d3bd9a455725dd10797f1226774a3a9b50
4
- data.tar.gz: 8ddc1510fc47515386922299c14fbf64f6877c97f3b362c83fa9f40bcee529f9
3
+ metadata.gz: d063f48be7a6803ed931ed50a143d272736dfbdd3082fad142e273c8cf70a9b7
4
+ data.tar.gz: 20d10617f77391e562268160675c580e5410bca41d4c0c8b50d2feaf2bc14536
5
5
  SHA512:
6
- metadata.gz: ef12f7c78542ac6b151d97f70515b67c9e9e3b8a06a912815202c7b44bca77d8085a52900c1c77aa890496ab18b3381abe8117ef7b4e1b71dbd5330db7ddea9b
7
- data.tar.gz: 05064d650c000bcf541147f2f018f246f8a5dcd3e3f0b3c80fd560f7240e0eda412bfffca64b47a2169881315c16966fc56a99358c04e15ef6da6c1ae8bcdfee
6
+ metadata.gz: ba8e4266f52fb259b79dfc60b2430206bc3b6d6709759a42359af7bdc0edfab00dd2c224618308a85a08250de7f0bb387465fc8654ac84e8988b086b67a067b2
7
+ data.tar.gz: 4be69c7ecaaf5030ec0caa6db062faa07a36d4e33b7ce5068e3471ddfe7f409802122147542043c4a23032704378df8fe05db8c008a14bc69913b31fc0c80f8e
data/LICENSE.md CHANGED
@@ -1,21 +1,15 @@
1
- # MIT License
1
+ # LICENSE
2
2
 
3
- Copyright (c) 2025 OlympusOne
3
+ Copyright (c) 2025 OlympusOne. All rights reserved.
4
4
 
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
5
+ This program is free software: you can redistribute it and/or modify it under the terms of the
6
+ GNU Affero General Public License as published by the Free Software Foundation, either
7
+ version 3 of the License, or any later version.
11
8
 
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
9
+ This program is distributed in the hope that it will be useful,
10
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ GNU Affero General Public License for more details.
14
13
 
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
14
+ You should have received a copy of the GNU Affero General Public License
15
+ along with this program. If not, see [https://www.gnu.org/licenses/](https://www.gnu.org/licenses/).
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # SpreeCodPayment
1
+ # Spree COD Payment
2
2
 
3
- This is a Cash On Delivery Payment extension for [Spree Commerce](https://spreecommerce.org), an open source e-commerce platform built with Ruby on Rails. Adds Cash on Delivery (COD) payment method to Spree stores.
3
+ This is a Cash On Delivery Payment extension for [Spree Commerce](https://spreecommerce.org), an open source e-commerce platform built with Ruby on Rails. Adds Cash on Delivery (COD) payment method option during checkout.
4
4
 
5
5
  [![Gem Version](https://badge.fury.io/rb/spree_cod_payment.svg)](https://badge.fury.io/rb/spree_cod_payment)
6
6
 
@@ -8,23 +8,17 @@ This is a Cash On Delivery Payment extension for [Spree Commerce](https://spreec
8
8
 
9
9
  1. Add this extension to your Gemfile with this line:
10
10
 
11
- ```ruby
11
+ ```bash
12
12
  bundle add spree_cod_payment
13
13
  ```
14
14
 
15
- 2. Install the migrations:
16
-
17
- ```sh
18
- bundle exec rake railties:install:migrations FROM=spree_cod_payment
19
- ```
20
-
21
- 3. Run the migrations:
15
+ 2. Run the install generator
22
16
 
23
- ```sh
24
- bundle exec rails db:migrate
17
+ ```bash
18
+ bundle exec rails g spree_cod_payment:install
25
19
  ```
26
20
 
27
- 4. Restart your server
21
+ 3. Restart your server
28
22
 
29
23
  If your server was running, restart it so that it can find the assets properly.
30
24
 
@@ -38,6 +32,7 @@ This is a Cash On Delivery Payment extension for [Spree Commerce](https://spreec
38
32
  ```
39
33
 
40
34
  2. Add your new code
35
+
41
36
  3. Run tests
42
37
 
43
38
  ```bash
@@ -53,7 +48,7 @@ require 'spree_cod_payment/factories'
53
48
 
54
49
  ## Releasing a new version
55
50
 
56
- ```shell
51
+ ```bash
57
52
  bundle exec gem bump -p -t
58
53
  bundle exec gem release
59
54
  ```
@@ -66,4 +61,4 @@ If you'd like to contribute, please take a look at the
66
61
  [instructions](CONTRIBUTING.md) for installing dependencies and crafting a good
67
62
  pull request.
68
63
 
69
- Copyright (c) 2025 OlympusOne, released under the MIT
64
+ Copyright (c) 2025 OlympusOne, released under the AGPL-3.0 or later.
@@ -8,6 +8,10 @@ module Spree
8
8
  Spree.t(:cod_payment_method)
9
9
  end
10
10
 
11
+ def payment_icon_name
12
+ 'cash'
13
+ end
14
+
11
15
  def source_required?
12
16
  false
13
17
  end
@@ -8,6 +8,6 @@ module Spree
8
8
  order.shipping_method&.cod?
9
9
  end
10
10
  end
11
- end
12
11
 
13
- Spree::PaymentMethod.prepend Spree::PaymentMethodDecorator
12
+ PaymentMethod.prepend PaymentMethodDecorator
13
+ end
@@ -5,10 +5,6 @@
5
5
  </h5>
6
6
  </div>
7
7
  <div class="card-body">
8
- <div class="custom-control custom-checkbox">
9
- <%= f.check_box :cod, class: 'custom-control-input' %>
10
- <%= f.label :cod, class: 'custom-control-label font-weight-semibold' %>
11
- <%= f.error_message_on :cod %>
12
- </div>
8
+ <%= f.spree_check_box :cod %>
13
9
  </div>
14
10
  </div>
@@ -1,7 +1,7 @@
1
1
  Rails.application.config.after_initialize do
2
- Rails.application.config.spree.payment_methods << Spree::PaymentMethod::CodPayment
2
+ Spree.payment_methods << Spree::PaymentMethod::CodPayment
3
3
 
4
- Rails.application.config.spree_admin.shipping_method_form_partials << 'spree/admin/shipping_methods/cod_form'
4
+ Spree.admin.partials.shipping_method_form << 'spree/admin/shipping_methods/cod_form'
5
5
 
6
6
  Spree::PermittedAttributes.shipping_method_attributes << :cod
7
7
  end
@@ -0,0 +1,13 @@
1
+ module SpreeCodPayment
2
+ class Configuration < Spree::Preferences::Configuration
3
+
4
+ # Some example preferences are shown below, for more information visit:
5
+ # https://docs.spreecommerce.org/developer/contributing/creating-an-extension
6
+
7
+ # preference :enabled, :boolean, default: true
8
+ # preference :dark_chocolate, :boolean, default: true
9
+ # preference :color, :string, default: 'Red'
10
+ # preference :favorite_number, :integer
11
+ # preference :supported_locales, :array, default: [:en]
12
+ end
13
+ end
@@ -9,6 +9,10 @@ module SpreeCodPayment
9
9
  g.test_framework :rspec
10
10
  end
11
11
 
12
+ initializer 'spree_cod_payment.environment', before: :load_config_initializers do |_app|
13
+ SpreeCodPayment::Config = SpreeCodPayment::Configuration.new
14
+ end
15
+
12
16
  def self.activate
13
17
  Dir.glob(File.join(File.dirname(__FILE__), '../../app/**/*_decorator*.rb')) do |c|
14
18
  Rails.configuration.cache_classes ? require(c) : load(c)
@@ -1,5 +1,5 @@
1
1
  module SpreeCodPayment
2
- VERSION = '2.1.1'.freeze
2
+ VERSION = '2.1.5'.freeze
3
3
 
4
4
  def gem_version
5
5
  Gem::Version.new(VERSION)
@@ -2,3 +2,5 @@ require 'spree_core'
2
2
  require 'spree_extension'
3
3
  require 'spree_cod_payment/engine'
4
4
  require 'spree_cod_payment/version'
5
+ require 'spree_cod_payment/configuration'
6
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_cod_payment
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - OlympusOne
@@ -15,42 +15,42 @@ dependencies:
15
15
  requirements:
16
16
  - - ">="
17
17
  - !ruby/object:Gem::Version
18
- version: 5.0.4
18
+ version: 5.2.0
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - ">="
24
24
  - !ruby/object:Gem::Version
25
- version: 5.0.4
25
+ version: 5.2.0
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: spree_storefront
28
28
  requirement: !ruby/object:Gem::Requirement
29
29
  requirements:
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 5.0.4
32
+ version: 5.2.0
33
33
  type: :runtime
34
34
  prerelease: false
35
35
  version_requirements: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - ">="
38
38
  - !ruby/object:Gem::Version
39
- version: 5.0.4
39
+ version: 5.2.0
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: spree_admin
42
42
  requirement: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
- version: 5.0.4
46
+ version: 5.2.0
47
47
  type: :runtime
48
48
  prerelease: false
49
49
  version_requirements: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - ">="
52
52
  - !ruby/object:Gem::Version
53
- version: 5.0.4
53
+ version: 5.2.0
54
54
  - !ruby/object:Gem::Dependency
55
55
  name: spree_extension
56
56
  requirement: !ruby/object:Gem::Requirement
@@ -79,7 +79,7 @@ dependencies:
79
79
  - - ">="
80
80
  - !ruby/object:Gem::Version
81
81
  version: '0'
82
- description: Adds Cash on Delivery (COD) payment method to Spree stores.
82
+ description: Adds Cash on Delivery (COD) payment method option during checkout.
83
83
  email: info@olympusone.com
84
84
  executables: []
85
85
  extensions: []
@@ -103,18 +103,19 @@ files:
103
103
  - db/migrate/20250601165042_add_cod_fee_to_shipping_methods.rb
104
104
  - lib/generators/spree_cod_payment/install/install_generator.rb
105
105
  - lib/spree_cod_payment.rb
106
+ - lib/spree_cod_payment/configuration.rb
106
107
  - lib/spree_cod_payment/engine.rb
107
108
  - lib/spree_cod_payment/factories.rb
108
109
  - lib/spree_cod_payment/version.rb
109
110
  homepage: https://github.com/olympusone/spree_cod_payment
110
111
  licenses:
111
- - MIT
112
+ - AGPL-3.0-or-later
112
113
  metadata:
113
114
  bug_tracker_uri: https://github.com/olympusone/spree_cod_payment/issues
114
- changelog_uri: https://github.com/olympusone/spree_cod_payment/releases/tag/v2.1.1
115
+ changelog_uri: https://github.com/olympusone/spree_cod_payment/releases/tag/v2.1.5
115
116
  documentation_uri: https://github.com/olympusone/spree_cod_payment
116
117
  homepage_uri: https://github.com/olympusone/spree_cod_payment
117
- source_code_uri: https://github.com/olympusone/spree_cod_payment/tree/v2.1.1
118
+ source_code_uri: https://github.com/olympusone/spree_cod_payment/tree/v2.1.5
118
119
  rdoc_options: []
119
120
  require_paths:
120
121
  - lib
@@ -132,5 +133,5 @@ requirements:
132
133
  - none
133
134
  rubygems_version: 3.6.9
134
135
  specification_version: 4
135
- summary: Spree Commerce Cash On Delivery Payment Extension
136
+ summary: Spree Commerce Cash On Delivery (COD) Extension
136
137
  test_files: []