I've a problem with one of my WooCommerce functions. This is the function:
add_action( 'woocommerce_checkout_order_processed', 'create_order_pending_notification' );
function create_order_pending_notification( $order_id ) {
create_notification();
}
So when the user presses the checkout button, the hook get's fired and an order creation notification get's fired. If he cancel now the payment, PayPal redirects the user back to the checkout. If he press now the checkout button again, the same notification get's created twice.
So do you have any idea to prevent that the notification get's created just during the initial pay now button click?