Bug: Payment confirmation emails not sent (processing)
-
When customers complete their iDeal payment, no “payment is complete” (processing) email is sent (in my installation). They only receive the “Payment is pending” (on-hold) email.
After inspecting the iDeal plugin, it appears that the transactional email should be sent after calling $order->payment_complete($source_id) in woo-ideal-gateway-class-stripe-webhook.php. It is not working because woocommerce has not yet initialized the transactional emails.
woo-ideal-gateway-class-stripe-webhook.php is included and run in the function IncludeClasses(). This function is called using add_action(‘init’, ‘IncludeClasses’); (in file woo-ideal-gateway.php).
Woocommerce configures the transactional emails with add_action( ‘init’, array( ‘WC_Emails’, ‘init_transactional_emails’ ) ); The relevant hook is “woocommerce_order_status_on-hold_to_processing” in this case. Because add_action calls use the same priority (10: default), it can happen that the Stripe webhook is executed before Woocommerce is ready.
Suggested fix in woo-ideal-gateway.php:
Change
[89] add_action(‘init’, ‘IncludeClasses’);
Into
[89] add_action(‘init’, ‘IncludeClasses’, 11);This change fixed the issue for me.
Thanks in advance.
- The topic ‘Bug: Payment confirmation emails not sent (processing)’ is closed to new replies.