Skip to content
Snippets Groups Projects
Commit 2209eaa3 authored by mattwire's avatar mattwire
Browse files

Update definition of getAmount to match current version in CiviCRM core

parent d612be47
Branches
Tags
No related merge requests found
......@@ -169,16 +169,16 @@ class CRM_Core_Payment_Stripe extends CRM_Core_Payment {
*
* Handle any inconsistency about how it is passed in here.
*
* @param $params
* @param array $params
*
* @return int
* @return string
*/
public function getAmount($params): int {
public function getAmount($params = []): string {
$amount = $params['amount'] ?? 0.0;
$amount = number_format($amount, CRM_Utils_Money::getCurrencyPrecision($this->getCurrency($params)), '.', '');
// Stripe amount required in cents.
$amount = preg_replace('/[^\d]/', '', strval($amount));
return (int) $amount;
return $amount;
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment