From 93e3a34181e2ec5bedce8b83bd2acae741f84029 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 23 Sep 2021 21:13:10 +1000 Subject: [PATCH 1/2] Fixes for float parsing when the number is less than 1 --- app/Utils/Number.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/Utils/Number.php b/app/Utils/Number.php index c718d076755d..2a284d627913 100644 --- a/app/Utils/Number.php +++ b/app/Utils/Number.php @@ -61,6 +61,9 @@ class Number // convert "," to "." $s = str_replace(',', '.', $value); + if($value < 1) + return (float)$s; + // remove everything except numbers and dot "." $s = preg_replace("/[^0-9\.]/", '', $s); From 02303ef05e21cdac483cd7d099011d65d07e07f9 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 24 Sep 2021 20:29:36 +1000 Subject: [PATCH 2/2] Minor fixes for braintree --- .env.example | 2 +- app/PaymentDrivers/Braintree/CreditCard.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index 76a3928a4063..999073c602e9 100644 --- a/.env.example +++ b/.env.example @@ -54,4 +54,4 @@ PHANTOMJS_SECRET=secret UPDATE_SECRET=secret COMPOSER_AUTH='{"github-oauth": {"github.com": "${{ secrets.GITHUB_TOKEN }}"}}' -SENTRY_LARAVEL_DSN=https://cc7e8e2c678041689e53e409b7dba236@sentry.invoicing.co/5 \ No newline at end of file +SENTRY_LARAVEL_DSN=https://32f01ea994744fa08a0f688769cef78a@sentry.invoicing.co/9 \ No newline at end of file diff --git a/app/PaymentDrivers/Braintree/CreditCard.php b/app/PaymentDrivers/Braintree/CreditCard.php index 1c954e5e8f21..1ce3f4ef0035 100644 --- a/app/PaymentDrivers/Braintree/CreditCard.php +++ b/app/PaymentDrivers/Braintree/CreditCard.php @@ -153,7 +153,7 @@ class CreditCard if ($this->braintree->company_gateway->getConfigField('merchantAccountId')) { /** https://developer.paypal.com/braintree/docs/reference/request/transaction/sale/php#full-example */ - $data['merchantAccountId'] = $this->braintree->company_gateway->getConfigField('merchantAccountId'); + $data['verificationMerchantAccountId'] = $this->braintree->company_gateway->getConfigField('merchantAccountId'); } $response = $this->braintree->gateway->paymentMethod()->create($data);