From c3a10430e46fbaf7e8df635e3e2a7b41f686d1f7 Mon Sep 17 00:00:00 2001 From: Manoj Patel Date: Fri, 4 Oct 2019 15:49:21 +0530 Subject: [PATCH] Made changes to stop getting fater error --- woocommerce-trexle.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 +}