Set ordered item name to only show Order ID

This commit is contained in:
2025-10-13 20:07:54 +02:00
parent a92b8021f6
commit be4037d93a

View File

@@ -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);
}
/**