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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 588155cb249e1eefd8e5c6ae2e6945618789083950c80c871d6edf1301816335
4
- data.tar.gz: e8d545d4df554f51f6c3e23bb11da7174b78e73285d2ca58106df76f95971fb8
3
+ metadata.gz: 2a03a9b9613b892110e4ddbf70e4f8e3da2cd83bf5636d29eb49e486f3fb4657
4
+ data.tar.gz: c07761960b024e5c87fee995ba330be9c702622be01ca07b9fe7c0315d92a48f
5
5
  SHA512:
6
- metadata.gz: ef4fcece6d37dfe33965151bfdb649985a343498bd1b028143deee6d1c34a9203e8d799424ccd68bca8d1fd2ea40ff9285c3f7fa4035c6b1338c0fcd3d33863b
7
- data.tar.gz: ae4a54b8c2732465955b5039faafb25bc4e22b5b3f723c928eaadca424f6dd06b5549fbd35ebc730baaae0e4083c4b891c35de336f5bc0e2bd2e2e62758865ca
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
@@ -1,5 +1,5 @@
1
1
  module Spree
2
- VERSION = '4.0.8'.freeze
2
+ VERSION = '4.0.9'.freeze
3
3
 
4
4
  def self.version
5
5
  VERSION
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.8
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: 2021-05-31 00:00:00.000000000 Z
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.8
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.8
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.3
1091
+ rubygems_version: 3.2.22
1091
1092
  signing_key:
1092
1093
  specification_version: 4
1093
1094
  summary: The bare bones necessary for Spree.