From be4037d93af37e0c5a819f48b657303129f6b0f0 Mon Sep 17 00:00:00 2001 From: matej Date: Mon, 13 Oct 2025 20:07:54 +0200 Subject: [PATCH] Set ordered item name to only show Order ID --- .../class-aluxpay-payment-gateway.php | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/aluxpay-payment-gateway/includes/class-aluxpay-payment-gateway.php b/aluxpay-payment-gateway/includes/class-aluxpay-payment-gateway.php index f24e8a3..6c6982e 100644 --- a/aluxpay-payment-gateway/includes/class-aluxpay-payment-gateway.php +++ b/aluxpay-payment-gateway/includes/class-aluxpay-payment-gateway.php @@ -234,28 +234,22 @@ class WC_Aluxpay_Payment_Gateway extends WC_Payment_Gateway { */ private function get_payment_redirect_url($order) { - // Build description without special characters OR encode it - $description = sprintf( - __('Order %s from %s', 'aluxpay-payment-gateway'), - $order->get_id(), - get_bloginfo('name') - ); + // Build the base URL + $base_url = $this->payment_url; + // Build parameters array - NO special characters $params = array( 'wc_order_id' => $order->get_id(), 'total' => $order->get_total(), 'currency' => $order->get_currency(), - 'description' => $description, + 'description' => 'Order ' . $order->get_id(), // ← No # symbol 'customer_email' => $order->get_billing_email(), - 'return_url' => $this->get_return_url($order), - 'cancel_url' => wc_get_checkout_url(), + 'return_url' => urlencode($this->get_return_url($order)), + 'cancel_url' => urlencode(wc_get_checkout_url()), '_wpnonce' => wp_create_nonce('cpg_payment_' . $order->get_id()), ); - // Add nonce for security - $params['_wpnonce'] = wp_create_nonce('cpg_payment_' . $order->get_id()); - - return add_query_arg($params, $this->payment_url); + return add_query_arg($params, $base_url); } /**