spree_core 4.5.3 → 4.5.4
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: ff04e01b371dc635b2140ecc92bf59cc914672337987823e7dbb1ff87d7ca6f3
|
4
|
+
data.tar.gz: 3527e9cbaeabfe35e4bace4c21e2d15aeda4ca410dbc04cbdf4cf40fc99faf72
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5499a4dccc1bb9d110326cf3150a5b80df3c0c8473086d55ff73d8607c074567f732cd678948d28e151bba9cf9d51fca1d47f67eb01180568853a6cac10c7f8c
|
7
|
+
data.tar.gz: d8100ed6a1b0dad462328d25d758595c3e2132aefeb7452a3ed450b56df4a84decf8461c605e6c7c512e0163d2a6b80edfb248d76153072e97f44ac74a5a4312
|
@@ -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,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.5.
|
4
|
+
version: 4.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Schofield
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2024-04-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionpack
|
@@ -575,6 +575,7 @@ files:
|
|
575
575
|
- app/models/spree/order/emails.rb
|
576
576
|
- app/models/spree/order/payments.rb
|
577
577
|
- app/models/spree/order/store_credit.rb
|
578
|
+
- app/models/spree/order_contents.rb
|
578
579
|
- app/models/spree/order_inventory.rb
|
579
580
|
- app/models/spree/order_merger.rb
|
580
581
|
- app/models/spree/order_promotion.rb
|
@@ -989,9 +990,9 @@ licenses:
|
|
989
990
|
- BSD-3-Clause
|
990
991
|
metadata:
|
991
992
|
bug_tracker_uri: https://github.com/spree/spree/issues
|
992
|
-
changelog_uri: https://github.com/spree/spree/releases/tag/v4.5.
|
993
|
+
changelog_uri: https://github.com/spree/spree/releases/tag/v4.5.4
|
993
994
|
documentation_uri: https://dev-docs.spreecommerce.org/
|
994
|
-
source_code_uri: https://github.com/spree/spree/tree/v4.5.
|
995
|
+
source_code_uri: https://github.com/spree/spree/tree/v4.5.4
|
995
996
|
post_install_message:
|
996
997
|
rdoc_options: []
|
997
998
|
require_paths:
|
@@ -1007,7 +1008,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1007
1008
|
- !ruby/object:Gem::Version
|
1008
1009
|
version: 1.8.23
|
1009
1010
|
requirements: []
|
1010
|
-
rubygems_version: 3.
|
1011
|
+
rubygems_version: 3.5.3
|
1011
1012
|
signing_key:
|
1012
1013
|
specification_version: 4
|
1013
1014
|
summary: The bare bones necessary for Spree
|