spree_core 4.2.6 → 4.2.7

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: 143756ca5b9239fc071ef8948eb3d28fe38d1873d35c3f59bec6e31dc370be4d
4
- data.tar.gz: 87d64aef8854cb4cfad388026b2a33bc248674134c11f441f1a216c50e99460f
3
+ metadata.gz: 6b469e8dee55a662982149fbc79bb798341a52da2d7d7ded1e0353a4c8010859
4
+ data.tar.gz: b633068dd8204485b512dd395216ffbda53e9fc7cc62f113a08b1fcbe7183d4d
5
5
  SHA512:
6
- metadata.gz: 56cdedfeafaf2908de5a7bc4176ddfdaf0d3c32bcb2c05817c9032fd3339f5dace62b27ddfc783300dd2986abdf6fc9b364afd5c59d5374cbfa87ee57de90d4d
7
- data.tar.gz: 201ed2b41f227ce9eed7d8e1ff682406563f29a4d19f0c4443c1a3373ee240721acfdb2e3f252322972c1b260c3584501866388c2c40bc7f273bd20db844a2c2
6
+ metadata.gz: feecadebe12b6959f521a39bcce7508acb1f48b815679a7916b0003d6330e96a6003e2f19a9c9b58e76c016e79af71f865586097534013739c1a7371160aabc5
7
+ data.tar.gz: c020b19d48c81bf75ae67f1c3404e0b18a69a7d6021a06f0edff442d5bee5d8e7d627d2e207adec190d74b6a4c66f93ec1eaa34bfe1b494e05c1d682846c08f0
@@ -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.2.6'.freeze
2
+ VERSION = '4.2.7'.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.2.6
4
+ version: 4.2.7
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: 2022-06-01 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: activemerchant
@@ -504,6 +504,7 @@ files:
504
504
  - app/models/spree/order/currency_updater.rb
505
505
  - app/models/spree/order/payments.rb
506
506
  - app/models/spree/order/store_credit.rb
507
+ - app/models/spree/order_contents.rb
507
508
  - app/models/spree/order_inventory.rb
508
509
  - app/models/spree/order_merger.rb
509
510
  - app/models/spree/order_promotion.rb
@@ -1143,9 +1144,9 @@ licenses:
1143
1144
  - BSD-3-Clause
1144
1145
  metadata:
1145
1146
  bug_tracker_uri: https://github.com/spree/spree/issues
1146
- changelog_uri: https://github.com/spree/spree/releases/tag/v4.2.6
1147
+ changelog_uri: https://github.com/spree/spree/releases/tag/v4.2.7
1147
1148
  documentation_uri: https://guides.spreecommerce.org/
1148
- source_code_uri: https://github.com/spree/spree/tree/v4.2.6
1149
+ source_code_uri: https://github.com/spree/spree/tree/v4.2.7
1149
1150
  post_install_message:
1150
1151
  rdoc_options: []
1151
1152
  require_paths:
@@ -1161,7 +1162,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1161
1162
  - !ruby/object:Gem::Version
1162
1163
  version: 1.8.23
1163
1164
  requirements: []
1164
- rubygems_version: 3.0.9
1165
+ rubygems_version: 3.5.3
1165
1166
  signing_key:
1166
1167
  specification_version: 4
1167
1168
  summary: The bare bones necessary for Spree.