diff --git a/woocommerce-trexle.php b/woocommerce-trexle.php index 2c9ff3b..5685458 100644 --- a/woocommerce-trexle.php +++ b/woocommerce-trexle.php @@ -313,7 +313,8 @@ function process_payment( $order_id ) { } else { // Errored - $order->add_order_note(sprintf(__('Trexle Payments error: %s', 'woo_trexle_payments'), $result->error_description)); + $error_description = (isset($result->error_description)) ? $result->error_description : ""; + $order->add_order_note(sprintf(__('Trexle Payments error: %s', 'woo_trexle_payments'), $error_description)); wc_add_notice(__('Payment error: ', 'woo_trexle_payments') . $result->error_description,'error'); } return array( @@ -503,4 +504,4 @@ function add_Trexle_Payments_gateway( $methods ) { } add_filter('woocommerce_payment_gateways', 'add_Trexle_Payments_gateway' ); -} \ No newline at end of file +}