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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 65c07dcb2b230c430ef669d130077a6b37328bad3d4a684358f3c462611cb2d4
4
- data.tar.gz: 1f2fe362ca2d556585c55d69c6a339c87cc34cd3566097a1f2b66a494eab8262
3
+ metadata.gz: ff04e01b371dc635b2140ecc92bf59cc914672337987823e7dbb1ff87d7ca6f3
4
+ data.tar.gz: 3527e9cbaeabfe35e4bace4c21e2d15aeda4ca410dbc04cbdf4cf40fc99faf72
5
5
  SHA512:
6
- metadata.gz: 1019730fe49fd1809896d281545897eeb14c3795a56ebcf13238299292516eefe925ca5dae258de512b36eab8df475c4dc45b8119b8c1f91471e0e694a15ff2b
7
- data.tar.gz: bd6af18b359d118d2392b1a36cfd997b8521b0444cd803e97a2b72b24b035920acdcee35c8ac25df35a5adf108b592706706e8aa9cba48a8b4ff99314dde8f01
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
@@ -1,5 +1,5 @@
1
1
  module Spree
2
- VERSION = '4.5.3'.freeze
2
+ VERSION = '4.5.4'.freeze
3
3
 
4
4
  def self.version
5
5
  VERSION
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.3
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: 2023-05-14 00:00:00.000000000 Z
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.3
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.3
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.4.1
1011
+ rubygems_version: 3.5.3
1011
1012
  signing_key:
1012
1013
  specification_version: 4
1013
1014
  summary: The bare bones necessary for Spree