From 65ee9ed5d6d1d584b7d7c4c9ef2d2ed42bf6a08c Mon Sep 17 00:00:00 2001 From: Einkoro Date: Mon, 6 Apr 2015 14:56:53 -0700 Subject: [PATCH] Added check for captured transactions on process_payment() --- includes/class-wc-gateway-fac.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/includes/class-wc-gateway-fac.php b/includes/class-wc-gateway-fac.php index 1a7dc88..b5ec0d9 100644 --- a/includes/class-wc-gateway-fac.php +++ b/includes/class-wc-gateway-fac.php @@ -288,6 +288,9 @@ public function process_payment($order_id) $transaction = $order->get_transaction_id(); $captured = get_post_meta($order_id, '_fac_captured', true); + // Skip already captured transactions + if ($captured) return; + try { $gateway = $this->setup_gateway(); @@ -399,7 +402,10 @@ public function process_payment($order_id) $message = __('Unfortunately your order cannot be processed as an error has occured.', 'woocommerce') .' '. __('Please attempt your purchase again.', 'woocommerce'); } - wc_add_notice($message, 'error'); + if ( !is_admin() ) + { + wc_add_notice($message, 'error'); + } return; }