Payment error on NULL order balance, Order without any line items

Created on 21 February 2023, over 2 years ago

Describe your bug or feature request.

Getting the below error while trying to add Payment when no order items are added.

The page got crashed and got the below error message.

InvalidArgumentException: The payment amount cannot be determined due to a NULL order balance. in Drupal\commerce_payment\PluginForm\ManualPaymentAddForm->buildConfigurationForm() (line 22 of /var/www/html/web/modules/contrib/commerce/modules/payment/src/PluginForm/ManualPaymentAddForm.php).

If a bug, provide steps to reproduce it from a clean install.

Add a proper error handler to avoid the unexpected page crash.

Steps to Reproduce

  1. Install Drupal Commerce module(Order, Order Item and Payment)
  2. Create Order as Administrator in backend admin/commerce/orders/add (Not as usual add to cart )
  3. On the Order edit page Don't add any order Items
  4. Got to the payment tab and try to add Payment
  5. Choose the payment type
  6. You can able to see the page break issue

Related issue #2804227: Add getTotalPaid() and getBalance() methods to orders

🐛 Bug report
Status

Active

Version

2.0

Component

Payment

Created by

🇮🇳India arunkumark Coimbatore

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