Support

Home Forums Event Espresso Premium Getting payment and transaction objects from hook after payment is applied Reply To: Getting payment and transaction objects from hook after payment is applied

Reply To: Getting payment and transaction objects from hook after payment is applied

Author Replies
Tony # Posted on May 3, 2018 at 2:02 am

Thanks, but I only added that so that I can debug as I can’t use logs or the console to generate output.

Sure you can, you can use a little function like this: http://www.stumiller.me/sending-output-to-the-wordpress-debug-log/

Add this snippet to your wp-config.php file:

https://eventespresso.com/wiki/troubleshooting-checklist/#wpdebug

The write_log function then writes whatever you pass it to /wp-content/debug.log

I opened a ticket earlier, in which someone told me that the format of the object data has changed from an example that I was working from (custom shortcode in the messages).

That’s was me and it only applied to the messages system and my example code, to provide more context, the $extra_data var was just a single object, and it was usually the EE_Attendee object, now $extra_data is an array in which one of the elements will usually be an EE_Attendee object, but there could be more elements in the array to be used as… well, extra data 🙂

I’m using your code in WP console and replicating it by pulling in an EE Transaction, then pulling a payment from that transaction so I have the same objects you should have – http://take.ms/ljJNB

That works and emails me the object and event_id – http://take.ms/ZXTzV

I then hooked into AHEE__EE_Payment_Processor__update_txn_based_on_payment__successful with your function and ran a registration using Stripe, the result was another set of emails containing the data – http://take.ms/T6dWO (Note the ID’s are different as it’s a new transaction/payment)

So the code you are using above seems to be working fine?

Which payment method are you using to complete the payment?

When you say it doesn’t work, what is happening? What emails do you receive?

Do NOT follow this link or you will be banned from the site!