From f641da3081a11d135be15b496d86ad5f55eef438 Mon Sep 17 00:00:00 2001 From: Remco Tolsma <869674+remcotolsma@users.noreply.github.com> Date: Wed, 11 Oct 2023 12:01:36 +0200 Subject: [PATCH] No longer use `Server::get`, method will be removed. --- src/Gateway.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Gateway.php b/src/Gateway.php index 42b7136..836b3e7 100644 --- a/src/Gateway.php +++ b/src/Gateway.php @@ -20,7 +20,6 @@ use Pronamic\WordPress\Pay\Core\Gateway as Core_Gateway; use Pronamic\WordPress\Pay\Core\PaymentMethod; use Pronamic\WordPress\Pay\Core\PaymentMethods; -use Pronamic\WordPress\Pay\Core\Server; use Pronamic\WordPress\Pay\Fields\CachedCallbackOptions; use Pronamic\WordPress\Pay\Fields\IDealIssuerSelectField; use Pronamic\WordPress\Pay\Fields\SelectField; @@ -356,8 +355,14 @@ public function start( Payment $payment ) { * @param Payment $payment Payment. */ public function update_status( Payment $payment ) { + $method = ''; + + if ( \array_key_exists( 'REQUEST_METHOD', $_SERVER ) ) { + $method = \sanitize_text_field( $_SERVER['REQUEST_METHOD'] ); + } + // Get the Icepay Result and set the required fields. - $result = ( 'POST' === Server::get( 'REQUEST_METHOD' ) ? new Icepay_Postback() : new Icepay_Result() ); + $result = ( 'POST' === $method ? new Icepay_Postback() : new Icepay_Result() ); $result ->setMerchantID( $this->config->merchant_id )