Skip to content

Commit

Permalink
Fixed payment error
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeholder committed Dec 11, 2024
1 parent af17df6 commit 6e88f74
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
4 changes: 4 additions & 0 deletions src/controllers/PaymentsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 6e88f74

Please sign in to comment.