Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
Set `auto_capture` on by default (#12270)
Damian Legawiec44e832ba95e1
diff --git a/core/lib/spree/core/configuration.rb b/core/lib/spree/core/configuration.rbindex 42803aac9f..ffe5461778 100644--- a/core/lib/spree/core/configuration.rb+++ b/core/lib/spree/core/configuration.rb@@ -33,7 +33,7 @@ module Spreepreference :always_include_confirm_step, :boolean, default: false # Ensures confirmation step is always in checkout_progress bar, but does not force a confirm step if your payment methods do not support it.preference :always_put_site_name_in_title, :boolean, deprecated: truepreference :always_use_translations, :boolean, default: false- preference :auto_capture, :boolean, default: false # automatically capture the credit card (as opposed to just authorize and capture later)+ preference :auto_capture, :boolean, default: true # automatically capture the credit card (as opposed to just authorize and capture later)preference :auto_capture_on_dispatch, :boolean, default: false # Captures payment for each shipment in Shipment#after_ship callback, and makes Shipment.ready when payment authorized.preference :binary_inventory_cache, :boolean, default: false, deprecated: true # only invalidate product cache when a stock item changes whether it is in_stockpreference :checkout_zone, :string, default: nil, deprecated: true # replace with the name of a zone if you would like to limit the countriesdiff --git a/core/spec/lib/tasks/exchanges_spec.rb b/core/spec/lib/tasks/exchanges_spec.rbindex adee8afe6a..3f5e26dade 100644--- a/core/spec/lib/tasks/exchanges_spec.rb+++ b/core/spec/lib/tasks/exchanges_spec.rb@@ -26,11 +26,13 @@ describe 'exchanges:charge_unreturned_items' doSpree::Shipment.last.ship!return_item_1.receive!Timecop.travel travel_time+ Spree::Config[:auto_capture] = falseendafter doTimecop.returnSpree::Config[:expedited_exchanges] = @original_expedited_exchanges_pref+ Spree::Config[:auto_capture] = trueendcontext 'fewer than the config allowed days have passed' dodiff --git a/core/spec/models/spree/payment_spec.rb b/core/spec/models/spree/payment_spec.rbindex 02e0cc4d56..9a7e70adf8 100644--- a/core/spec/models/spree/payment_spec.rb+++ b/core/spec/models/spree/payment_spec.rb@@ -981,12 +981,12 @@ describe Spree::Payment, type: :model docontext 'state changes' doit 'are logged to the database' doexpect(payment.state_changes).to be_empty- expect(payment.process!).to be true+ expect(payment.process!).to be_a(Spree::PaymentCaptureEvent)expect(payment.state_changes.count).to eq(2)changes = payment.state_changes.map { |change| { change.previous_state => change.next_state } }expect(changes).to match_array([{ 'checkout' => 'processing' },- { 'processing' => 'pending' }+ { 'processing' => 'completed' }])endend