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) { private function get_payment_redirect_url($order) {
// Build description without special characters OR encode it // Build the base URL
$description = sprintf( $base_url = $this->payment_url;
__('Order %s from %s', 'aluxpay-payment-gateway'),
$order->get_id(),
get_bloginfo('name')
);
// Build parameters array - NO special characters
$params = array( $params = array(
'wc_order_id' => $order->get_id(), 'wc_order_id' => $order->get_id(),
'total' => $order->get_total(), 'total' => $order->get_total(),
'currency' => $order->get_currency(), 'currency' => $order->get_currency(),
'description' => $description, 'description' => 'Order ' . $order->get_id(), // ← No # symbol
'customer_email' => $order->get_billing_email(), 'customer_email' => $order->get_billing_email(),
'return_url' => $this->get_return_url($order), 'return_url' => urlencode($this->get_return_url($order)),
'cancel_url' => wc_get_checkout_url(), 'cancel_url' => urlencode(wc_get_checkout_url()),
'_wpnonce' => wp_create_nonce('cpg_payment_' . $order->get_id()), '_wpnonce' => wp_create_nonce('cpg_payment_' . $order->get_id()),
); );
// Add nonce for security return add_query_arg($params, $base_url);
$params['_wpnonce'] = wp_create_nonce('cpg_payment_' . $order->get_id());
return add_query_arg($params, $this->payment_url);
} }
/** /**