Posted: November 13, 2016 at 12:38 pm
I am trying to get the event datetime name, event datetime start date & event venue, from within the set_redirection_info() function as part of a payment gateway module. Currently i can getting the transaction(), primary_registration() info.
This is what i am calling so far but not sure how to use this to get event datetime info and event venue.
$total_line_item = $transaction->total_line_item();
any ideas? thanks for any help.
There’s a method that returns the event object from the payment in core/libraries/payment_methods/EE_Gateway.lib.php. Its name is
Thanks for that, I can see the function in the plugin but can’t find any documentation on how to use it.
Is this how i return the event date?
When a method starts with an underscore it will be a private or protected function which means you can’t call it. (That’s also a different method,
I think Josh was providing that method as an example of how to return the event from a payment. So looking within
Then uses the transaction to pull the primary registration (because transactions are assigned to registrations, not events):
Then finally returns the event object using the Primary Registration:
There’s some additional sanity checks in there but that’s basically it.
So if you have the primary registration you can run event_obj() on that object to get the event object, if you have the event object you have all of the event details, including anything assigned to the event, like venues etc
Datetime info should not be taken from the event itself as an event can have multiple datetimes and tickets, and certain tickets can apply to certain datetimes. You need to pull the tickets for the transaction and the loop over all of those and pull the datetimes for each.
This is the code i ended up.
$transaction = $payment->transaction();
The support post ‘Get event datetime name & date and event venue from transaction details.’ 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.