Order balance is not updated when order placed

Created on 26 March 2025, 11 days ago

Problem/Motivation

The StripePaymentElement's onReturn() method creates the payment and then places and saves the order in a single request. The result is that the order balance is not correct when an order event subscriber runs.

Steps to reproduce

Subscribe to the 'commerce_order.place.post_transition' with no specified weight, and find that $order->getTotalPaid() is null or zero.

Proposed resolution

Either πŸ› onReturn method of StripePaymentElement should not apply "place" transition Active or

\Drupal::service('commerce_payment.order_updater')
$payment_order_updater->updateOrder($order);

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom jonathanshaw Stroud, UK

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024