Skip to content
This repository has been archived by the owner on Aug 26, 2020. It is now read-only.

Commit

Permalink
Added check for captured transactions on process_payment()
Browse files Browse the repository at this point in the history
  • Loading branch information
einkoro committed Apr 6, 2015
1 parent 9b86562 commit 65ee9ed
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion includes/class-wc-gateway-fac.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 65ee9ed

Please sign in to comment.