From ac7b63b1eedcf1810448ea6b4ab0a8e39bbc4be0 Mon Sep 17 00:00:00 2001 From: Marios Tsiakiris Date: Sun, 14 Mar 2021 21:34:42 +0200 Subject: [PATCH] PHP Fatal error thrown on do_payment. PHP message: PHP Fatal error: Uncaught ArgumentCountError: 3 arguments are required, 2 given in .../wp-content/plugins/woocommerce-simplify-payment-gateway-plugin-2.2.0/includes/class-payment-gateway.php:517 On my installation, I fixed by removing the unnecessary string format specifier among rest description text. From this: '%s - Order #%s' to this: '#%s' Running on PHP8. --- includes/class-payment-gateway.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/class-payment-gateway.php b/includes/class-payment-gateway.php index 0412287..065fdd5 100644 --- a/includes/class-payment-gateway.php +++ b/includes/class-payment-gateway.php @@ -514,7 +514,7 @@ public function do_payment( $order, $amount = 0, $token = array() ) { // Charge the customer $data = array( 'amount' => $amount, // In cents. Rounding to avoid floating point errors. - 'description' => sprintf( __( '%s - Order #%s', 'woocommerce' ), $order->get_order_number() ), + 'description' => sprintf( __( '#%s', 'woocommerce' ), $order->get_order_number() ), 'currency' => strtoupper( get_woocommerce_currency() ), 'reference' => $order->get_id() );