From 6e88f74a22734af25530195dc17e417fca53d48a Mon Sep 17 00:00:00 2001 From: Luke Holder Date: Wed, 11 Dec 2024 17:46:20 +0800 Subject: [PATCH] Fixed payment error --- CHANGELOG.md | 1 + src/controllers/PaymentsController.php | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a9443676af..2593fe2b8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Unreleased +- Fixed a PHP error when making a partial payment on an order from the control panel. ([#3804](https://github.com/craftcms/commerce/issues/3804)) - Fixed a PHP error that could occur when calculating order totals. ([#3802](https://github.com/craftcms/commerce/issues/3802)) - Fixed a bug where a product’s default price was showing incorrectly on the Products index page. ([#3807](https://github.com/craftcms/commerce/issues/3807)) - Fixed a bug where inline-editable Matrix fields weren’t saving content on product variants. ([#3805](https://github.com/craftcms/commerce/issues/3805)) diff --git a/src/controllers/PaymentsController.php b/src/controllers/PaymentsController.php index 53f5a7b21a..fade889fec 100644 --- a/src/controllers/PaymentsController.php +++ b/src/controllers/PaymentsController.php @@ -442,6 +442,10 @@ public function actionPay(): ?Response if ($isCpAndAllowed) { // Payment amount in the CP accepts number based in the user's formatting locale $cpPaymentAmount = $this->request->getBodyParam('paymentAmount'); + + if(is_array($cpPaymentAmount)) { + $cpPaymentAmount = $cpPaymentAmount['value']; + } $cpPaymentAmount = Localization::normalizeNumber($cpPaymentAmount); $order->setPaymentAmount($cpPaymentAmount);