From bb4050c9912f54e7a34139edf1e43d3488225190 Mon Sep 17 00:00:00 2001 From: Luke Stewart Date: Fri, 28 Jan 2022 10:37:27 +1300 Subject: [PATCH 1/2] Refs #3260975 replaces Deprecated call to drupal_set_message --- src/WebformCivicrmPostProcess.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/WebformCivicrmPostProcess.php b/src/WebformCivicrmPostProcess.php index 6f918dfbb..9493e02f2 100644 --- a/src/WebformCivicrmPostProcess.php +++ b/src/WebformCivicrmPostProcess.php @@ -2085,7 +2085,9 @@ private function submitIPNPayment() { $paymentProcessor->doPayment($params); } catch (\Civi\Payment\Exception\PaymentProcessorException $e) { - drupal_set_message(ts('Payment approval failed with message: ') . $e->getMessage(),'error'); + \Drupal::messenger()->addError(ts('Payment approval failed with message: %error ', [ + '%error' => $e->getMessage(), + ])); \CRM_Utils_System::redirect($this->getIpnRedirectUrl('cancel')); } From dd0fea1116440ad6ca0a690a5cb5cd2548b176ff Mon Sep 17 00:00:00 2001 From: Luke Stewart Date: Sun, 30 Jan 2022 10:47:47 +1300 Subject: [PATCH 2/2] Fix spacing --- src/WebformCivicrmPostProcess.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/WebformCivicrmPostProcess.php b/src/WebformCivicrmPostProcess.php index 9493e02f2..6ff2b3d3a 100644 --- a/src/WebformCivicrmPostProcess.php +++ b/src/WebformCivicrmPostProcess.php @@ -2085,9 +2085,9 @@ private function submitIPNPayment() { $paymentProcessor->doPayment($params); } catch (\Civi\Payment\Exception\PaymentProcessorException $e) { - \Drupal::messenger()->addError(ts('Payment approval failed with message: %error ', [ - '%error' => $e->getMessage(), - ])); + \Drupal::messenger()->addError(ts('Payment approval failed with message: %error ', [ + '%error' => $e->getMessage(), + ])); \CRM_Utils_System::redirect($this->getIpnRedirectUrl('cancel')); }