Refund IPNs fail due to amount formatting

Created on 9 April 2025, 10 days ago

Problem/Motivation

The reversalAmount that contains the refund amount in the IPN webhook seems to be passed as a formatted string e.g. "1,035.25". The Commerce Price module at some point added validation that number passed to the Price class constructor is numeric, resulting in an error: InvalidArgumentException: The provided value "1,035.25" is not a numeric value. in Drupal\commerce_price\Calculator::assertNumberFormat() (line 261 of /app/docroot/modules/contrib/commerce/modules/price/src/Calculator.php)..

Proposed resolution

Use the number formatter to convert the formatted amount to a price number.

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇵🇪Peru krystalcode

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