Regression: Reducing the order total to 0 after creating a payment intent results in payment with previous amount

Created on 5 August 2025, 10 days ago

Reopening the issue described here, which is (still) present in 2.1: πŸ› Reducing the order total to 0 after creating a payment intent results in payment with previous amount Fixed
Seems like a different root cause, because the patch from 3354240 is still present, but I'm copying the OP anyway.

Problem/Motivation

When a user provides a credit card, proceeds to checkout and then there or back on an earlier step uses a coupon, giftcard or similar feature to reduce the order price to 0, the payment intent fails to update the amount to zero in \Drupal\commerce_stripe\EventSubscriber\OrderPaymentIntentSubscriber::destruct() because that's not a valid amount.

The review pane will not sync/check the total price paid and confirm the previous payment. This will not create a payment and the payment is not visible in the order.

Steps to reproduce

Proposed resolution

The payment confirmation happens on the review pane through JS, skip that if the order total price is zero.

Remaining tasks

Some/all of these are possibly less-critical follow-ups:

* Cancel the payment intent if a zero-price order with a connected payment intent is placed.
* Improve the amount sync. Check for amount for 0, don't even try then, check for same amount to avoid extra API requests, log failing errors.
* Verify the price of the intent on the review pane?

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

2.1

Component

Card Element

Created by

πŸ‡ΊπŸ‡ΈUnited States AaronBauman Philadelphia

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