diff --git a/simpay-woocommerce-payment.php b/simpay-woocommerce-payment.php index fc53587..b57dda6 100644 --- a/simpay-woocommerce-payment.php +++ b/simpay-woocommerce-payment.php @@ -3,9 +3,11 @@ * Plugin Name: SimPay.pl Płatności Online WooCommerce * Plugin URI: https://simpay.pl * Description: Wtyczka WooCommerce, która umożliwi Ci przyjmowanie płatności Online - * Version: 1.0.0 - * Author: Patryk Vizauer - * Author URI: https://github.com/PatryQHyper + * Version: 1.0.1 + * Author: Payments Solution Sp. z o.o. + * Author URI: https://simpay.pl + * Developer: Patryk Vizauer + * Developer URI: https://github.com/PatryQHyper * License: GPL-2.0+ * License URI: http://www.gnu.org/licenses/gpl-2.0.txt * Text Domain: simpay_woocommerce_payment @@ -49,5 +51,3 @@ function simpay_woocommerce_payment_block_assets() { true ); } - -//simpay_payment_gateway \ No newline at end of file diff --git a/src/SimPay_Gateway.php b/src/SimPay_Gateway.php index 73d858a..6c8fed9 100644 --- a/src/SimPay_Gateway.php +++ b/src/SimPay_Gateway.php @@ -34,7 +34,6 @@ public function simpay_handle_ipn() { return ( new SimPay_IPN_Handler() )->handle( $this->get_option( 'simpay_service_hash' ), $this->get_option( 'simpay_service_id' ), - $this->get_option( 'simpay_bearer' ), $this->get_option( 'simpay_ipn_check_ip' ) === 'yes', ); } diff --git a/src/SimPay_IPN_Handler.php b/src/SimPay_IPN_Handler.php index d98a29f..8f5047b 100644 --- a/src/SimPay_IPN_Handler.php +++ b/src/SimPay_IPN_Handler.php @@ -5,7 +5,6 @@ class SimPay_IPN_Handler { public function handle( string $serviceHash, string $serviceId, - string $bearerToken, bool $validateIp, ) { if ( $_SERVER['REQUEST_METHOD'] !== 'POST' ) { @@ -42,6 +41,10 @@ public function handle( $this->error( 'invalid signature' ); } + if ( $payload['service_id'] !== $serviceId ) { + $this->error( 'invalid service_id' ); + } + if ( $payload['status'] !== 'transaction_paid' ) { header( 'Content-Type: text/plain', true, 200 ); echo 'OK';