spree_core 4.0.8 → 4.0.9
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: 2a03a9b9613b892110e4ddbf70e4f8e3da2cd83bf5636d29eb49e486f3fb4657
|
4
|
+
data.tar.gz: c07761960b024e5c87fee995ba330be9c702622be01ca07b9fe7c0315d92a48f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4d24118216bd79b613f96692b37d09289298de88da7b895d9345645fe6a23bb34862d889e3812dcd27570d8791e9584c11c8fe25bf76484100e7d175533d041
|
7
|
+
data.tar.gz: 6be12d08fad71b54fe85fa83c0c86efd8e99ba5203fccb992bf8dd51b7d974c598f0e28a00afd249c9037d0f24d16583f4e1aa3290d30df00f49a9be2c7bff53
|
@@ -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.0.
|
4
|
+
version: 4.0.9
|
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
|
@@ -482,6 +482,7 @@ files:
|
|
482
482
|
- app/models/spree/order/currency_updater.rb
|
483
483
|
- app/models/spree/order/payments.rb
|
484
484
|
- app/models/spree/order/store_credit.rb
|
485
|
+
- app/models/spree/order_contents.rb
|
485
486
|
- app/models/spree/order_inventory.rb
|
486
487
|
- app/models/spree/order_merger.rb
|
487
488
|
- app/models/spree/order_promotion.rb
|
@@ -1069,9 +1070,9 @@ licenses:
|
|
1069
1070
|
- BSD-3-Clause
|
1070
1071
|
metadata:
|
1071
1072
|
bug_tracker_uri: https://github.com/spree/spree/issues
|
1072
|
-
changelog_uri: https://github.com/spree/spree/releases/tag/v4.0.
|
1073
|
+
changelog_uri: https://github.com/spree/spree/releases/tag/v4.0.9
|
1073
1074
|
documentation_uri: https://guides.spreecommerce.org/
|
1074
|
-
source_code_uri: https://github.com/spree/spree/tree/v4.0.
|
1075
|
+
source_code_uri: https://github.com/spree/spree/tree/v4.0.9
|
1075
1076
|
post_install_message:
|
1076
1077
|
rdoc_options: []
|
1077
1078
|
require_paths:
|
@@ -1087,7 +1088,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1087
1088
|
- !ruby/object:Gem::Version
|
1088
1089
|
version: 1.8.23
|
1089
1090
|
requirements: []
|
1090
|
-
rubygems_version: 3.2.
|
1091
|
+
rubygems_version: 3.2.22
|
1091
1092
|
signing_key:
|
1092
1093
|
specification_version: 4
|
1093
1094
|
summary: The bare bones necessary for Spree.
|