I’m having a problem figuring out what function gets called when a payment is completed with Woocommerce and PayPal sends the IPN.
The IPN is being received because PayPal log file is being updated as soon as I click Pay, but I can’t figure out what function is writing to that file.
I need to figure out if there is already a built in functionality to send emails to the admin when an order is created, and where this happens.
If it does exist I need to modify it to email other people too, and if not then I need to create it myself, but I need to know where to put the code.
Checking the file
/wp-content/plugins/woocommerce/classes/gateways/paypal/class-wc-paypal.php, we see that there’s an action hook inside the functioncheck_ipn_response:You can hook into it like this: