spree_core 4.1.14 → 4.1.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/spree/order/store_credit.rb +8 -0
- data/app/models/spree/order_contents.rb +31 -0
- data/lib/spree/core/version.rb +1 -1
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 839249efbd80112c669ba2a4790ab353b6c31476be2c845de2edfbda03d6cd6b
|
4
|
+
data.tar.gz: 170887f258fae01503d713b33f709fdff05f8f8298c3bdfb11d659881be58a3d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8492dc3ea5d4c89f2cc6de08ac9aee6b28bbc04fa9518550c72c51c9ccf60bf1930fe0c5db5000a5baee6faa1a2924d84e32c20bfd1fc58cbe3c73db27b593a
|
7
|
+
data.tar.gz: 95128587c2913170eccf5dd5bcf1cd39686c5e57cd4ec952e8fcfa89079ff28671f7630c975fd6e2af0243a71c54fab8f6605d01a9b038f368e3aa6dde90c2e8
|
@@ -1,6 +1,14 @@
|
|
1
1
|
module Spree
|
2
2
|
class Order < Spree::Base
|
3
3
|
module StoreCredit
|
4
|
+
def add_store_credit_payments(amount = nil)
|
5
|
+
Spree::Dependencies.checkout_add_store_credit_service.constantize.call(order: self, amount: amount)
|
6
|
+
end
|
7
|
+
|
8
|
+
def remove_store_credit_payments
|
9
|
+
Spree::Dependencies.checkout_remove_store_credit_service.constantize.call(order: self)
|
10
|
+
end
|
11
|
+
|
4
12
|
def covered_by_store_credit?
|
5
13
|
return false unless user
|
6
14
|
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module Spree
|
2
|
+
class OrderContents
|
3
|
+
attr_accessor :order, :currency
|
4
|
+
|
5
|
+
def initialize(order)
|
6
|
+
@order = order
|
7
|
+
end
|
8
|
+
|
9
|
+
def add(variant, quantity = 1, options = {})
|
10
|
+
Spree::Dependencies.cart_add_item_service.constantize.call(order: order,
|
11
|
+
variant: variant,
|
12
|
+
quantity: quantity,
|
13
|
+
options: options).value
|
14
|
+
end
|
15
|
+
|
16
|
+
def remove(variant, quantity = 1, options = {})
|
17
|
+
Spree::Dependencies.cart_remove_item_service.constantize.call(order: order,
|
18
|
+
variant: variant,
|
19
|
+
quantity: quantity,
|
20
|
+
options: options).value
|
21
|
+
end
|
22
|
+
|
23
|
+
def remove_line_item(line_item, options = {})
|
24
|
+
Spree::Cart::RemoveLineItem.call(order: @order, line_item: line_item, options: options).value
|
25
|
+
end
|
26
|
+
|
27
|
+
def update_cart(params)
|
28
|
+
Spree::Dependencies.cart_update_service.constantize.call(order: order, params: params).value
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
data/lib/spree/core/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.1.
|
4
|
+
version: 4.1.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Schofield
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemerchant
|
@@ -496,6 +496,7 @@ files:
|
|
496
496
|
- app/models/spree/order/currency_updater.rb
|
497
497
|
- app/models/spree/order/payments.rb
|
498
498
|
- app/models/spree/order/store_credit.rb
|
499
|
+
- app/models/spree/order_contents.rb
|
499
500
|
- app/models/spree/order_inventory.rb
|
500
501
|
- app/models/spree/order_merger.rb
|
501
502
|
- app/models/spree/order_promotion.rb
|
@@ -1095,9 +1096,9 @@ licenses:
|
|
1095
1096
|
- BSD-3-Clause
|
1096
1097
|
metadata:
|
1097
1098
|
bug_tracker_uri: https://github.com/spree/spree/issues
|
1098
|
-
changelog_uri: https://github.com/spree/spree/releases/tag/v4.1.
|
1099
|
+
changelog_uri: https://github.com/spree/spree/releases/tag/v4.1.15
|
1099
1100
|
documentation_uri: https://guides.spreecommerce.org/
|
1100
|
-
source_code_uri: https://github.com/spree/spree/tree/v4.1.
|
1101
|
+
source_code_uri: https://github.com/spree/spree/tree/v4.1.15
|
1101
1102
|
post_install_message:
|
1102
1103
|
rdoc_options: []
|
1103
1104
|
require_paths:
|
@@ -1113,7 +1114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1113
1114
|
- !ruby/object:Gem::Version
|
1114
1115
|
version: 1.8.23
|
1115
1116
|
requirements: []
|
1116
|
-
rubygems_version: 3.2.
|
1117
|
+
rubygems_version: 3.2.22
|
1117
1118
|
signing_key:
|
1118
1119
|
specification_version: 4
|
1119
1120
|
summary: The bare bones necessary for Spree.
|