From 5d7d4b6b9f5d0f6270d492f0ac1dd3e74db2eb91 Mon Sep 17 00:00:00 2001 From: Devin Walker Date: Tue, 10 Dec 2024 08:48:51 -0800 Subject: [PATCH 1/2] Format donation count output in progress bar component (#7209) Co-authored-by: Jon Waldstein Co-authored-by: Kyle B. Johnson --- src/MultiFormGoals/ProgressBar/Model.php | 17 +++++++++++++++++ .../resources/views/progressbar.php | 5 ++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/MultiFormGoals/ProgressBar/Model.php b/src/MultiFormGoals/ProgressBar/Model.php index ea024438e2..23beb43e8b 100644 --- a/src/MultiFormGoals/ProgressBar/Model.php +++ b/src/MultiFormGoals/ProgressBar/Model.php @@ -161,6 +161,23 @@ public function getDonationCount(): int return $results->count; } + /** + * Get formatted number of donations + * + * @unreleased + */ + public function getFormattedDonationCount(): string + { + return give_format_amount( + $this->getDonationCount(), + [ + 'sanitize' => false, + 'decimal' => false, + 'currency' => false, + ] + ); + } + /** * Get formatted total remaining (ex: $75) * diff --git a/src/MultiFormGoals/resources/views/progressbar.php b/src/MultiFormGoals/resources/views/progressbar.php index ac27e0ab47..b487d1815e 100644 --- a/src/MultiFormGoals/resources/views/progressbar.php +++ b/src/MultiFormGoals/resources/views/progressbar.php @@ -2,6 +2,9 @@ /** * Multi-Form Goals block/shortcode template * Styles for this template are defined in 'blocks/multi-form-goals/common.scss' + * + * @unreleased Format the donation count + * * @var Give\MultiFormGoals\ProgressBar\Model $this */ @@ -32,7 +35,7 @@
getDonationCount()); ?>
+ echo esc_html($this->getFormattedDonationCount()); ?>
getDonationCount(), 'give'); ?>
From fe74928fd9b9ec144b754f4445f564a6fe2cca35 Mon Sep 17 00:00:00 2001 From: Jon Waldstein Date: Tue, 10 Dec 2024 15:51:29 -0500 Subject: [PATCH 2/2] Fix: PayPal onboarding with email address that has plus sign (#7393) Co-authored-by: Jon Waldstein --- .../PayPalCommerce/onBoardingRedirectHandler.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/PaymentGateways/PayPalCommerce/onBoardingRedirectHandler.php b/src/PaymentGateways/PayPalCommerce/onBoardingRedirectHandler.php index 5c3e0a04e7..bf093ecc48 100644 --- a/src/PaymentGateways/PayPalCommerce/onBoardingRedirectHandler.php +++ b/src/PaymentGateways/PayPalCommerce/onBoardingRedirectHandler.php @@ -130,6 +130,7 @@ public function boot() /** * Save PayPal merchant details * + * @unreleased fix parsing email with special characters * @since 2.32.0 Remove second argument from updateSellerAccessToken function. * @since 2.25.0 Handle exception. * @since 2.9.0 @@ -138,7 +139,7 @@ public function boot() */ private function savePayPalMerchantDetails() { - $paypalGetData = wp_parse_args($_SERVER['QUERY_STRING']); + $paypalGetData = wp_parse_args(str_replace("+", rawurlencode("+"), $_SERVER['QUERY_STRING'])); $partnerLinkInfo = $this->settings->getPartnerLinkDetails(); $tokenInfo = $this->settings->getAccessToken();