spree_cod_payment 2.0.2 → 2.1.1

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: 39ecf0af456a36d46a4b40b58c816cdccfcae92163a2c124c112df914b6b9911
4
- data.tar.gz: 7966157fcf2cb703dda249680996a8788f39d1bbdd608395b18953be97335f6e
3
+ metadata.gz: 4b037c3edc83e783753618c61bb200d3bd9a455725dd10797f1226774a3a9b50
4
+ data.tar.gz: 8ddc1510fc47515386922299c14fbf64f6877c97f3b362c83fa9f40bcee529f9
5
5
  SHA512:
6
- metadata.gz: bf8a61dcd4ff396d30dcc8877acc70e9f1105f5b87be01e08e1b7bb33207bf561a80151aaa0bb061f7b6fec8d21fea71716777665f13e60963d8bc6b20e2934d
7
- data.tar.gz: c6cb0dccdca0e90d0c24d7a57607e4264742383f42d16633d764f45f9e99f71ee546fd96164c25cb64ec76f4743e8254d7c7bf850468033599584243dbd9dfcd
6
+ metadata.gz: ef12f7c78542ac6b151d97f70515b67c9e9e3b8a06a912815202c7b44bca77d8085a52900c1c77aa890496ab18b3381abe8117ef7b4e1b71dbd5330db7ddea9b
7
+ data.tar.gz: 05064d650c000bcf541147f2f018f246f8a5dcd3e3f0b3c80fd560f7240e0eda412bfffca64b47a2169881315c16966fc56a99358c04e15ef6da6c1ae8bcdfee
data/LICENSE.md CHANGED
@@ -1,8 +1,21 @@
1
1
  # MIT License
2
2
 
3
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
3
+ Copyright (c) 2025 OlympusOne
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:
4
11
 
5
12
  The above copyright notice and this permission notice shall be included in all
6
13
  copies or substantial portions of the Software.
7
14
 
8
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
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.
data/README.md CHANGED
@@ -66,4 +66,4 @@ If you'd like to contribute, please take a look at the
66
66
  [instructions](CONTRIBUTING.md) for installing dependencies and crafting a good
67
67
  pull request.
68
68
 
69
- Copyright (c) 2025 OlympusOne, released under the New BSD License
69
+ Copyright (c) 2025 OlympusOne, released under the MIT
@@ -1,14 +1,12 @@
1
1
  module Spree
2
2
  module PaymentMethodDecorator
3
- def available_for_order?(order)
4
- return cod_payment? && super if order.shipping_method&.cod?
5
-
6
- !cod_payment? && super
7
- end
8
-
9
3
  def cod_payment?
10
4
  method_type == 'cod_payment'
11
5
  end
6
+
7
+ def cod_payment_available?(order)
8
+ order.shipping_method&.cod?
9
+ end
12
10
  end
13
11
  end
14
12
 
@@ -0,0 +1,7 @@
1
+ Rails.application.config.after_initialize do
2
+ Rails.application.config.spree.payment_methods << Spree::PaymentMethod::CodPayment
3
+
4
+ Rails.application.config.spree_admin.shipping_method_form_partials << 'spree/admin/shipping_methods/cod_form'
5
+
6
+ Spree::PermittedAttributes.shipping_method_attributes << :cod
7
+ end
@@ -9,14 +9,6 @@ module SpreeCodPayment
9
9
  g.test_framework :rspec
10
10
  end
11
11
 
12
- config.after_initialize do |app|
13
- app.config.spree.payment_methods << Spree::PaymentMethod::CodPayment
14
-
15
- app.config.spree_admin.shipping_method_form_partials << 'spree/admin/shipping_methods/cod_form'
16
-
17
- Spree::PermittedAttributes.shipping_method_attributes << :cod
18
- end
19
-
20
12
  def self.activate
21
13
  Dir.glob(File.join(File.dirname(__FILE__), '../../app/**/*_decorator*.rb')) do |c|
22
14
  Rails.configuration.cache_classes ? require(c) : load(c)
@@ -1,5 +1,5 @@
1
1
  module SpreeCodPayment
2
- VERSION = '2.0.2'.freeze
2
+ VERSION = '2.1.1'.freeze
3
3
 
4
4
  def gem_version
5
5
  Gem::Version.new(VERSION)
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.0.2
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - OlympusOne
@@ -96,6 +96,7 @@ files:
96
96
  - app/views/spree/admin/shipping_methods/_cod_form.html.erb
97
97
  - app/views/spree/admin/spree/checkout/payment/_cod_payment.html.erb
98
98
  - app/views/spree/checkout/payment/_cod_payment.html.erb
99
+ - config/initializers/spree.rb
99
100
  - config/locales/el.yml
100
101
  - config/locales/en.yml
101
102
  - config/routes.rb
@@ -110,10 +111,10 @@ licenses:
110
111
  - MIT
111
112
  metadata:
112
113
  bug_tracker_uri: https://github.com/olympusone/spree_cod_payment/issues
113
- changelog_uri: https://github.com/olympusone/spree_cod_payment/releases/tag/v2.0.2
114
+ changelog_uri: https://github.com/olympusone/spree_cod_payment/releases/tag/v2.1.1
114
115
  documentation_uri: https://github.com/olympusone/spree_cod_payment
115
116
  homepage_uri: https://github.com/olympusone/spree_cod_payment
116
- source_code_uri: https://github.com/olympusone/spree_cod_payment/tree/v2.0.2
117
+ source_code_uri: https://github.com/olympusone/spree_cod_payment/tree/v2.1.1
117
118
  rdoc_options: []
118
119
  require_paths:
119
120
  - lib