I want to execute a function upon successful payment in Woocommerce.
For example, when a user makes a purchase and clicks the payment button, it would return successful.
I then want to call a function.
How would I accomplish this? Is there a filter I can use in functions.php?
Any help would greatly be appreciated.
For additional context, my function would contain an API call so if a user successfully makes a payment, it would call an API.