Allow orders to be paid before checkout

Taler puts the payment completion into the hands of the user. So we
can't strictly finalise the payment and order together.

And in the bigger picture, it should be okay if a payment goes through
but we have to abort checkout due to stock issues. Then we want to be
able to check out again, using the existing complete payment. Any
refunds can be handled later by the shop owner.
This commit is contained in:
Maikel Linke
2026-02-16 13:29:53 +11:00
parent 62af416696
commit 9ca1a9e33f
2 changed files with 0 additions and 7 deletions

View File

@@ -674,8 +674,6 @@ module Spree
end
def process_each_payment
raise Core::GatewayError, Spree.t(:no_pending_payments) if pending_payments.empty?
pending_payments.each do |payment|
if payment.amount.zero? && zero_priced_order?
payment.update_columns(state: "completed", captured_at: Time.zone.now)

View File

@@ -282,11 +282,6 @@ RSpec.describe Spree::Order do
let(:payment) { build(:payment) }
before { allow(order).to receive_messages pending_payments: [payment], total: 10 }
it "returns false if no pending_payments available" do
allow(order).to receive_messages pending_payments: []
expect(order.process_payments!).to be_falsy
end
context "when the processing is sucessful" do
it "processes the payments" do
expect(payment).to receive(:process!)