From b26c99afc17e6ddbdf0f2f0c80287260d5fcb6b6 Mon Sep 17 00:00:00 2001 From: systopia Date: Mon, 14 Sep 2015 14:40:40 +0200 Subject: [PATCH] fixed number format problem with PayPal fee calculation --- CRM/Core/Payment/PayPalImpl.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CRM/Core/Payment/PayPalImpl.php b/CRM/Core/Payment/PayPalImpl.php index e513bace19..6a6607fac1 100644 --- a/CRM/Core/Payment/PayPalImpl.php +++ b/CRM/Core/Payment/PayPalImpl.php @@ -316,7 +316,7 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { $params['fee_amount'] = $result['feeamt']; $params['net_amount'] = CRM_Utils_Array::value('settleamt', $result); if ($params['net_amount'] == 0 && $params['fee_amount'] != 0) { - $params['net_amount'] = $params['gross_amount'] - $params['fee_amount']; + $params['net_amount'] = number_format(($params['gross_amount'] - $params['fee_amount']), 2); } $params['payment_status'] = $result['paymentstatus']; $params['pending_reason'] = $result['pendingreason']; @@ -382,7 +382,7 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { $params['fee_amount'] = $result['feeamt']; $params['net_amount'] = $result['settleamt']; if ($params['net_amount'] == 0 && $params['fee_amount'] != 0) { - $params['net_amount'] = $params['gross_amount'] - $params['fee_amount']; + $params['net_amount'] = number_format(($params['gross_amount'] - $params['fee_amount']), 2); } $params['payment_status'] = $result['paymentstatus']; $params['pending_reason'] = $result['pendingreason']; -- 2.25.1