Posted: June 30, 2015 at 8:34 pm
|
The action hook list provides no description on when and how each hook should be used. I am trying to trigger an action when payment is completed for a user but am having trouble figuring out which hook I should be using. I tried action_hook_espresso_track_successful_sale but when I manually set the attendee payment status to complete my function did not trigger. Some insight into which hooks I should be looking at would be helpful. using version 3.1.36.4.P |
|
Hi, action_hook_espresso_track_successful_sale or action_hook_espresso_email_after_payment are likely the best two to use, as they both fire after a payment. However it sounds like you are trying to do something different. You said “when I manually set the attendee payment status to complete my function did not trigger”, which is correct, because those hooks fire when a payment is completed via a gateway not when a status is changed in the admin. For example, if you are editing an attendee in the admin, you could use the action_hook_espresso_save_attendee_data hook that fires just before the attendee data is saved. If you could provide some further information on your process and what you are trying to achieve, we can provide more insight on the right hook or method to use. |
|
When a successful payment is made I generate a unique access url which I then email to the customer. Payments are accepted via paypal and invoice. I am assuming that when payment is made via paypal the action hooks action_hook_espresso_track_successful_sale and action_hook_espresso_email_after_payment hook are triggered. Which hook gets triggered when an invoice payment is made? Is the action_hook_espresso_save_attendee_data the only one I can rely on? Some more insight would definitely be helpful. Thanks |
Hi Ryan, Technically, no hooks are fired when an invoice payment is made, because an invoice payment is handled offline (eg, they mail a check or deliver the payment in person). However, there is a hook that fires when an attendee payment status is updated in the admin. Its name is action_hook_espresso_update_attendee_payment_status. It will fire when you go into Event Espresso > Edit Attendee Payment Record and enter a payment and click Update Payment. |
|
|
Thanks, Seems I will need to trigger my function when either action_hook_espresso_update_attendee_payment_status or action_hook_espresso_track_successful_sale is fired. Thanks for the help. |
The support post ‘Action hook when attendee payment status goes to completed’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.