Skip to content

Commit 69e16ba

Browse files
committed
Fix getAmount for non decimal separator (CRM_Core_Payment->getAmount returns a localized format)
1 parent 331e7c2 commit 69e16ba

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

CRM/Core/Payment/OmnipayMultiProcessor.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,17 @@ protected function getCreditCardOptions($params) {
635635
return $creditCardOptions;
636636
}
637637

638+
/**
639+
* Get the amount as a float
640+
* @param array $params
641+
*
642+
* @return mixed
643+
*/
644+
protected function getAmount($params = []) {
645+
$params['amount'] = $params['amount'] ?? 0.0;
646+
return filter_var($params['amount'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
647+
}
648+
638649
/**
639650
* This function checks to see if we have the right config values.
640651
*

0 commit comments

Comments
 (0)