Skip to content

Commit

Permalink
No longer use Server::get, method will be removed.
Browse files Browse the repository at this point in the history
  • Loading branch information
remcotolsma committed Oct 11, 2023
1 parent 205219f commit f641da3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 )

Check failure on line 368 in src/Gateway.php

View workflow job for this annotation

GitHub Actions / phpstan / phpstan

Parameter #1 $merchantID of method Icepay_Api_Base::setMerchantID() expects int, string given.
Expand Down

0 comments on commit f641da3

Please sign in to comment.