-
Notifications
You must be signed in to change notification settings - Fork 52
Open
Description
Is this extra array_walk doing anything to the values? https://github.com/marlon-be/marlon-ogone/blob/master/lib/Ogone/ParameterFilter/GeneralParameterFilter.php#L19
As far as I can tell it's not changing any of the values as the trimmed values are not saved in the original values by trim().
Note: If you decide to fix this with a proper callback so that original values get changed, be careful to only trim values which are of type "string". Trimming int/float results in string and Ogone will fail when, for example, "AMOUNT" is a string.
Something like:
public function filter(array $parameters)
{
$parameters = array_change_key_case($parameters, CASE_UPPER);
array_walk($parameters, function (&$value) {
$value = is_string($value) ? trim($value) : $value;
});
$parameters = array_filter($parameters, function ($value) {
return (bool) strlen($value);
});
return $parameters;
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels