Skip to content

[5.x]: Manual transaction input currency localization formatting broken #3812

Open
@MatthiasBrodelet

Description

@MatthiasBrodelet

What happened?

Description

Creating a manual transaction always results in a server error.

[TypeError] craft\commerce\elements\Order::setPaymentAmount(): Argument #1 ($amount) must be of type float, array given, called in /var/www/vhosts/the-house.be/sites/the-house.be/vendor/craftcms/commerce/src/controllers/PaymentsController.php on line 447 {"trace":["#0 /var/www/vhosts/the-house.be/sites/the-house.be/vendor/craftcms/commerce/src/controllers/PaymentsController.php(447): craft\\commerce\\elements\\Order->setPaymentAmount()","#1 [internal function]: craft\\commerce\\controllers\\PaymentsController->actionPay()","#2 /var/www/vhosts/the-house.be/sites/the-house.be/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array()","#3 /var/www/vhosts/the-house.be/sites/the-house.be/vendor/yiisoft/yii2/base/Controller.php(178): yii\\base\\InlineAction->runWithParams()","#4 /var/www/vhosts/the-house.be/sites/the-house.be/vendor/yiisoft/yii2/base/Module.php(552): yii\\base\\Controller->runAction()","#5 /var/www/vhosts/the-house.be/sites/the-house.be/vendor/craftcms/cms/src/web/Application.php(350): yii\\base\\Module->runAction()","#6 /var/www/vhosts/the-house.be/sites/the-house.be/vendor/craftcms/cms/src/web/Application.php(649): craft\\web\\Application->runAction()","#7 /var/www/vhosts/the-house.be/sites/the-house.be/vendor/craftcms/cms/src/web/Application.php(312): craft\\web\\Application->_processActionRequest()","#8 /var/www/vhosts/the-house.be/sites/the-house.be/vendor/yiisoft/yii2/base/Application.php(384): craft\\web\\Application->handleRequest()","#9 /var/www/vhosts/the-house.be/sites/the-house.be/web/index.php(12): yii\\base\\Application->run()","#10 {main}"],"memory":13283872,"exception":"[object] (TypeError(code: 0): craft\\commerce\\elements\\Order::setPaymentAmount(): Argument #1 ($amount) must be of type float, array given, called in /var/www/vhosts/the-house.be/sites/the-house.be/vendor/craftcms/commerce/src/controllers/PaymentsController.php on line 447 at /var/www/vhosts/the-house.be/sites/the-house.be/vendor/craftcms/commerce/src/elements/Order.php:2569)"}

Image

As you can see the field still converts the amount wrong.
It should have been fixed but it isn't.
Maybe it is related.

This issue is really blocking for us since no manual transactions can be registered and this means that the order can't be set to paid.

Steps to reproduce

  1. Set account to Dutch
  2. Open manual transaction dialog
  3. Edit amount to be correctly formatted
  4. Click on save

Expected behavior

The amount should be correctly formatted and should not throw an error.

Actual behavior

Big server error.

Craft CMS version

5.5.5

Craft Commerce version

5.2.8

PHP version

8.2

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions